summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/strip-json-comments
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/npm/node_modules/strip-json-comments')
-rw-r--r--deps/node/deps/npm/node_modules/strip-json-comments/index.js70
-rw-r--r--deps/node/deps/npm/node_modules/strip-json-comments/license21
-rw-r--r--deps/node/deps/npm/node_modules/strip-json-comments/package.json75
-rw-r--r--deps/node/deps/npm/node_modules/strip-json-comments/readme.md64
4 files changed, 0 insertions, 230 deletions
diff --git a/deps/node/deps/npm/node_modules/strip-json-comments/index.js b/deps/node/deps/npm/node_modules/strip-json-comments/index.js
deleted file mode 100644
index 4e6576e6..00000000
--- a/deps/node/deps/npm/node_modules/strip-json-comments/index.js
+++ /dev/null
@@ -1,70 +0,0 @@
-'use strict';
-var singleComment = 1;
-var multiComment = 2;
-
-function stripWithoutWhitespace() {
- return '';
-}
-
-function stripWithWhitespace(str, start, end) {
- return str.slice(start, end).replace(/\S/g, ' ');
-}
-
-module.exports = function (str, opts) {
- opts = opts || {};
-
- var currentChar;
- var nextChar;
- var insideString = false;
- var insideComment = false;
- var offset = 0;
- var ret = '';
- var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
-
- for (var i = 0; i < str.length; i++) {
- currentChar = str[i];
- nextChar = str[i + 1];
-
- if (!insideComment && currentChar === '"') {
- var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
- if (!escaped) {
- insideString = !insideString;
- }
- }
-
- if (insideString) {
- continue;
- }
-
- if (!insideComment && currentChar + nextChar === '//') {
- ret += str.slice(offset, i);
- offset = i;
- insideComment = singleComment;
- i++;
- } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') {
- i++;
- insideComment = false;
- ret += strip(str, offset, i);
- offset = i;
- continue;
- } else if (insideComment === singleComment && currentChar === '\n') {
- insideComment = false;
- ret += strip(str, offset, i);
- offset = i;
- } else if (!insideComment && currentChar + nextChar === '/*') {
- ret += str.slice(offset, i);
- offset = i;
- insideComment = multiComment;
- i++;
- continue;
- } else if (insideComment === multiComment && currentChar + nextChar === '*/') {
- i++;
- insideComment = false;
- ret += strip(str, offset, i + 1);
- offset = i + 1;
- continue;
- }
- }
-
- return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
-};
diff --git a/deps/node/deps/npm/node_modules/strip-json-comments/license b/deps/node/deps/npm/node_modules/strip-json-comments/license
deleted file mode 100644
index 654d0bfe..00000000
--- a/deps/node/deps/npm/node_modules/strip-json-comments/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-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/deps/node/deps/npm/node_modules/strip-json-comments/package.json b/deps/node/deps/npm/node_modules/strip-json-comments/package.json
deleted file mode 100644
index f9747333..00000000
--- a/deps/node/deps/npm/node_modules/strip-json-comments/package.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "_from": "strip-json-comments@~2.0.1",
- "_id": "strip-json-comments@2.0.1",
- "_inBundle": false,
- "_integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
- "_location": "/strip-json-comments",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "strip-json-comments@~2.0.1",
- "name": "strip-json-comments",
- "escapedName": "strip-json-comments",
- "rawSpec": "~2.0.1",
- "saveSpec": null,
- "fetchSpec": "~2.0.1"
- },
- "_requiredBy": [
- "/eslint",
- "/rc"
- ],
- "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "_shasum": "3c531942e908c2697c0ec344858c286c7ca0a60a",
- "_spec": "strip-json-comments@~2.0.1",
- "_where": "/Users/rebecca/code/npm/node_modules/rc",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "bugs": {
- "url": "https://github.com/sindresorhus/strip-json-comments/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "Strip comments from JSON. Lets you use comments in your JSON files!",
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "files": [
- "index.js"
- ],
- "homepage": "https://github.com/sindresorhus/strip-json-comments#readme",
- "keywords": [
- "json",
- "strip",
- "remove",
- "delete",
- "trim",
- "comments",
- "multiline",
- "parse",
- "config",
- "configuration",
- "conf",
- "settings",
- "util",
- "env",
- "environment"
- ],
- "license": "MIT",
- "name": "strip-json-comments",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sindresorhus/strip-json-comments.git"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "version": "2.0.1"
-}
diff --git a/deps/node/deps/npm/node_modules/strip-json-comments/readme.md b/deps/node/deps/npm/node_modules/strip-json-comments/readme.md
deleted file mode 100644
index 5a344714..00000000
--- a/deps/node/deps/npm/node_modules/strip-json-comments/readme.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments)
-
-> Strip comments from JSON. Lets you use comments in your JSON files!
-
-This is now possible:
-
-```js
-{
- // rainbows
- "unicorn": /* ❤ */ "cake"
-}
-```
-
-It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
-
-Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.
-
-
-## Install
-
-```
-$ npm install --save strip-json-comments
-```
-
-
-## Usage
-
-```js
-const json = '{/*rainbows*/"unicorn":"cake"}';
-
-JSON.parse(stripJsonComments(json));
-//=> {unicorn: 'cake'}
-```
-
-
-## API
-
-### stripJsonComments(input, [options])
-
-#### input
-
-Type: `string`
-
-Accepts a string with JSON and returns a string without comments.
-
-#### options
-
-##### whitespace
-
-Type: `boolean`
-Default: `true`
-
-Replace comments with whitespace instead of stripping them entirely.
-
-
-## Related
-
-- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
-- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)