Skip to content

Commit

Permalink
fix: re implementation of res-type (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rooyca committed Jun 20, 2024
1 parent 81319da commit e254002
Show file tree
Hide file tree
Showing 11 changed files with 379 additions and 243 deletions.
10 changes: 10 additions & 0 deletions docs/docs/en/codeblocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Flags are the way to specify the parameters of our request and also the format i
| [save-to](#save-to) | |
| [properties](#properties) | |
| [render](#render)| false |
| [res-type](#res-type)| |

### url

Expand Down Expand Up @@ -268,4 +269,13 @@ render
```
~~~

## res-type

Specifies the type of the response. If this flag is not present the plugin will try to guess the type based on the response content-type. This could be used *as an optional fallback feature*.

~~~markdown
```req
url: https://jsonplaceholder.typicode.com/posts/1
res-type: json
```
~~~
11 changes: 11 additions & 0 deletions docs/docs/es/codeblocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Las banderas son la forma de especificar los parámetros de nuestra solicitud y
| [save-to](#save-to) | |
| [properties](#properties) | |
| [render](#render) | false |
| [res-type](#res-type) | |

### url

Expand Down Expand Up @@ -267,3 +268,13 @@ render
```
~~~

## res-type

Espefica el tipo de respuesta. Si esta bandera no está presente, el plugin intentará adivinar el tipo basado en el tipo de contenido de la respuesta. Esto podría usarse *como una característica opcional de respaldo*.

~~~markdown
```req
url: https://jsonplaceholder.typicode.com/posts/1
res-type: json
```
~~~
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/regx.ts → src/functions/regx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ export const varname_regx = /{{this\.([^{}]*)}}/g;

// Matches "{{this." or "}}" globally
export const no_varname_regx = /{{this\.|}}/g;

// Matches "{{KEY}}" globally
export const key_regx = /{{(?!this\.)[^{}]*}}/g;
Loading

0 comments on commit e254002

Please sign in to comment.