diff options
Diffstat (limited to 'deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju')
5 files changed, 105 insertions, 49 deletions
diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE new file mode 100644 index 0000000000..5c93f45654 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js index 2b78949378..025007f63b 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -75,9 +75,22 @@ function formatError(input, msg, position, lineno, column, json5) { function parse(input, options) { // parse as a standard JSON mode - var json5 = !(options.mode === 'json' || options.legacy) + var json5 = false; + var cjson = false; + + if (options.legacy || options.mode === 'json') { + // use json + } else if (options.mode === 'cjson') { + cjson = true; + } else if (options.mode === 'json5') { + json5 = true; + } else { + // use it by default + json5 = true; + } + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON - var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON + var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON var length = input.length , lineno = 0 @@ -257,7 +270,7 @@ function parse(input, options) { // nothing } else if (chr === '/' - && json5 + && (json5 || cjson) && (input[position] === '/' || input[position] === '*') ) { position-- diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js index 754019eac5..e76af2efe8 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -38,7 +38,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty var escapable = /[\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/ function _stringify(object, options, recursiveLvl, currentKey) { - var opt_json = options.mode === 'json' + var json5 = (options.mode === 'json5' || !options.mode) /* * Opinionated decision warning: * @@ -114,18 +114,18 @@ function _stringify(object, options, recursiveLvl, currentKey) { var chr = key.charCodeAt(i) if (chr < 0x10) { - if (chr === 0 && !opt_json) { + if (chr === 0 && json5) { result += '\\0' - } else if (chr >= 8 && chr <= 13 && (!opt_json || chr !== 11)) { + } else if (chr >= 8 && chr <= 13 && (json5 || chr !== 11)) { result += special_chars[chr] - } else if (!opt_json) { + } else if (json5) { result += '\\x0' + chr.toString(16) } else { result += '\\u000' + chr.toString(16) } } else if (chr < 0x20) { - if (!opt_json) { + if (json5) { result += '\\x' + chr.toString(16) } else { result += '\\u00' + chr.toString(16) @@ -149,7 +149,7 @@ function _stringify(object, options, recursiveLvl, currentKey) { } else if (options.ascii || Uni.isLineTerminator(key[i]) || escapable.exec(key[i])) { if (chr < 0x100) { - if (!opt_json) { + if (json5) { result += '\\x' + chr.toString(16) } else { result += '\\u00' + chr.toString(16) @@ -256,7 +256,7 @@ function _stringify(object, options, recursiveLvl, currentKey) { // information needlessly? return '-0' } - if (options.mode === 'json' && !Number.isFinite(object)) { + if (!json5 && !Number.isFinite(object)) { // json don't support infinity (= sucks) return 'null' } @@ -343,9 +343,9 @@ module.exports.stringify = function stringifyJSON(object, options, _space) { if (options.indent == null) options.indent = '\t' if (options.quote == null) options.quote = "'" if (options.ascii == null) options.ascii = false - if (options.mode == null) options.mode = 'simple' + if (options.mode == null) options.mode = 'json5' - if (options.mode === 'json') { + if (options.mode === 'json' || options.mode === 'cjson') { // json only supports double quotes (= sucks) options.quote = '"' diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json index f1b467a6eb..5d28ae1d83 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json @@ -1,28 +1,63 @@ { - "name": "jju", - "version": "1.2.1", - "description": "a set of utilities to work with JSON / JSON5 documents", - "author": { - "name": "Alex Kocharin", - "email": "alex@kocharin.ru" + "_args": [ + [ + "jju@^1.1.0", + "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror" + ] + ], + "_from": "jju@>=1.1.0 <2.0.0", + "_id": "jju@1.3.0", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/json-parse-helpfulerror/jju", + "_nodeVersion": "2.2.1", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/jju-1.3.0.tgz_1455989902144_0.8787874563131481" }, - "repository": { - "type": "git", - "url": "git://github.com/rlidwka/jju.git" + "_npmUser": { + "email": "alex@kocharin.ru", + "name": "rlidwka" + }, + "_npmVersion": "2.0.1", + "_phantomChildren": {}, + "_requested": { + "name": "jju", + "raw": "jju@^1.1.0", + "rawSpec": "^1.1.0", + "scope": null, + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/read-package-json/json-parse-helpfulerror" + ], + "_resolved": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz", + "_shasum": "dadd9ef01924bc728b03f2f7979bdbd62f7a2aaa", + "_shrinkwrap": null, + "_spec": "jju@^1.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror", + "author": { + "email": "alex@kocharin.ru", + "name": "Alex Kocharin" }, "bugs": { "url": "https://github.com/rlidwka/jju/issues" }, - "homepage": "http://rlidwka.github.io/jju/", + "dependencies": {}, + "description": "a set of utilities to work with JSON / JSON5 documents", "devDependencies": { - "mocha": ">=1.21.0", + "eslint": "~0.4.2", "js-yaml": ">=3.1.0", - "eslint": "~0.4.2" + "mocha": ">=1.21.0" }, - "scripts": { - "test": "mocha test/*.js", - "lint": "eslint -c ./.eslint.yaml ./lib" + "directories": {}, + "dist": { + "shasum": "dadd9ef01924bc728b03f2f7979bdbd62f7a2aaa", + "tarball": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz" }, + "gitHead": "6a1248fc29abb3f418fa143e31ee548cd5a2477c", + "homepage": "http://rlidwka.github.io/jju/", "keywords": [ "json", "json5", @@ -30,34 +65,29 @@ "serializer", "data" ], - "publishConfig": { - "registry": "https://registry.npmjs.org/" - }, "license": { "type": "WTFPL", "url": "http://www.wtfpl.net/txt/copying/" }, - "gitHead": "8b079c1d03af527ab28a47c7b714d6f888abc53d", - "_id": "jju@1.2.1", - "_shasum": "edf6ec20d5d668c80c2c00cea63f8a9422a4b528", - "_from": "jju@>=1.1.0 <2.0.0", - "_npmVersion": "2.0.1", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "rlidwka", - "email": "alex@kocharin.ru" - }, "maintainers": [ { - "name": "rlidwka", - "email": "alex@kocharin.ru" + "email": "alex@kocharin.ru", + "name": "rlidwka" } ], - "dist": { - "shasum": "edf6ec20d5d668c80c2c00cea63f8a9422a4b528", - "tarball": "http://registry.npmjs.org/jju/-/jju-1.2.1.tgz" + "name": "jju", + "optionalDependencies": {}, + "publishConfig": { + "registry": "https://registry.npmjs.org/" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/jju/-/jju-1.2.1.tgz", - "readme": "ERROR: No README data found!" + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/rlidwka/jju.git" + }, + "scripts": { + "lint": "eslint -c ./.eslint.yaml ./lib", + "test": "mocha test/*.js" + }, + "version": "1.3.0" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml index 4d81c219f1..828163ddc4 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -3,7 +3,7 @@ # "jju" stands for "json/json5 utils" name: jju -version: 1.2.1 +version: 1.3.0 description: a set of utilities to work with JSON / JSON5 documents author: |