Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 TXTInflection & TXTSentences move to @ezs/strings #368

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions docs/plugin-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ npm install @ezs/basics
- [TARDump](#tardump)
- [TARExtract](#tarextract)
- [TXTConcat](#txtconcat)
- [TXTInflection](#txtinflection)
- [TXTObject](#txtobject)
- [TXTParse](#txtparse)
- [TXTSentences](#txtsentences)
- [TXTZip](#txtzip)
- [URLConnect](#urlconnect)
- [URLFetch](#urlfetch)
Expand Down Expand Up @@ -367,7 +365,6 @@ Output:
#### Parameters

- `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to split at every JSONPath found (optional, default `"*"`)
- `legacy` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** use legacy or newer parser (separator should be different) (optional, default `true`)

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**

Expand Down Expand Up @@ -598,46 +595,6 @@ Output:

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### TXTInflection

Take a `String` and inflect it with or more transformers from this list
pluralize, singularize, camelize, underscore, humanize, capitalize,
dasherize, titleize, demodulize, tableize, classify, foreign_key, ordinalize

Input:

```json
{ "id": 1, "value": "all job" }
```

Script:

```ini
[TXTInflection]
transform = pluralize
transform = capitalize
transform = dasherize
```

Output:

```json
{ "id": 1, "value": "All-jobs" }
```

#### Parameters

- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path of the field to segment (optional, default `"value"`)
- `transform` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of a transformer

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)>**

**Meta**

- **deprecated**: see <https://inist-cnrs.github.io/ezs/#/plugin-strings?id=inflection>
see <https://www.npmjs.com/package/inflection>


### TXTObject

Take an array of values and generate an array containing objects with the
Expand Down Expand Up @@ -683,33 +640,6 @@ Output:

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### TXTSentences

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

Input:

```json
{ "id": 1, "value": "First sentence? Second sentence. My name is Bond, J. Bond." }
```

Output:

```json
{ "id": 1, "value": ["First sentence?", "Second sentence.", "My name is Bond, J. Bond."] }
```

#### Parameters

- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path of the field to segment (optional, default `"value"`)

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**

**Meta**

- **deprecated**: see <https://inist-cnrs.github.io/ezs/#/plugin-strings?id=sentences>


### TXTZip

Take a `String` and zip it.
Expand Down
14 changes: 7 additions & 7 deletions docs/plugin-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ npm install @ezs/core

Plusieurs instructions permettent de créer des sous flux (sub pipeline), à partir d'un fichier d’instructions ou d'instructions imbriquées. Si elles s'utilisent toutes de la même manière (avec les mêmes paramètres) centaines peuvent apparaître comme similaires mais leur fonctionnement est différent :

- [delegate] : 1 sous flux pour tous les éléments
- [swing] : 1 sous flux pour tous les éléments filtrés selon une condition
- [spaw] : 1 sous flux par élément
- [loop] : 1 sous flux par élément
- [expand] : 1 sous flux pour N éléments (N = size), seul le champ sélectionné est envoyé dans le pipeline
- [combine] : 1 sous flux pour tous les éléments, seul le champ sélectionné est comparé avec le résultat du sous flux
- [singleton] : 1 sous flux pour le premier élément
- [delegate] &#x3A; 1 sous flux pour tous les éléments
- [swing] &#x3A; 1 sous flux pour tous les éléments filtrés selon une condition
- [spaw] &#x3A; 1 sous flux par élément
- [loop] &#x3A; 1 sous flux par élément
- [expand] &#x3A; 1 sous flux pour N éléments (N = size), seul le champ sélectionné est envoyé dans le pipeline
- [combine] &#x3A; 1 sous flux pour tous les éléments, seul le champ sélectionné est comparé avec le résultat du sous flux
- [singleton] &#x3A; 1 sous flux pour le premier élément

## usage

Expand Down
70 changes: 0 additions & 70 deletions packages/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ npm install @ezs/basics
- [TARDump](#tardump)
- [TARExtract](#tarextract)
- [TXTConcat](#txtconcat)
- [TXTInflection](#txtinflection)
- [TXTObject](#txtobject)
- [TXTParse](#txtparse)
- [TXTSentences](#txtsentences)
- [TXTZip](#txtzip)
- [URLConnect](#urlconnect)
- [URLFetch](#urlfetch)
Expand Down Expand Up @@ -367,7 +365,6 @@ Output:
#### Parameters

- `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to split at every JSONPath found (optional, default `"*"`)
- `legacy` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** use legacy or newer parser (separator should be different) (optional, default `true`)

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**

Expand Down Expand Up @@ -598,46 +595,6 @@ Output:

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### TXTInflection

Take a `String` and inflect it with or more transformers from this list
pluralize, singularize, camelize, underscore, humanize, capitalize,
dasherize, titleize, demodulize, tableize, classify, foreign_key, ordinalize

Input:

```json
{ "id": 1, "value": "all job" }
```

Script:

```ini
[TXTInflection]
transform = pluralize
transform = capitalize
transform = dasherize
```

Output:

```json
{ "id": 1, "value": "All-jobs" }
```

#### Parameters

- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path of the field to segment (optional, default `"value"`)
- `transform` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of a transformer

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**

**Meta**

- **deprecated**: see <https://inist-cnrs.github.io/ezs/#/plugin-strings?id=inflection>
see <https://www.npmjs.com/package/inflection>


### TXTObject

Take an array of values and generate an array containing objects with the
Expand Down Expand Up @@ -683,33 +640,6 @@ Output:

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### TXTSentences

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

Input:

```json
{ "id": 1, "value": "First sentence? Second sentence. My name is Bond, J. Bond." }
```

Output:

```json
{ "id": 1, "value": ["First sentence?", "Second sentence.", "My name is Bond, J. Bond."] }
```

#### Parameters

- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path of the field to segment (optional, default `"value"`)

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**

**Meta**

- **deprecated**: see <https://inist-cnrs.github.io/ezs/#/plugin-strings?id=sentences>


### TXTZip

Take a `String` and zip it.
Expand Down
Loading
Loading