Skip to content

Commit 0ccfb88

Browse files
committed
refactor: 💡 change statement name
BREAKING CHANGE: 🧨 All uses of the instructions must be converted.
1 parent c174f63 commit 0ccfb88

File tree

15 files changed

+128
-176
lines changed

15 files changed

+128
-176
lines changed

docs/plugin-basics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ Useful to send JSON data to an API and get results.
734734
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
735735
* `streaming` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Direct connection to the Object Stream server (disables the retries setting) (optional, default `false`)
736736
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Parse as JSON the content of URL (optional, default `false`)
737-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
737+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `5000`)
738738
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors (optional, default `false`)
739739
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
740740
* `encoder` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The statement to encode each chunk to a string (optional, default `dump`)
@@ -755,7 +755,7 @@ Or if no target is specified, the output will be the returned content of URL.
755755
* `target` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** choose the key to set
756756
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** parse as JSON the content of URL (optional, default `false`)
757757
* `dataurl` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** encode content into DATA Url (optional, default `false`)
758-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** timeout in milliseconds (optional, default `1000`)
758+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** timeout in milliseconds (optional, default `5000`)
759759
* `mimetype` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** mimetype for value of path (if presents) (optional, default `"application/json"`)
760760
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore all errors, the target field will remain undefined (optional, default `false`)
761761
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
@@ -883,7 +883,7 @@ Output:
883883
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
884884
* `json` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse result as json (optional, default `true`)
885885
* `target` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** choose the key to set
886-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
886+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `5000`)
887887
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors, the target field will remain undefined (optional, default `false`)
888888
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
889889
* `insert` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** a header response value in the result
@@ -952,7 +952,7 @@ Output:
952952

953953
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch (by default input string is taken)
954954
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose the path to split JSON result (optional, default `"*"`)
955-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
955+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `5000`)
956956
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors, the target field will remain undefined (optional, default `false`)
957957
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
958958

docs/plugin-core.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ peuvent apparaître comme similaires mais leur fonctionnement est différent :
7171
* [truncate](#truncate)
7272
* [ungroup](#ungroup)
7373
* [unpack](#unpack)
74-
* [use](#use)
7574
* [validate](#validate)
7675

7776
### assign
@@ -1459,26 +1458,6 @@ Take `String`s or `Buffer`s and throw `Object` builded by JSON.parse on each lin
14591458
14601459
Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
14611460
1462-
### use
1463-
1464-
Take all `String`, concat them and throw just one.
1465-
1466-
Script:
1467-
1468-
```ini
1469-
[use]
1470-
plugin = basics
1471-
plugin = analytics
1472-
```
1473-
1474-
#### Parameters
1475-
1476-
* `beginWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the begin
1477-
* `joinWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** use value to join 2 chunk
1478-
* `endWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the end
1479-
1480-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
1481-
14821461
### validate
14831462
14841463
From an `Object`, throw the same object if all rules pass

docs/plugin-strings.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ plugin = strings
2222

2323
#### Table of Contents
2424

25-
* [decode](#decode)
26-
* [encode](#encode)
27-
* [inflection](#inflection)
28-
* [sentences](#sentences)
25+
* [STRDecode](#strdecode)
26+
* [STREncode](#strencode)
27+
* [STRInflection](#strinflection)
28+
* [STRSentences](#strsentences)
2929

30-
### decode
30+
### STRDecode
3131

3232
Decodes a given string using a provided mapping, replacing strings that
3333
match values (to)in the mapping with their corresponding keys (from). Optionally, a
@@ -50,7 +50,7 @@ Input:
5050
Script:
5151

5252
```ini
53-
[decode]
53+
[STRDecode]
5454
path = value
5555
from = 1
5656
to = one
@@ -86,7 +86,7 @@ See `encode`.
8686
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be removed from the beginning of each replaced substring. (optional, default `""`)
8787
* `suffix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be removed from the end of each replaced substring. (optional, default `""`)
8888

89-
### encode
89+
### STREncode
9090

9191
Encodes a given string using a provided mapping, replacing characters that
9292
match keys in the mapping with their corresponding values. Optionally, a
@@ -107,7 +107,7 @@ Input:
107107
Script:
108108

109109
```ini
110-
[encode]
110+
[STREncode]
111111
path = value
112112
from = 1
113113
to = one
@@ -137,7 +137,7 @@ Output:
137137
138138
> ⚠ You must give as much `from` as `to`.
139139
140-
See `decode` to invert the processus.
140+
See `STRDecode` to invert the processus.
141141

142142
#### Parameters
143143

@@ -147,7 +147,7 @@ See `decode` to invert the processus.
147147
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be added to the beginning of each replaced substring. (optional, default `""`)
148148
* `suffix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be added to the end of each replaced substring. (optional, default `""`)
149149

150-
### inflection
150+
### STRInflection
151151

152152
Take a `String` and inflect it with or more transformers from this list
153153
pluralize, singularize, camelize, underscore, humanize, capitalize,
@@ -162,7 +162,7 @@ Input:
162162
Script:
163163

164164
```ini
165-
[inflection]
165+
[STRInflection]
166166
path = value
167167
transform = pluralize
168168
transform = capitalize
@@ -187,7 +187,7 @@ see <https://www.npmjs.com/package/inflection>
187187

188188
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
189189

190-
### sentences
190+
### STRSentences
191191

192192
Take a `String` and split it into an array of sentences.
193193

packages/basics/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ Useful to send JSON data to an API and get results.
734734
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
735735
* `streaming` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Direct connection to the Object Stream server (disables the retries setting) (optional, default `false`)
736736
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Parse as JSON the content of URL (optional, default `false`)
737-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
737+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `5000`)
738738
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors (optional, default `false`)
739739
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
740740
* `encoder` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The statement to encode each chunk to a string (optional, default `dump`)
@@ -755,7 +755,7 @@ Or if no target is specified, the output will be the returned content of URL.
755755
* `target` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** choose the key to set
756756
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** parse as JSON the content of URL (optional, default `false`)
757757
* `dataurl` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** encode content into DATA Url (optional, default `false`)
758-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** timeout in milliseconds (optional, default `1000`)
758+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** timeout in milliseconds (optional, default `5000`)
759759
* `mimetype` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** mimetype for value of path (if presents) (optional, default `"application/json"`)
760760
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore all errors, the target field will remain undefined (optional, default `false`)
761761
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
@@ -883,7 +883,7 @@ Output:
883883
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
884884
* `json` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse result as json (optional, default `true`)
885885
* `target` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** choose the key to set
886-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
886+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `5000`)
887887
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors, the target field will remain undefined (optional, default `false`)
888888
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
889889
* `insert` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** a header response value in the result
@@ -952,7 +952,7 @@ Output:
952952

953953
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch (by default input string is taken)
954954
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose the path to split JSON result (optional, default `"*"`)
955-
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
955+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `5000`)
956956
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors, the target field will remain undefined (optional, default `false`)
957957
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
958958

packages/core/README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ peuvent apparaître comme similaires mais leur fonctionnement est différent :
7171
* [truncate](#truncate)
7272
* [ungroup](#ungroup)
7373
* [unpack](#unpack)
74-
* [use](#use)
7574
* [validate](#validate)
7675

7776
### assign
@@ -1459,26 +1458,6 @@ Take `String`s or `Buffer`s and throw `Object` builded by JSON.parse on each lin
14591458
14601459
Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
14611460
1462-
### use
1463-
1464-
Take all `String`, concat them and throw just one.
1465-
1466-
Script:
1467-
1468-
```ini
1469-
[use]
1470-
plugin = basics
1471-
plugin = analytics
1472-
```
1473-
1474-
#### Parameters
1475-
1476-
* `beginWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the begin
1477-
* `joinWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** use value to join 2 chunk
1478-
* `endWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the end
1479-
1480-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
1481-
14821461
### validate
14831462
14841463
From an `Object`, throw the same object if all rules pass

packages/strings/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ plugin = strings
2222

2323
#### Table of Contents
2424

25-
* [decode](#decode)
26-
* [encode](#encode)
27-
* [inflection](#inflection)
28-
* [sentences](#sentences)
25+
* [STRDecode](#strdecode)
26+
* [STREncode](#strencode)
27+
* [STRInflection](#strinflection)
28+
* [STRSentences](#strsentences)
2929

30-
### decode
30+
### STRDecode
3131

3232
Decodes a given string using a provided mapping, replacing strings that
3333
match values (to)in the mapping with their corresponding keys (from). Optionally, a
@@ -50,7 +50,7 @@ Input:
5050
Script:
5151

5252
```ini
53-
[decode]
53+
[STRDecode]
5454
path = value
5555
from = 1
5656
to = one
@@ -86,7 +86,7 @@ See `encode`.
8686
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be removed from the beginning of each replaced substring. (optional, default `""`)
8787
* `suffix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be removed from the end of each replaced substring. (optional, default `""`)
8888

89-
### encode
89+
### STREncode
9090

9191
Encodes a given string using a provided mapping, replacing characters that
9292
match keys in the mapping with their corresponding values. Optionally, a
@@ -107,7 +107,7 @@ Input:
107107
Script:
108108

109109
```ini
110-
[encode]
110+
[STREncode]
111111
path = value
112112
from = 1
113113
to = one
@@ -137,7 +137,7 @@ Output:
137137
138138
> ⚠ You must give as much `from` as `to`.
139139
140-
See `decode` to invert the processus.
140+
See `STRDecode` to invert the processus.
141141

142142
#### Parameters
143143

@@ -147,7 +147,7 @@ See `decode` to invert the processus.
147147
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be added to the beginning of each replaced substring. (optional, default `""`)
148148
* `suffix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string to be added to the end of each replaced substring. (optional, default `""`)
149149

150-
### inflection
150+
### STRInflection
151151

152152
Take a `String` and inflect it with or more transformers from this list
153153
pluralize, singularize, camelize, underscore, humanize, capitalize,
@@ -162,7 +162,7 @@ Input:
162162
Script:
163163

164164
```ini
165-
[inflection]
165+
[STRInflection]
166166
path = value
167167
transform = pluralize
168168
transform = capitalize
@@ -187,7 +187,7 @@ see <https://www.npmjs.com/package/inflection>
187187

188188
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
189189

190-
### sentences
190+
### STRSentences
191191

192192
Take a `String` and split it into an array of sentences.
193193

packages/strings/src/decode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { get, set } from 'lodash';
2222
* Script:
2323
*
2424
* ```ini
25-
* [decode]
25+
* [STRDecode]
2626
* path = value
2727
* from = 1
2828
* to = one
@@ -50,7 +50,7 @@ import { get, set } from 'lodash';
5050
*
5151
* See `encode`.
5252
*
53-
* @name decode
53+
* @name STRDecode
5454
* @param {string} path - The path of the string to be decoded, within data.
5555
* @param {string[]} from - An array of strings to replace with.
5656
* @param {string[]} to - An array of strings to be replaced.

packages/strings/src/encode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { get, set } from 'lodash';
2020
* Script:
2121
*
2222
* ```ini
23-
* [encode]
23+
* [STREncode]
2424
* path = value
2525
* from = 1
2626
* to = one
@@ -50,9 +50,9 @@ import { get, set } from 'lodash';
5050
*
5151
* > ⚠ You must give as much `from` as `to`.
5252
*
53-
* See `decode` to invert the processus.
53+
* See `STRDecode` to invert the processus.
5454
*
55-
* @name encode
55+
* @name STREncode
5656
* @param {string} path - The path of the string to be encoded, within data.
5757
* @param {string[]} from - An array of strings to replace.
5858
* @param {string[]} to - An array of strings to replace with.

packages/strings/src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import decode from './decode';
2-
import encode from './encode';
3-
import inflection from './inflection';
4-
import sentences from './sentences';
1+
import STRDecode from './decode';
2+
import STREncode from './encode';
3+
import STRInflection from './inflection';
4+
import STRSentences from './sentences';
55

66
const funcs = {
7-
decode,
8-
encode,
9-
inflection,
10-
sentences,
7+
STRDecode,
8+
STREncode,
9+
STRInflection,
10+
STRSentences,
1111
};
1212

1313
export default funcs;

0 commit comments

Comments
 (0)