Comparing version 1.0.4 to 1.0.5
@@ -9,3 +9,7 @@ ## JSONata Function Library | ||
Casts the `arg` parameter to a string | ||
Casts the `arg` parameter to a string using the following casting rules | ||
- Strings are unchanged | ||
- Functions are converted to an empty string | ||
- Numeric infinity and NaN throw an error because they cannot be represented as a JSON number | ||
- All other values are converted to a JSON string using the [JSON.stringify](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) function | ||
@@ -58,3 +62,6 @@ - `$length(str)` | ||
Cast the value of `arg` to a number | ||
Casts the `arg` parameter to a number using the following casting rules | ||
- Numbers are unchanged | ||
- Strings that contain a sequence of characters that represent a legal JSON number are converted to that number | ||
- All other values cause an error to be thrown. | ||
@@ -80,4 +87,20 @@ - `$sum(array)` | ||
Casts the argument to a Boolean | ||
Casts the argument to a Boolean using the following rules: | ||
| Argument type|Result| | ||
| -------------|------| | ||
| Boolean| unchanged| | ||
| string: empty| `false`| | ||
| string: non-empty| `true`| | ||
| number: 0 | `false`| | ||
| number: non-zero | `true`| | ||
| null | `false`| | ||
| array: empty| `false`| | ||
| array: contains a member that casts to `true`| `true`| | ||
| array: all members cast to `false`| `false`| | ||
| object: empty | `false`| | ||
| object: non-empty | `true`| | ||
| function | `false`| | ||
- `$not(arg)` | ||
@@ -120,2 +143,7 @@ | ||
Returns an object containing the union of the two `object` parameters. If an entry in the second object | ||
has the same key as an entry in the first, then the value will be overridden by the second. | ||
has the same key as an entry in the first, then the value will be overridden by the second. | ||
#### Higher-order functions | ||
- `$map` | ||
{ | ||
"name": "jsonata", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "JSON query and transformation language", | ||
@@ -21,7 +21,14 @@ "main": "jsonata.js", | ||
"license": "MIT", | ||
"keywords" : ["JSON", "query", "transformation", "transform", "mapping", "path"], | ||
"keywords": [ | ||
"JSON", | ||
"query", | ||
"transformation", | ||
"transform", | ||
"mapping", | ||
"path" | ||
], | ||
"devDependencies": { | ||
"chai": "^3.4.1", | ||
"coveralls": "^2.11.14", | ||
"eslint": "^3.6.0", | ||
"eslint": "^3.7.0", | ||
"eslint-plugin-ideal": "^0.1.3", | ||
@@ -28,0 +35,0 @@ "istanbul": "^0.4.5", |
@@ -5,2 +5,3 @@ # JSONata | ||
[![Coverage Status](https://coveralls.io/repos/github/jsonata-js/jsonata/badge.svg?branch=master)](https://coveralls.io/github/jsonata-js/jsonata?branch=master) | ||
[![Dependency Status](https://david-dm.org/jsonata-js/jsonata.svg)](https://david-dm.org/jsonata-js/jsonata) | ||
@@ -18,3 +19,3 @@ JSON query and transformation language | ||
##Usage | ||
In node.js: | ||
In node.js (works in v4.4 and later): | ||
``` | ||
@@ -27,3 +28,3 @@ var jsonata = require("jsonata"); | ||
In a browser: | ||
In a browser (works in latest Chrome, Firefox, Safari): | ||
``` | ||
@@ -51,3 +52,3 @@ <!DOCTYPE html> | ||
git clone ttps://github.com/jsonata-js/jsonata.git | ||
git clone https://github.com/jsonata-js/jsonata.git | ||
cd jsonata | ||
@@ -54,0 +55,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310925
6892
77