@cloudelements/jmespath
Advanced tools
| name: pull request CI | ||
| on: [pull_request] | ||
| env: | ||
| NODE_VERSION: "14" | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - run: npm install | ||
| - run: npm test |
| name: main-cicd | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - main | ||
| env: | ||
| NODE_VERSION: "14" | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - run: npm install | ||
| - run: npm test |
+1
-1
| { | ||
| "name": "@cloudelements/jmespath", | ||
| "description": "JMESPath implementation in JavaScript", | ||
| "version": "0.17.0", | ||
| "version": "0.18.0", | ||
| "author": { | ||
@@ -6,0 +6,0 @@ "name": "James Saryerwinnie", |
@@ -5,2 +5,4 @@ export var types: Record<string, number>; | ||
| export function over(jsonDoc: any, query: string, fn: (input: any) => any): any; | ||
| export function decorate(fns: Record<string, {_func: Function, _signature: Array<{types: number[]}>}>): | ||
@@ -7,0 +9,0 @@ (query: string) => |
+27
-0
@@ -236,2 +236,29 @@ var assert = require('assert'); | ||
| describe('over', function() { | ||
| it('should mutate objects', function() { | ||
| assert.deepStrictEqual( | ||
| jmespath.over({a: 1, b: 2}, 'a', (a) => a.toString()), | ||
| {a: '1', b: 2} | ||
| ); | ||
| assert.deepStrictEqual( | ||
| jmespath.over({a: {b: {c: {d: 1}}}, e: 2}, 'a.b.c.d', (a) => a.toString()), | ||
| {a: {b: {c: {d: '1'}}}, e: 2} | ||
| ); | ||
| }); | ||
| it('should mutate arrays', function() { | ||
| assert.deepStrictEqual( | ||
| jmespath.over({a: [1, 2, 3]}, 'a | [0]', (a) => a.toString()), | ||
| {a: ['1', 2, 3]} | ||
| ); | ||
| }); | ||
| it('should mutate slices', function() { | ||
| assert.deepStrictEqual( | ||
| jmespath.over({a: [1, 2, 3]}, 'a[0:3]', (a) => a.toString()), | ||
| {a: ['1', '2', '3']} | ||
| ); | ||
| }); | ||
| }); | ||
| describe('decorate', function() { | ||
@@ -238,0 +265,0 @@ it( |
| version: 2.1 | ||
| jobs: | ||
| install: | ||
| docker: | ||
| - image: circleci/node:12 | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| keys: | ||
| - npm-{{ .Branch }}-{{ checksum "package.json" }} | ||
| - npm-{{ .Branch }}- | ||
| - npm-master- | ||
| - run: npm install | ||
| - save_cache: | ||
| key: npm-{{ .Branch }}-{{ checksum "package.json" }} | ||
| paths: | ||
| - node_modules | ||
| test: | ||
| docker: | ||
| - image: circleci/node:12 | ||
| parallelism: 1 | ||
| steps: | ||
| - checkout | ||
| - restore_cache: | ||
| keys: | ||
| - npm-{{ .Branch }}-{{ checksum "package.json" }} | ||
| - run: npm run test | ||
| workflows: | ||
| version: 2 | ||
| test: | ||
| jobs: | ||
| - install | ||
| - test: | ||
| requires: | ||
| - install |
Sorry, the diff of this file is too big to display
209902
5.64%32
3.23%7729
4.16%