Skip to content

Commit

Permalink
- Breaking change/fix: Disallow resultType from being lower-cased
Browse files Browse the repository at this point in the history
    (broke `parentProperty`); fixes JSONPath-Plus#119
- Docs: Add license badges
- npm: Bump to 4.0.0
brettz9 committed Apr 8, 2020
1 parent c630cd1 commit 6352d88
Showing 14 changed files with 525 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CHANGES for jsonpath-plus

## ?
## 4.0.0 (2020-04-09)

- Breaking change/fix: Disallow `resultType` from being lower-cased
(broke `parentProperty`)
- Breaking change: Expect Node >= 10
- Build: As per latest rollup
- Linting: Check hidden files; update as per latest ash-nazg
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,10 @@
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/s3u/JSONPath.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/s3u/JSONPath/alerts)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/s3u/JSONPath.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/s3u/JSONPath/context:javascript)

[![License](https://img.shields.io/npm/l/intl-dom.svg)](LICENSE-MIT.txt)
<!--[![License](https://img.shields.io/npm/l/JSONPath.svg)](LICENSE-MIT.txt)-->
[![Licenses badge](https://raw.githubusercontent.com/s3u/JSONPath/master/badges/licenses-badge.svg?sanitize=true)](badges/licenses-badge.svg)

<small>(see also [licenses for dev. deps.](https://raw.githubusercontent.com/s3u/JSONPath/master/badges/licenses-badge-dev.svg?sanitize=true))</small>

# JSONPath Plus [![build status](https://secure.travis-ci.org/s3u/JSONPath.png)](http://travis-ci.org/s3u/JSONPath)

1 change: 1 addition & 0 deletions badges/licenses-badge-dev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions badges/licenses-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/index-es.js
Original file line number Diff line number Diff line change
@@ -465,7 +465,7 @@ function JSONPath(opts, expr, obj, callback, otherTypeCallback) {
opts = opts || {};
this.json = opts.json || obj;
this.path = opts.path || expr;
this.resultType = opts.resultType && opts.resultType.toLowerCase() || 'value';
this.resultType = opts.resultType || 'value';
this.flatten = opts.flatten || false;
this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true;
this.sandbox = opts.sandbox || {};
2 changes: 1 addition & 1 deletion dist/index-es.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index-es.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index-umd.js
Original file line number Diff line number Diff line change
@@ -471,7 +471,7 @@
opts = opts || {};
this.json = opts.json || obj;
this.path = opts.path || expr;
this.resultType = opts.resultType && opts.resultType.toLowerCase() || 'value';
this.resultType = opts.resultType || 'value';
this.flatten = opts.flatten || false;
this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true;
this.sandbox = opts.sandbox || {};
2 changes: 1 addition & 1 deletion dist/index-umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index-umd.min.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions licenseInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"bundledRootPackages": [],
"filesByLicense": {}
}
500 changes: 499 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Stefan Goessner",
"name": "jsonpath-plus",
"version": "3.0.0",
"version": "4.0.0",
"main": "dist/index-umd.js",
"module": "dist/index-es.js",
"types": "./src/jsonpath.d.ts",
@@ -74,6 +74,7 @@
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-unicorn": "^18.0.0",
"esm": "^3.2.25",
"license-badger": "^0.13.0",
"mocha": "^7.1.1",
"mocha-badge-generator": "^0.5.2",
"mocha-multi-reporters": "git+https://github.com/brettz9/mocha-multi-reporters.git#missing-reporter",
@@ -115,6 +116,10 @@
]
},
"scripts": {
"prepublishOnly": "npm run license-badges",
"license-badge": "license-badger --corrections --uncategorizedLicenseTemplate \"\\${license} (\\${name} (\\${version}))\" --filteredTypes=nonempty --textTemplate \"License types\n(project, deps, and bundled devDeps)\" --packageJson --production badges/licenses-badge.svg",
"license-badge-dev": "license-badger --corrections --filteredTypes=nonempty --textTemplate \"License types\n(all devDeps)\" --allDevelopment badges/licenses-badge-dev.svg",
"license-badges": "npm run license-badge && npm run license-badge-dev",
"remark": "remark -q -f .",
"typescript": "tsc src/jsonpath.d.ts",
"build-docs": "typedoc --out docs/ts src --includeDeclarations",
3 changes: 1 addition & 2 deletions src/jsonpath.js
Original file line number Diff line number Diff line change
@@ -220,8 +220,7 @@ function JSONPath (opts, expr, obj, callback, otherTypeCallback) {
opts = opts || {};
this.json = opts.json || obj;
this.path = opts.path || expr;
this.resultType = (opts.resultType && opts.resultType.toLowerCase()) ||
'value';
this.resultType = opts.resultType || 'value';
this.flatten = opts.flatten || false;
this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true;
this.sandbox = opts.sandbox || {};

0 comments on commit 6352d88

Please sign in to comment.