Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "jsonata", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "JSON query and transformation language", | ||
@@ -5,0 +5,0 @@ "module": "jsonata.js", |
@@ -22,13 +22,16 @@ # JSONata | ||
```javascript | ||
var jsonata = require("jsonata"); | ||
const jsonata = require('jsonata'); | ||
var data = { | ||
example: [ | ||
{value: 4}, | ||
{value: 7}, | ||
{value: 13} | ||
] | ||
const data = { | ||
example: [ | ||
{value: 4}, | ||
{value: 7}, | ||
{value: 13} | ||
] | ||
}; | ||
var expression = jsonata("$sum(example.value)"); | ||
var result = expression.evaluate(data); // returns 24 | ||
(async () => { | ||
const expression = jsonata('$sum(example.value)'); | ||
const result = await expression.evaluate(data); // returns 24 | ||
})() | ||
``` | ||
@@ -46,5 +49,5 @@ | ||
<script> | ||
function greeting() { | ||
async function greeting() { | ||
var json = JSON.parse(document.getElementById('json').value); | ||
var result = jsonata('"Hello, " & name').evaluate(json); | ||
var result = await jsonata('"Hello, " & name').evaluate(json); | ||
document.getElementById('greeting').innerHTML = result; | ||
@@ -51,0 +54,0 @@ } |
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
71
864071
16637