json-e
Advanced tools
Comparing version 4.1.0 to 4.3.0
{ | ||
"name": "json-e", | ||
"version": "4.1.0", | ||
"version": "4.3.0", | ||
"description": "json parameterization module inspired from json-parameterization", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -827,2 +827,3 @@ * [Full documentation](https://json-e.js.org) | ||
- {$eval: 'strip(" room ")'} | ||
- {$eval: 'split("left:right", ":")'} | ||
context: {} | ||
@@ -836,4 +837,19 @@ result: | ||
- room | ||
- [left, right] | ||
``` | ||
#### Arrays | ||
```yaml | ||
template: | ||
# Joins arrays of strings and numbers (including mixed types) into a string using a separator, | ||
# which can also be either string or number. | ||
- {$eval: 'join(["carpe", "diem"], " ")'} | ||
- {$eval: 'join([1, 3], 2)}'} | ||
context: {} | ||
result: | ||
- carpe diem | ||
- "123" | ||
``` | ||
#### Context | ||
@@ -840,0 +856,0 @@ |
@@ -128,2 +128,13 @@ var {BuiltinError} = require('./error'); | ||
define('split', builtins, { | ||
minArgs: 1, | ||
variadic: 'string|number', | ||
invoke: (input, delimiter) => input.split(delimiter) | ||
}); | ||
define('join', builtins, { | ||
argumentTests: ['array', 'string|number'], | ||
invoke: (list, separator) => list.join(separator) | ||
}); | ||
// Miscellaneous | ||
@@ -130,0 +141,0 @@ define('fromNow', builtins, { |
Sorry, the diff of this file is not supported yet
91286
1338
903