diff options
| author | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
| commit | f9159ea2d994e14180fb02ab562f0119513e67cf (patch) | |
| tree | 09d14cdf05456567156738b681379d4bccd64e5c /node_modules/json-parse-helpfulerror | |
| parent | 2020/04/03, 02:42, V1.2.1 (diff) | |
| download | s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.tar.xz s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.zip | |
2020/04/03, 02:47, V1.2.2
Diffstat (limited to 'node_modules/json-parse-helpfulerror')
| -rw-r--r-- | node_modules/json-parse-helpfulerror/.editorconfig | 14 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/.editorconfig~ | 14 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/.npmignore | 28 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/LICENSE | 22 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/README.md | 29 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/index.js | 21 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/index.js~ | 20 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/package.json | 63 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/test/test.js | 32 | ||||
| -rw-r--r-- | node_modules/json-parse-helpfulerror/test/test.js~ | 11 |
10 files changed, 0 insertions, 254 deletions
diff --git a/node_modules/json-parse-helpfulerror/.editorconfig b/node_modules/json-parse-helpfulerror/.editorconfig deleted file mode 100644 index fb7f73a..0000000 --- a/node_modules/json-parse-helpfulerror/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.js, **/*.js] -indent_size = 4 -indent_style = space - -[{package.json,.travis.yml}] -indent_size = 2 -indent_style = space diff --git a/node_modules/json-parse-helpfulerror/.editorconfig~ b/node_modules/json-parse-helpfulerror/.editorconfig~ deleted file mode 100644 index fb7f73a..0000000 --- a/node_modules/json-parse-helpfulerror/.editorconfig~ +++ /dev/null @@ -1,14 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.js, **/*.js] -indent_size = 4 -indent_style = space - -[{package.json,.travis.yml}] -indent_size = 2 -indent_style = space diff --git a/node_modules/json-parse-helpfulerror/.npmignore b/node_modules/json-parse-helpfulerror/.npmignore deleted file mode 100644 index 59d842b..0000000 --- a/node_modules/json-parse-helpfulerror/.npmignore +++ /dev/null @@ -1,28 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript diff --git a/node_modules/json-parse-helpfulerror/LICENSE b/node_modules/json-parse-helpfulerror/LICENSE deleted file mode 100644 index e637724..0000000 --- a/node_modules/json-parse-helpfulerror/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Sam Mikes - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/json-parse-helpfulerror/README.md b/node_modules/json-parse-helpfulerror/README.md deleted file mode 100644 index ffad935..0000000 --- a/node_modules/json-parse-helpfulerror/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# json-parse-helpfulerror - -A drop-in replacement for `JSON.parse` that uses -<https://npmjs.org/jju> to provide more useful error messages in the -event of a parse error. - -# Example - -## Installation - -``` -npm i -S json-parse-helpfulerror -``` - -## Use - -```js -var jph = require('json-parse-helpfulerror'); - -var notJSON = "{'foo': 3}"; // keys must be double-quoted in JSON - -JSON.parse(notJSON); // throws unhelpful error - -jph.parse("{'foo': 3}") // throws more helpful error: "Unexpected token '\''..." -``` - -# License - -MIT
\ No newline at end of file diff --git a/node_modules/json-parse-helpfulerror/index.js b/node_modules/json-parse-helpfulerror/index.js deleted file mode 100644 index 15648b0..0000000 --- a/node_modules/json-parse-helpfulerror/index.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var jju = require('jju'); - -function parse(text, reviver) { - try { - return JSON.parse(text, reviver); - } catch (err) { - // we expect this to throw with a more informative message - jju.parse(text, { - mode: 'json', - reviver: reviver - }); - - // backup if jju is not as strict as JSON.parse; re-throw error - // data-dependent code path, I do not know how to cover it - throw err; - } -} - -exports.parse = parse; diff --git a/node_modules/json-parse-helpfulerror/index.js~ b/node_modules/json-parse-helpfulerror/index.js~ deleted file mode 100644 index 6e11c92..0000000 --- a/node_modules/json-parse-helpfulerror/index.js~ +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var jju = require('jju'); - -function parse(text, reviver) { - try { - return JSON.parse(text, reviver); - } catch(err) { - // we expect this throw with a more informative message - jju.parse(text, { - mode: 'json', - reviver: reviver - }); - - // if it didn't throw, re-throw the original error - throw err; - } -} - -module.exports = parse; diff --git a/node_modules/json-parse-helpfulerror/package.json b/node_modules/json-parse-helpfulerror/package.json deleted file mode 100644 index d140abe..0000000 --- a/node_modules/json-parse-helpfulerror/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "json-parse-helpfulerror@^1.0.3", - "_id": "[email protected]", - "_inBundle": false, - "_integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", - "_location": "/json-parse-helpfulerror", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "json-parse-helpfulerror@^1.0.3", - "name": "json-parse-helpfulerror", - "escapedName": "json-parse-helpfulerror", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/lowdb" - ], - "_resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", - "_shasum": "13f14ce02eed4e981297b64eb9e3b932e2dd13dc", - "_spec": "json-parse-helpfulerror@^1.0.3", - "_where": "E:\\Documents\\GitHub\\s5nical\\node_modules\\lowdb", - "author": { - "name": "Sam Mikes", - "email": "[email protected]" - }, - "bugs": { - "url": "https://github.com/smikes/json-parse-helpfulerror/issues" - }, - "bundleDependencies": false, - "dependencies": { - "jju": "^1.1.0" - }, - "deprecated": false, - "description": "A drop-in replacement for JSON.parse that uses `jju` to give helpful errors", - "devDependencies": { - "code": "^1.2.1", - "jslint": "^0.7.1", - "lab": "^5.1.1" - }, - "homepage": "https://github.com/smikes/json-parse-helpfulerror", - "keywords": [ - "json", - "parse", - "line", - "doublequote", - "error" - ], - "license": "MIT", - "main": "index.js", - "name": "json-parse-helpfulerror", - "repository": { - "type": "git", - "url": "git+https://github.com/smikes/json-parse-helpfulerror.git" - }, - "scripts": { - "lint": "jslint --edition=latest --terse *.js", - "test": "lab -c" - }, - "version": "1.0.3" -} diff --git a/node_modules/json-parse-helpfulerror/test/test.js b/node_modules/json-parse-helpfulerror/test/test.js deleted file mode 100644 index fca458a..0000000 --- a/node_modules/json-parse-helpfulerror/test/test.js +++ /dev/null @@ -1,32 +0,0 @@ -var Code = require('code'), - Lab = require('lab'), - lab = Lab.script(), - jph = require('..'); // 'json-parse-helpfulerror' - -exports.lab = lab; - -lab.test('can parse', function (done) { - var o = jph.parse('{"foo": "bar"}'); - - Code.expect(o.foo).to.equal('bar'); - done(); -}); - -lab.test('helpful error for bad JSON', function (done) { - - var bad = "{'foo': 'bar'}"; - - Code.expect(function () { JSON.parse(bad) }).to.throw(); - - Code.expect(function () { jph.parse(bad) }).to.throw(SyntaxError, "Unexpected token '\\'' at 1:2\n" + bad + '\n ^'); - - done(); -}); - -lab.test('fails if reviver throws', function (done) { - function badReviver() { throw new ReferenceError('silly'); } - - Code.expect(function () { jph.parse('3', badReviver) }).to.throw(ReferenceError, 'silly'); - - done(); -});
\ No newline at end of file diff --git a/node_modules/json-parse-helpfulerror/test/test.js~ b/node_modules/json-parse-helpfulerror/test/test.js~ deleted file mode 100644 index 5a11546..0000000 --- a/node_modules/json-parse-helpfulerror/test/test.js~ +++ /dev/null @@ -1,11 +0,0 @@ -var Code = require('code'), - Lab = require('lab'), - lab = lab.script; - -exports.lab = lab; - -lab.test('tests run and work', function (done) { - Code.expect(1+1).to.equal(2); - - done(); -}); |