v1.0 with SW PWA enabled
This commit is contained in:
136
frontend/node_modules/strip-comments/CHANGELOG.md
generated
vendored
Normal file
136
frontend/node_modules/strip-comments/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,136 @@
|
||||
# Release history
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
<details>
|
||||
<summary><strong>Guiding Principles</strong></summary>
|
||||
|
||||
- Changelogs are for humans, not machines.
|
||||
- There should be an entry for every single version.
|
||||
- The same types of changes should be grouped.
|
||||
- Versions and sections should be linkable.
|
||||
- The latest version comes first.
|
||||
- The release date of each versions is displayed.
|
||||
- Mention whether you follow Semantic Versioning.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Types of changes</strong></summary>
|
||||
|
||||
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
|
||||
|
||||
- `Added` for new features.
|
||||
- `Changed` for changes in existing functionality.
|
||||
- `Deprecated` for soon-to-be removed features.
|
||||
- `Removed` for now removed features.
|
||||
- `Fixed` for any bug fixes.
|
||||
- `Security` in case of vulnerabilities.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## [2.0.0] - 2019-09-14
|
||||
|
||||
**Changed**
|
||||
|
||||
- Refactored again to use a custom parser that is much faster and supports a number of different languages.
|
||||
|
||||
## [1.0.2] - 2018-05-03
|
||||
|
||||
- refactored
|
||||
- Remove default objectRestSpread plugin #40 allows for user configured plugins
|
||||
- Merge pull request #42 from tallarium/remove-default-transform
|
||||
- Merge remote-tracking branch 'origin/master' into refactor
|
||||
- Merge remote-tracking branch 'origin/master' into refactor
|
||||
- Merge pull request #44 from jonschlinkert/refactor
|
||||
|
||||
## [1.0.1] - 2018-03-24
|
||||
|
||||
- feat: Allow users to specify their own babylon plugins
|
||||
- Merge pull request #40 from briandipalma/patch-1
|
||||
- adds `allowReturnOutsideFunction` to defaults
|
||||
|
||||
## [1.0.0] - 2018-03-24
|
||||
|
||||
- adds object-rest-spread plugin
|
||||
|
||||
## [0.4.4] - 2016-02-14
|
||||
|
||||
- refactor to use babylon
|
||||
|
||||
## [0.4.3] - 2015-12-25
|
||||
|
||||
- minor tweak
|
||||
|
||||
## [0.4.2] - 2015-12-11
|
||||
|
||||
- bump extract-comments per issue https://github.com/jonschlinkert/strip-comments/issues/29
|
||||
- Merge branch 'master' of https://github.com/lebbe/strip-comments into lebbe-master
|
||||
- Merge branch 'lebbe-master'
|
||||
|
||||
## [0.4.0] - 2015-11-04
|
||||
|
||||
- adds more test cases
|
||||
- closes https://github.com/jonschlinkert/strip-comments/issues/18
|
||||
- Handles comments that are substrings of a later comment
|
||||
- Merge pull request #28 from epicoxymoron/bugfix/27-discard-is-too-greedy
|
||||
- adds example
|
||||
- adds json test
|
||||
|
||||
## [0.3.4] - 2015-10-22
|
||||
|
||||
- refactored
|
||||
- expose `first` method. code comments, minor formatting
|
||||
- allow line/block to be specified as options
|
||||
- Merge pull request #23 from jonschlinkert/dev
|
||||
- fixes examples
|
||||
- adds editorconfig
|
||||
|
||||
## [0.3.0] - 2014-09-02
|
||||
|
||||
- merge fix from origin
|
||||
- Merge pull request #13 from mk-pmb/tests_literals_nocomment
|
||||
- Merge pull request #15 from mk-pmb/tests_literals_snake
|
||||
- Merge pull request #22 from kgryte/patch-1
|
||||
- Merge pull request #9 from tunnckoCore/master
|
||||
- Merge remote-tracking branch 'origin/line-comments'
|
||||
- Merge remote-tracking branch 'origin/master'
|
||||
- tests: not a comment: snake-y ASCII art
|
||||
- tests: string and regexp literals
|
||||
- adds tests for URLs
|
||||
- fix globstars
|
||||
- lint
|
||||
|
||||
## [0.2.0] - 2014-08-10
|
||||
|
||||
- fixes `use strict` statement
|
||||
|
||||
## [0.1.6] - 2014-02-13
|
||||
|
||||
- Merge branch 'master' of https://github.com/tunnckoCore/strip-comments into tunnckoCore-master
|
||||
- Merge branch 'tunnckoCore-master'
|
||||
- minor formatting
|
||||
|
||||
## [0.1.0] - 2014-02-10
|
||||
|
||||
- first commit
|
||||
|
||||
[1.0.2]: https://github.com/jonschlinkert/strip-comments/compare/1.0.1...1.0.2
|
||||
[1.0.1]: https://github.com/jonschlinkert/strip-comments/compare/1.0.0...1.0.1
|
||||
[1.0.0]: https://github.com/jonschlinkert/strip-comments/compare/0.4.4...1.0.0
|
||||
[0.4.4]: https://github.com/jonschlinkert/strip-comments/compare/0.4.3...0.4.4
|
||||
[0.4.3]: https://github.com/jonschlinkert/strip-comments/compare/0.4.2...0.4.3
|
||||
[0.4.2]: https://github.com/jonschlinkert/strip-comments/compare/0.4.0...0.4.2
|
||||
[0.4.0]: https://github.com/jonschlinkert/strip-comments/compare/0.3.4...0.4.0
|
||||
[0.3.4]: https://github.com/jonschlinkert/strip-comments/compare/0.3.0...0.3.4
|
||||
[0.3.0]: https://github.com/jonschlinkert/strip-comments/compare/0.2.0...0.3.0
|
||||
[0.2.0]: https://github.com/jonschlinkert/strip-comments/compare/0.1.6...0.2.0
|
||||
[0.1.6]: https://github.com/jonschlinkert/strip-comments/compare/0.1.0...0.1.6
|
||||
|
||||
[Unreleased]: https://github.com/jonschlinkert/strip-comments/compare/0.1.0...HEAD
|
||||
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
|
||||
|
||||
21
frontend/node_modules/strip-comments/LICENSE
generated
vendored
Normal file
21
frontend/node_modules/strip-comments/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-present, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
237
frontend/node_modules/strip-comments/README.md
generated
vendored
Normal file
237
frontend/node_modules/strip-comments/README.md
generated
vendored
Normal file
@ -0,0 +1,237 @@
|
||||
# strip-comments [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/strip-comments) [](https://npmjs.org/package/strip-comments) [](https://npmjs.org/package/strip-comments) [](https://travis-ci.org/jonschlinkert/strip-comments)
|
||||
|
||||
> Strip line and/or block comments from a string. Blazing fast, and works with JavaScript, Sass, CSS, Less.js, and a number of other languages.
|
||||
|
||||
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
||||
|
||||
- [Install](#install)
|
||||
- [What does this do?](#what-does-this-do)
|
||||
- [Usage](#usage)
|
||||
- [API](#api)
|
||||
- [About](#about)
|
||||
|
||||
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) >=10):
|
||||
|
||||
```sh
|
||||
$ npm install --save strip-comments
|
||||
```
|
||||
|
||||
## What does this do?
|
||||
|
||||
Takes a string and returns a new string with comments removed. Works with line comments and/or block comments. Optionally removes the first comment only or ignores protected comments.
|
||||
|
||||
Works with:
|
||||
|
||||
* ada
|
||||
* apl
|
||||
* applescript
|
||||
* c
|
||||
* csharp
|
||||
* css
|
||||
* hashbang
|
||||
* haskell
|
||||
* html
|
||||
* java
|
||||
* javascript
|
||||
* less
|
||||
* lua
|
||||
* matlab
|
||||
* ocaml
|
||||
* pascal
|
||||
* perl
|
||||
* php
|
||||
* python
|
||||
* ruby
|
||||
* sass
|
||||
* shebang
|
||||
* sql
|
||||
* swift
|
||||
* typscript
|
||||
* xml
|
||||
|
||||
## Usage
|
||||
|
||||
By default all comments are stripped.
|
||||
|
||||
```js
|
||||
const strip = require('strip-comments');
|
||||
const str = strip('const foo = "bar";// this is a comment\n /* me too *\/');
|
||||
console.log(str);
|
||||
// => 'const foo = "bar";\n'
|
||||
```
|
||||
|
||||
For more use-cases see the [tests](./test/test.js)
|
||||
|
||||
## API
|
||||
|
||||
### [strip](index.js#L33)
|
||||
|
||||
Strip all code comments from the given `input`, including protected comments that start with `!`, unless disabled by setting `options.keepProtected` to true.
|
||||
|
||||
**Params**
|
||||
|
||||
* `input` **{String}**: string from which to strip comments
|
||||
* `options` **{Object}**: optional options, passed to [extract-comments](https://github.com/jonschlinkert/extract-comments)
|
||||
|
||||
- `line` **{Boolean}**: if `false` strip only block comments, default `true`
|
||||
- `block` **{Boolean}**: if `false` strip only line comments, default `true`
|
||||
- `keepProtected` **{Boolean}**: Keep ignored comments (e.g. `/*!` and `//!`)
|
||||
- `preserveNewlines` **{Boolean}**: Preserve newlines after comments are stripped
|
||||
* `returns` **{String}**: modified input
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const str = strip('const foo = "bar";// this is a comment\n /* me too */');
|
||||
console.log(str);
|
||||
// => 'const foo = "bar";'
|
||||
```
|
||||
|
||||
### [.block](index.js#L54)
|
||||
|
||||
Strip only block comments.
|
||||
|
||||
**Params**
|
||||
|
||||
* `input` **{String}**: string from which to strip comments
|
||||
* `options` **{Object}**: pass `opts.keepProtected: true` to keep ignored comments (e.g. `/*!`)
|
||||
* `returns` **{String}**: modified string
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const strip = require('..');
|
||||
const str = strip.block('const foo = "bar";// this is a comment\n /* me too */');
|
||||
console.log(str);
|
||||
// => 'const foo = "bar";// this is a comment'
|
||||
```
|
||||
|
||||
### [.line](index.js#L74)
|
||||
|
||||
Strip only line comments.
|
||||
|
||||
**Params**
|
||||
|
||||
* `input` **{String}**: string from which to strip comments
|
||||
* `options` **{Object}**: pass `opts.keepProtected: true` to keep ignored comments (e.g. `//!`)
|
||||
* `returns` **{String}**: modified string
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const str = strip.line('const foo = "bar";// this is a comment\n /* me too */');
|
||||
console.log(str);
|
||||
// => 'const foo = "bar";\n/* me too */'
|
||||
```
|
||||
|
||||
### [.first](index.js#L95)
|
||||
|
||||
Strip the first comment from the given `input`. Or, if `opts.keepProtected` is true, the first non-protected comment will be stripped.
|
||||
|
||||
**Params**
|
||||
|
||||
* `input` **{String}**
|
||||
* `options` **{Object}**: pass `opts.keepProtected: true` to keep comments with `!`
|
||||
* `returns` **{String}**
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const output = strip.first(input, { keepProtected: true });
|
||||
console.log(output);
|
||||
// => '//! first comment\nfoo; '
|
||||
```
|
||||
|
||||
### [.block](index.js#L116)
|
||||
|
||||
Parses a string and returns a basic CST (Concrete Syntax Tree).
|
||||
|
||||
**Params**
|
||||
|
||||
* `input` **{String}**: string from which to strip comments
|
||||
* `options` **{Object}**: pass `opts.keepProtected: true` to keep ignored comments (e.g. `/*!`)
|
||||
* `returns` **{String}**: modified string
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const strip = require('..');
|
||||
const str = strip.block('const foo = "bar";// this is a comment\n /* me too */');
|
||||
console.log(str);
|
||||
// => 'const foo = "bar";// this is a comment'
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
<details>
|
||||
<summary><strong>Contributing</strong></summary>
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Running Tests</strong></summary>
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Building docs</strong></summary>
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Related projects
|
||||
|
||||
You might also be interested in these projects:
|
||||
|
||||
* [code-context](https://www.npmjs.com/package/code-context): Parse a string of javascript to determine the context for functions, variables and comments based… [more](https://github.com/jonschlinkert/code-context) | [homepage](https://github.com/jonschlinkert/code-context "Parse a string of javascript to determine the context for functions, variables and comments based on the code that follows.")
|
||||
* [extract-comments](https://www.npmjs.com/package/extract-comments): Uses esprima to extract line and block comments from a string of JavaScript. Also optionally… [more](https://github.com/jonschlinkert/extract-comments) | [homepage](https://github.com/jonschlinkert/extract-comments "Uses esprima to extract line and block comments from a string of JavaScript. Also optionally parses code context (the next line of code after a comment).")
|
||||
* [parse-code-context](https://www.npmjs.com/package/parse-code-context): Fast and simple way to parse code context for use with documentation from code comments… [more](https://github.com/jonschlinkert/parse-code-context) | [homepage](https://github.com/jonschlinkert/parse-code-context "Fast and simple way to parse code context for use with documentation from code comments. Parses context from a single line of JavaScript, for functions, variable declarations, methods, prototype properties, prototype methods etc.")
|
||||
* [parse-comments](https://www.npmjs.com/package/parse-comments): Parse code comments from JavaScript or any language that uses the same format. | [homepage](https://github.com/jonschlinkert/parse-comments "Parse code comments from JavaScript or any language that uses the same format.")
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 82 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 4 | [tunnckoCore](https://github.com/tunnckoCore) |
|
||||
| 2 | [mk-pmb](https://github.com/mk-pmb) |
|
||||
| 1 | [kgryte](https://github.com/kgryte) |
|
||||
| 1 | [briandipalma](https://github.com/briandipalma) |
|
||||
| 1 | [epicoxymoron](https://github.com/epicoxymoron) |
|
||||
| 1 | [XuluWarrior](https://github.com/XuluWarrior) |
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [GitHub Profile](https://github.com/jonschlinkert)
|
||||
* [Twitter Profile](https://twitter.com/jonschlinkert)
|
||||
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on November 13, 2019._
|
||||
116
frontend/node_modules/strip-comments/index.js
generated
vendored
Normal file
116
frontend/node_modules/strip-comments/index.js
generated
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
/*!
|
||||
* strip-comments <https://github.com/jonschlinkert/strip-comments>
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const compile = require('./lib/compile');
|
||||
const parse = require('./lib/parse');
|
||||
|
||||
/**
|
||||
* Strip all code comments from the given `input`, including protected
|
||||
* comments that start with `!`, unless disabled by setting `options.keepProtected`
|
||||
* to true.
|
||||
*
|
||||
* ```js
|
||||
* const str = strip('const foo = "bar";// this is a comment\n /* me too *\/');
|
||||
* console.log(str);
|
||||
* // => 'const foo = "bar";'
|
||||
* ```
|
||||
* @name strip
|
||||
* @param {String} `input` string from which to strip comments
|
||||
* @param {Object} `options` optional options, passed to [extract-comments][extract-comments]
|
||||
* @option {Boolean} [options] `line` if `false` strip only block comments, default `true`
|
||||
* @option {Boolean} [options] `block` if `false` strip only line comments, default `true`
|
||||
* @option {Boolean} [options] `keepProtected` Keep ignored comments (e.g. `/*!` and `//!`)
|
||||
* @option {Boolean} [options] `preserveNewlines` Preserve newlines after comments are stripped
|
||||
* @return {String} modified input
|
||||
* @api public
|
||||
*/
|
||||
|
||||
const strip = module.exports = (input, options) => {
|
||||
const opts = { ...options, block: true, line: true };
|
||||
return compile(parse(input, opts), opts);
|
||||
};
|
||||
|
||||
/**
|
||||
* Strip only block comments.
|
||||
*
|
||||
* ```js
|
||||
* const strip = require('..');
|
||||
* const str = strip.block('const foo = "bar";// this is a comment\n /* me too *\/');
|
||||
* console.log(str);
|
||||
* // => 'const foo = "bar";// this is a comment'
|
||||
* ```
|
||||
* @name .block
|
||||
* @param {String} `input` string from which to strip comments
|
||||
* @param {Object} `options` pass `opts.keepProtected: true` to keep ignored comments (e.g. `/*!`)
|
||||
* @return {String} modified string
|
||||
* @api public
|
||||
*/
|
||||
|
||||
strip.block = (input, options) => {
|
||||
const opts = { ...options, block: true };
|
||||
return compile(parse(input, opts), opts);
|
||||
};
|
||||
|
||||
/**
|
||||
* Strip only line comments.
|
||||
*
|
||||
* ```js
|
||||
* const str = strip.line('const foo = "bar";// this is a comment\n /* me too *\/');
|
||||
* console.log(str);
|
||||
* // => 'const foo = "bar";\n/* me too *\/'
|
||||
* ```
|
||||
* @name .line
|
||||
* @param {String} `input` string from which to strip comments
|
||||
* @param {Object} `options` pass `opts.keepProtected: true` to keep ignored comments (e.g. `//!`)
|
||||
* @return {String} modified string
|
||||
* @api public
|
||||
*/
|
||||
|
||||
strip.line = (input, options) => {
|
||||
const opts = { ...options, line: true };
|
||||
return compile(parse(input, opts), opts);
|
||||
};
|
||||
|
||||
/**
|
||||
* Strip the first comment from the given `input`. Or, if `opts.keepProtected` is true,
|
||||
* the first non-protected comment will be stripped.
|
||||
*
|
||||
* ```js
|
||||
* const output = strip.first(input, { keepProtected: true });
|
||||
* console.log(output);
|
||||
* // => '//! first comment\nfoo; '
|
||||
* ```
|
||||
* @name .first
|
||||
* @param {String} `input`
|
||||
* @param {Object} `options` pass `opts.keepProtected: true` to keep comments with `!`
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
strip.first = (input, options) => {
|
||||
const opts = { ...options, block: true, line: true, first: true };
|
||||
return compile(parse(input, opts), opts);
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses a string and returns a basic CST (Concrete Syntax Tree).
|
||||
*
|
||||
* ```js
|
||||
* const strip = require('..');
|
||||
* const str = strip.block('const foo = "bar";// this is a comment\n /* me too *\/');
|
||||
* console.log(str);
|
||||
* // => 'const foo = "bar";// this is a comment'
|
||||
* ```
|
||||
* @name .block
|
||||
* @param {String} `input` string from which to strip comments
|
||||
* @param {Object} `options` pass `opts.keepProtected: true` to keep ignored comments (e.g. `/*!`)
|
||||
* @return {String} modified string
|
||||
* @api public
|
||||
*/
|
||||
|
||||
strip.parse = parse;
|
||||
28
frontend/node_modules/strip-comments/lib/Node.js
generated
vendored
Normal file
28
frontend/node_modules/strip-comments/lib/Node.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
class Node {
|
||||
constructor(node) {
|
||||
this.type = node.type;
|
||||
if (node.value) this.value = node.value;
|
||||
if (node.match) this.match = node.match;
|
||||
this.newline = node.newline || '';
|
||||
}
|
||||
get protected() {
|
||||
return Boolean(this.match) && this.match[1] === '!';
|
||||
}
|
||||
}
|
||||
|
||||
class Block extends Node {
|
||||
constructor(node) {
|
||||
super(node);
|
||||
this.nodes = node.nodes || [];
|
||||
}
|
||||
push(node) {
|
||||
this.nodes.push(node);
|
||||
}
|
||||
get protected() {
|
||||
return this.nodes.length > 0 && this.nodes[0].protected === true;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { Node, Block };
|
||||
63
frontend/node_modules/strip-comments/lib/compile.js
generated
vendored
Normal file
63
frontend/node_modules/strip-comments/lib/compile.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
'use strict';
|
||||
|
||||
const compile = (cst, options = {}) => {
|
||||
const keepProtected = options.safe === true || options.keepProtected === true;
|
||||
let firstSeen = false;
|
||||
|
||||
const walk = (node, parent) => {
|
||||
let output = '';
|
||||
let inner;
|
||||
let lines;
|
||||
|
||||
for (const child of node.nodes) {
|
||||
switch (child.type) {
|
||||
case 'block':
|
||||
if (options.first && firstSeen === true) {
|
||||
output += walk(child, node);
|
||||
break;
|
||||
}
|
||||
|
||||
if (options.preserveNewlines === true) {
|
||||
inner = walk(child, node);
|
||||
lines = inner.split('\n');
|
||||
output += '\n'.repeat(lines.length - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (keepProtected === true && child.protected === true) {
|
||||
output += walk(child, node);
|
||||
break;
|
||||
}
|
||||
|
||||
firstSeen = true;
|
||||
break;
|
||||
case 'line':
|
||||
if (options.first && firstSeen === true) {
|
||||
output += child.value;
|
||||
break;
|
||||
}
|
||||
|
||||
if (keepProtected === true && child.protected === true) {
|
||||
output += child.value;
|
||||
}
|
||||
|
||||
firstSeen = true;
|
||||
break;
|
||||
case 'open':
|
||||
case 'close':
|
||||
case 'text':
|
||||
case 'newline':
|
||||
default: {
|
||||
output += child.value || '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
return walk(cst);
|
||||
};
|
||||
|
||||
module.exports = compile;
|
||||
85
frontend/node_modules/strip-comments/lib/languages.js
generated
vendored
Normal file
85
frontend/node_modules/strip-comments/lib/languages.js
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
'use strict';
|
||||
|
||||
exports.ada = { LINE_REGEX: /^--.*/ };
|
||||
exports.apl = { LINE_REGEX: /^⍝.*/ };
|
||||
|
||||
exports.applescript = {
|
||||
BLOCK_OPEN_REGEX: /^\(\*/,
|
||||
BLOCK_CLOSE_REGEX: /^\*\)/
|
||||
};
|
||||
|
||||
exports.csharp = {
|
||||
LINE_REGEX: /^\/\/.*/
|
||||
};
|
||||
|
||||
exports.haskell = {
|
||||
BLOCK_OPEN_REGEX: /^\{-/,
|
||||
BLOCK_CLOSE_REGEX: /^-\}/,
|
||||
LINE_REGEX: /^--.*/
|
||||
};
|
||||
|
||||
exports.html = {
|
||||
BLOCK_OPEN_REGEX: /^\n*<!--(?!-?>)/,
|
||||
BLOCK_CLOSE_REGEX: /^(?<!(?:<!-))-->/,
|
||||
BLOCK_CLOSE_LOOSE_REGEX: /^(?<!(?:<!-))--\s*>/,
|
||||
BLOCK_CLOSE_STRICT_NEWLINE_REGEX: /^(?<!(?:<!-))-->(\s*\n+|\n*)/,
|
||||
BLOCK_CLOSE_STRICT_LOOSE_REGEX: /^(?<!(?:<!-))--\s*>(\s*\n+|\n*)/
|
||||
};
|
||||
|
||||
exports.javascript = {
|
||||
BLOCK_OPEN_REGEX: /^\/\*\*?(!?)/,
|
||||
BLOCK_CLOSE_REGEX: /^\*\/(\n?)/,
|
||||
LINE_REGEX: /^\/\/(!?).*/
|
||||
};
|
||||
|
||||
exports.lua = {
|
||||
BLOCK_OPEN_REGEX: /^--\[\[/,
|
||||
BLOCK_CLOSE_REGEX: /^\]\]/,
|
||||
LINE_REGEX: /^--.*/
|
||||
};
|
||||
|
||||
exports.matlab = {
|
||||
BLOCK_OPEN_REGEX: /^%{/,
|
||||
BLOCK_CLOSE_REGEX: /^%}/,
|
||||
LINE_REGEX: /^%.*/
|
||||
};
|
||||
|
||||
exports.perl = {
|
||||
LINE_REGEX: /^#.*/
|
||||
};
|
||||
|
||||
exports.php = {
|
||||
...exports.javascript,
|
||||
LINE_REGEX: /^(#|\/\/).*?(?=\?>|\n)/
|
||||
};
|
||||
|
||||
exports.python = {
|
||||
BLOCK_OPEN_REGEX: /^"""/,
|
||||
BLOCK_CLOSE_REGEX: /^"""/,
|
||||
LINE_REGEX: /^#.*/
|
||||
};
|
||||
|
||||
exports.ruby = {
|
||||
BLOCK_OPEN_REGEX: /^=begin/,
|
||||
BLOCK_CLOSE_REGEX: /^=end/,
|
||||
LINE_REGEX: /^#.*/
|
||||
};
|
||||
|
||||
exports.shebang = exports.hashbang = {
|
||||
LINE_REGEX: /^#!.*/
|
||||
};
|
||||
|
||||
exports.c = exports.javascript;
|
||||
exports.csharp = exports.javascript;
|
||||
exports.css = exports.javascript;
|
||||
exports.java = exports.javascript;
|
||||
exports.js = exports.javascript;
|
||||
exports.less = exports.javascript;
|
||||
exports.pascal = exports.applescript;
|
||||
exports.ocaml = exports.applescript;
|
||||
exports.sass = exports.javascript;
|
||||
exports.sql = exports.ada;
|
||||
exports.swift = exports.javascript;
|
||||
exports.ts = exports.javascript;
|
||||
exports.typscript = exports.javascript;
|
||||
exports.xml = exports.html;
|
||||
141
frontend/node_modules/strip-comments/lib/parse.js
generated
vendored
Normal file
141
frontend/node_modules/strip-comments/lib/parse.js
generated
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, Block } = require('./Node');
|
||||
const languages = require('./languages');
|
||||
|
||||
const constants = {
|
||||
ESCAPED_CHAR_REGEX: /^\\./,
|
||||
QUOTED_STRING_REGEX: /^(['"`])((?:\\.|[^\1])+?)(\1)/,
|
||||
NEWLINE_REGEX: /^\r*\n/
|
||||
};
|
||||
|
||||
const parse = (input, options = {}) => {
|
||||
if (typeof input !== 'string') {
|
||||
throw new TypeError('Expected input to be a string');
|
||||
}
|
||||
|
||||
const cst = new Block({ type: 'root', nodes: [] });
|
||||
const stack = [cst];
|
||||
const name = (options.language || 'javascript').toLowerCase();
|
||||
const lang = languages[name];
|
||||
|
||||
if (typeof lang === 'undefined') {
|
||||
throw new Error(`Language "${name}" is not supported by strip-comments`);
|
||||
}
|
||||
|
||||
const { LINE_REGEX, BLOCK_OPEN_REGEX, BLOCK_CLOSE_REGEX } = lang;
|
||||
let block = cst;
|
||||
let remaining = input;
|
||||
let token;
|
||||
let prev;
|
||||
|
||||
const source = [BLOCK_OPEN_REGEX, BLOCK_CLOSE_REGEX].filter(Boolean);
|
||||
let tripleQuotes = false;
|
||||
|
||||
if (source.every(regex => regex.source === '^"""')) {
|
||||
tripleQuotes = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helpers
|
||||
*/
|
||||
|
||||
const consume = (value = remaining[0] || '') => {
|
||||
remaining = remaining.slice(value.length);
|
||||
return value;
|
||||
};
|
||||
|
||||
const scan = (regex, type = 'text') => {
|
||||
const match = regex.exec(remaining);
|
||||
if (match) {
|
||||
consume(match[0]);
|
||||
return { type, value: match[0], match };
|
||||
}
|
||||
};
|
||||
|
||||
const push = node => {
|
||||
if (prev && prev.type === 'text' && node.type === 'text') {
|
||||
prev.value += node.value;
|
||||
return;
|
||||
}
|
||||
block.push(node);
|
||||
if (node.nodes) {
|
||||
stack.push(node);
|
||||
block = node;
|
||||
}
|
||||
prev = node;
|
||||
};
|
||||
|
||||
const pop = () => {
|
||||
if (block.type === 'root') {
|
||||
throw new SyntaxError('Unclosed block comment');
|
||||
}
|
||||
stack.pop();
|
||||
block = stack[stack.length - 1];
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse input string
|
||||
*/
|
||||
|
||||
while (remaining !== '') {
|
||||
// escaped characters
|
||||
if ((token = scan(constants.ESCAPED_CHAR_REGEX, 'text'))) {
|
||||
push(new Node(token));
|
||||
continue;
|
||||
}
|
||||
|
||||
// quoted strings
|
||||
if (block.type !== 'block' && (!prev || !/\w$/.test(prev.value)) && !(tripleQuotes && remaining.startsWith('"""'))) {
|
||||
if ((token = scan(constants.QUOTED_STRING_REGEX, 'text'))) {
|
||||
push(new Node(token));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// newlines
|
||||
if ((token = scan(constants.NEWLINE_REGEX, 'newline'))) {
|
||||
push(new Node(token));
|
||||
continue;
|
||||
}
|
||||
|
||||
// block comment open
|
||||
if (BLOCK_OPEN_REGEX && options.block && !(tripleQuotes && block.type === 'block')) {
|
||||
if ((token = scan(BLOCK_OPEN_REGEX, 'open'))) {
|
||||
push(new Block({ type: 'block' }));
|
||||
push(new Node(token));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// block comment close
|
||||
if (BLOCK_CLOSE_REGEX && block.type === 'block' && options.block) {
|
||||
if ((token = scan(BLOCK_CLOSE_REGEX, 'close'))) {
|
||||
token.newline = token.match[1] || '';
|
||||
push(new Node(token));
|
||||
pop();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// line comment
|
||||
if (LINE_REGEX && block.type !== 'block' && options.line) {
|
||||
if ((token = scan(LINE_REGEX, 'line'))) {
|
||||
push(new Node(token));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Plain text (skip "C" since some languages use "C" to start comments)
|
||||
if ((token = scan(/^[a-zABD-Z0-9\t ]+/, 'text'))) {
|
||||
push(new Node(token));
|
||||
continue;
|
||||
}
|
||||
|
||||
push(new Node({ type: 'text', value: consume(remaining[0]) }));
|
||||
}
|
||||
|
||||
return cst;
|
||||
};
|
||||
|
||||
module.exports = parse;
|
||||
102
frontend/node_modules/strip-comments/package.json
generated
vendored
Normal file
102
frontend/node_modules/strip-comments/package.json
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
{
|
||||
"name": "strip-comments",
|
||||
"description": "Strip line and/or block comments from a string. Blazing fast, and works with JavaScript, Sass, CSS, Less.js, and a number of other languages.",
|
||||
"version": "2.0.1",
|
||||
"homepage": "https://github.com/jonschlinkert/strip-comments",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/strip-comments",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/strip-comments/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"cover": "nyc --reporter=text --reporter=html mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^2.0.0",
|
||||
"mocha": "^6.2.2",
|
||||
"nyc": "^14.1.1"
|
||||
},
|
||||
"keywords": [
|
||||
"ada comments",
|
||||
"apl comments",
|
||||
"applescript comments",
|
||||
"block comment",
|
||||
"block",
|
||||
"block-comment",
|
||||
"c comments",
|
||||
"code comment",
|
||||
"comment",
|
||||
"comments",
|
||||
"csharp comments",
|
||||
"css comments",
|
||||
"css",
|
||||
"hashbang comments",
|
||||
"haskell comments",
|
||||
"html comments",
|
||||
"java comments",
|
||||
"javascript comments",
|
||||
"javascript",
|
||||
"js",
|
||||
"less comments",
|
||||
"less css",
|
||||
"less",
|
||||
"less.js",
|
||||
"lessjs",
|
||||
"line comment",
|
||||
"line comments",
|
||||
"line",
|
||||
"line-comment",
|
||||
"line-comments",
|
||||
"lua comments",
|
||||
"matlab comments",
|
||||
"ocaml comments",
|
||||
"pascal comments",
|
||||
"perl comments",
|
||||
"php comments",
|
||||
"python comments",
|
||||
"remove",
|
||||
"ruby comments",
|
||||
"sass comments",
|
||||
"sass",
|
||||
"shebang comments",
|
||||
"sql comments",
|
||||
"strip",
|
||||
"swift comments",
|
||||
"typscript comments",
|
||||
"xml comments"
|
||||
],
|
||||
"verb": {
|
||||
"toc": true,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"helpers": [
|
||||
"./examples/support/helpers.js"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"code-context",
|
||||
"extract-comments",
|
||||
"parse-code-context",
|
||||
"parse-comments"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user