mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
21
web/node_modules/resolve-url-loader/LICENCE
generated
vendored
Normal file
21
web/node_modules/resolve-url-loader/LICENCE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Ben Holloway
|
||||
|
||||
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.
|
251
web/node_modules/resolve-url-loader/README.md
generated
vendored
Normal file
251
web/node_modules/resolve-url-loader/README.md
generated
vendored
Normal file
|
@ -0,0 +1,251 @@
|
|||
> **I M P O R T A N T**
|
||||
>
|
||||
> Version 4 release is imminent. Please try it. More info on the [homepage](https://github.com/bholloway/resolve-url-loader).
|
||||
>
|
||||
> Version 3 is now in maintenance mode.
|
||||
|
||||
# Resolve URL Loader
|
||||
|
||||
[](https://www.npmjs.com/package/resolve-url-loader)
|
||||
|
||||
A **webpack loader** that rewrites relative paths in url() statements based on the original source file.
|
||||
|
||||
## Why?
|
||||
|
||||
> **TL;DR** Making Sass work with a feature based project structure
|
||||
|
||||
With webpack you can import a `.scss` file (or some other compile-to-css file) and have a loader take care of the transpilation. With **Sass** (at least) this file can include a whole tree of source files into a single output.
|
||||
|
||||
We can imagine a virtual `.css` file at the location the original `.scss` import. Webpack expects any **assets** found in this CSS to be relative to the original imported file.
|
||||
|
||||
For projects with a **feature based structure** this will be a problem, since you will want to **co-locate** your assets with your `.scss` partials.
|
||||
|
||||
**Example** - webpack imports `index.scss` which includes feature `foo`.
|
||||
|
||||
| files | content |
|
||||
|------------------------------------|------------------------|
|
||||
|src / | |
|
||||
| index.scss | `@import features/foo` |
|
||||
| features / | |
|
||||
| _foo.scss | `url(bar.png)` |
|
||||
| bar.png | |
|
||||
|
||||
Intuatively we want the assets in partial `_foo.scss` relative to the partial, meaning `url(bar.png)`.
|
||||
|
||||
However webpack's `css-loader` will encounter `url(bar.png)` and expect to find `src/bar.png`. This is **not** the correct location and the build will fail.
|
||||
|
||||
Thankfully `resolve-url-loader` provides the "url rewriting" that Sass is missing. Use it _after_ the transpiler (such as [sass-loader](https://www.npmjs.com/package/sass-loader)). It makes use of the [source-map](http://www.mattzeunert.com/2016/02/14/how-do-source-maps-work.html) to find the original source file and rewrite `url()` statements.
|
||||
|
||||
In our example it rewrites `url(bar.png)` to `url(features/bar.png)` as required.
|
||||
|
||||
## Version 3
|
||||
|
||||
**Features**
|
||||
|
||||
* Use `postcss` parser by default. This is long overdue as the old `rework` parser doesn't cope with modern css.
|
||||
|
||||
* Lots of automated tests running actual webpack builds. If you have an interesting use-case let me know.
|
||||
|
||||
**Breaking Changes**
|
||||
* Multiple options changed or deprecated.
|
||||
* Removed file search "magic" in favour of `join` option.
|
||||
* Errors always fail and are no longer swallowed.
|
||||
* Processing absolute asset paths requires `root` option to be set.
|
||||
|
||||
**Migrating**
|
||||
|
||||
Initially set option `engine: 'rework'` for parity with your existing build. Once working you can remove this option **or** set `engine: 'postcss'` explicitly.
|
||||
|
||||
Retain `keepQuery` option if you are already using it.
|
||||
|
||||
The `root` option now has a different meaning. Previously it limited file search. Now it is the base path for absolute or root-relative URIs, consistent with `css-loader`. If you are already using it you can probably remove it.
|
||||
|
||||
If you build on Windows platform **and** your content contains absolute asset paths, then `css-loader` could fail. The `root` option here may fix the URIs before they get to `css-loader`. Try to leave it unspecified, otherwise (windows only) set to empty string `root: ''`.
|
||||
|
||||
## Getting started
|
||||
|
||||
### Install
|
||||
|
||||
via npm
|
||||
|
||||
```bash
|
||||
npm install resolve-url-loader --save-dev
|
||||
```
|
||||
|
||||
via yarn
|
||||
|
||||
```bash
|
||||
yarn add resolve-url-loader --dev
|
||||
```
|
||||
|
||||
### Configure Webpack
|
||||
|
||||
The typical use case is `resolve-url-loader` between `sass-loader` and `css-loader`.
|
||||
|
||||
**:warning: IMPORTANT**
|
||||
* **source-maps required** for loaders preceding `resolve-url-loader` (regardless of `devtool`).
|
||||
* Always use **full loader package name** (don't omit `-loader`) otherwise you can get errors that are hard to debug.
|
||||
|
||||
|
||||
``` javascript
|
||||
rules: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
...
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {...}
|
||||
}, {
|
||||
loader: 'resolve-url-loader',
|
||||
options: {...}
|
||||
}, {
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
sourceMapContents: false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
Refer to `test` directory for full webpack configurations (as used in automated tests).
|
||||
|
||||
## Options
|
||||
|
||||
| option | type | default | | description |
|
||||
|-------------|----------------------------|-------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `engine` | `'rework'`<br/>`'postcss'` | `'postcss'` | | The css parser engine. |
|
||||
| `sourceMap` | boolean | `false` | | Generate a source-map. |
|
||||
| `keepQuery` | boolean | `false` | | Keep query-string and/or hash suffixes.<br/>e.g. `url('./MyFont.eot?#iefix')`<br/>Be aware downstream loaders may remove query-string or hash. |
|
||||
| `removeCR` | boolean | `false` | | Convert orphan CR to whitespace (postcss only).<br/>See known issues below. |
|
||||
| `debug` | boolean | `false` | | Display debug information. |
|
||||
| `silent` | boolean | `false` | | Do **not** display warnings. |
|
||||
| `root` | string | _unset_ | | Similar to the (now defunct) option in `css-loader`.<br/>This string, possibly empty, is prepended to absolute URIs.<br/>Absolute URIs are only processed if this option is set. |
|
||||
| `join` | function | _inbuilt_ | advanced | Custom join function.<br/>Use custom javascript to fix asset paths on a per-case basis.<br/>Refer to the default implementation for more information. |
|
||||
| `absolute` | boolean | `false` | useless | Forces URIs to be output as absolute file paths.<br/>This is retained for historical compatibility but is likely to be removed in the future, so let me know if you use it. |
|
||||
|
||||
## How it works
|
||||
|
||||
A [rework](https://github.com/reworkcss/rework) or [postcss](https://postcss.org/) process is run on incoming CSS.
|
||||
|
||||
Each `url()` statement may imply an asset or may not. Generally only relative URIs are considered. However if `root` is specified then absolute or root-relative URIs are considered.
|
||||
|
||||
For each URI considered, the incomming source-map is consulted to determine the original file where the `url()` was specified. This becomes the `base` argument to the `join` function, whose default implementation is something like the following pseudocode.
|
||||
|
||||
```javascript
|
||||
join(uri, base?) =>
|
||||
compose(path.normalize, path.join)(base || options.join, uri);
|
||||
```
|
||||
|
||||
Note that for absolute `uri` then the `base` is absent. In the default implementation the `root` option is used instead.
|
||||
|
||||
Full file search has been discontinued in version 3, however it is possible to specify a custom `join` function.
|
||||
|
||||
There is the added complexity that `base` may be an iterator. However `resolve-url-loader` exports some useful functions that makes a custom `join` easier.
|
||||
|
||||
Following `join` the URI has become an absolute path. Back-slashes are then converted to forward-slashes and the path is made relative to the initial resource being considered.
|
||||
|
||||
Use the `debug` option to see verbose information from the `join` function.
|
||||
|
||||
## Limitations / Known-issues
|
||||
|
||||
### Mixins
|
||||
|
||||
Where `url()` statements are created in a mixin the source file may then be the mixin file, and not the file calling the mixin. Obviously this is **not** the desired behaviour.
|
||||
|
||||
Ensure this is indeed the problem as there are many ways to misconfigure webpack. Try inlining the mixin and check that everything works correctly. However ultimately you will need to work around this.
|
||||
|
||||
### Compatiblity
|
||||
|
||||
Tested `macOS` and `Windows` for `node 6.x`.
|
||||
|
||||
All `webpack1`-`webpack4` with contemporaneous loaders/plugins.
|
||||
|
||||
Refer to `test` directory for full webpack configurations (as used in automated tests).
|
||||
|
||||
Some edge cases with `libsass` on `Windows` (see below).
|
||||
|
||||
### Engines
|
||||
|
||||
The `engine:postcss` is by far the more reliable option.
|
||||
|
||||
The `engine:rework` option is retained for historical compatibility but is likely to be removed in the future, so let me know if you use it.
|
||||
|
||||
If you need production css source-map it is best to avoid the combination `webpack4` with `engine:rework`. Tests show a systematic flaw in the outgoing source-map mappings.
|
||||
|
||||
### Absolute URIs
|
||||
|
||||
By "absolute URIs" we more correctly mean assets with root-relative URLs or absolute file paths.
|
||||
|
||||
> Absolute paths are **not** processed by default
|
||||
|
||||
These are **not** processed unless a `root` is specified.
|
||||
|
||||
However recall that any paths that _are_ processed will have windows back-slash converted to posix forward-slash. This can be useful since some webpack loaders can choke on windows paths. By using `root: ''` then `resolve-url-loader` effectively does nothing to absolute paths except change the back-slash.
|
||||
|
||||
It can also be useful to process absolute URIs if you have a custom `join` function and want to process all paths. However this is perhaps better done with some separate `postcss` plugin.
|
||||
|
||||
### Windows line breaks
|
||||
|
||||
Normal windows linebreaks are `CRLF`. But sometimes libsass will output single `CR` characters.
|
||||
|
||||
This problem is specific to multiline declarations. Refer to the [libsass bug #2693](https://github.com/sass/libsass/issues/2693).
|
||||
|
||||
If you have _any_ such multiline declarations preceding `url()` statements it will fail your build.
|
||||
|
||||
Libsass doesn't consider these orphan `CR` to be newlines but `postcss` engine does. The result being an offset in source-map line-numbers which crashes `resolve-url-loader`.
|
||||
|
||||
```
|
||||
Module build failed: Error: resolve-url-loader: CSS error
|
||||
source-map information is not available at url() declaration
|
||||
```
|
||||
|
||||
Some users find the node-sass `linefeed` option solves the problem.
|
||||
|
||||
**Solutions**
|
||||
* Try the node-sass [linefeed](https://github.com/sass/node-sass#linefeed--v300) option by way of `sass-loader`.
|
||||
|
||||
**Work arounds**
|
||||
* Enable `removeCR` option [here](#option).
|
||||
* Remove linebreaks in declarations.
|
||||
|
||||
**Diagnosis**
|
||||
1. Run a stand-alone sass build `npx node-sass index.scss output.css`
|
||||
2. Use a hex editor to check line endings `Format-Hex output.css`
|
||||
3. Expect `0DOA` (or desired) line endings. Single `0D` confirms this problem.
|
||||
|
||||
## Getting help
|
||||
|
||||
Webpack is difficult to configure but extremely rewarding.
|
||||
|
||||
> Remove this loader and make sure it is not a problem with a different loader in your config (most often the case)
|
||||
|
||||
I am happy for you to **raise an issue** to ask a question regarding this package. However ensure you follow the check-list first.
|
||||
|
||||
Currently I am **not** [dogfooding](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) this loader in my own work. I may rely on you being able to isolate the problem in a simple example project and to help debug.
|
||||
|
||||
I am happy this loader helps so many people. Open-source is provided as-is so please try not project your frustrations. There are some really great people who follow this project who can help.
|
||||
|
||||
### Issues
|
||||
|
||||
Before raising a new issue:
|
||||
|
||||
* Remove this loader and make sure it is not a problem with a different loader in your config (most often the case).
|
||||
* Check [stack overflow](http://stackoverflow.com/search?q=resolve-url-loader) for an answer.
|
||||
* Review [previous issues](/issues?utf8=%E2%9C%93&q=is%3Aissue) that may be similar.
|
||||
* Be prepared to create a **simple open-source project** that exhibits your problem, should the solution not be immediately obvious to us.
|
||||
* (ideally) Debug some code and let me know where the problem sits.
|
||||
|
||||
### Pull requests
|
||||
|
||||
I am happy to take **pull requests**, however:
|
||||
|
||||
* Ensure your change is **backwards compatible** - not all users will be using the same version of Webpack or SASS that you do.
|
||||
* Follow the **existing code style**. I know it is old but it maintains backwards compatibility.
|
||||
* Uncomon use-cases/fixes should be opt-in per a new **option**.
|
||||
* Do **not** overwrite existing variables with new values. I would prefer your change variable names elsewhere if necessary.
|
||||
* Add **comments** that describe why the code is necessary - i.e. what edge case are we solving. Otherwise we may rewrite later and break your use-case.
|
236
web/node_modules/resolve-url-loader/index.js
generated
vendored
Normal file
236
web/node_modules/resolve-url-loader/index.js
generated
vendored
Normal file
|
@ -0,0 +1,236 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var path = require('path'),
|
||||
fs = require('fs'),
|
||||
loaderUtils = require('loader-utils'),
|
||||
camelcase = require('camelcase'),
|
||||
SourceMapConsumer = require('source-map').SourceMapConsumer;
|
||||
|
||||
var adjustSourceMap = require('adjust-sourcemap-loader/lib/process');
|
||||
|
||||
var valueProcessor = require('./lib/value-processor');
|
||||
var joinFn = require('./lib/join-function');
|
||||
var logToTestHarness = require('./lib/log-to-test-harness');
|
||||
|
||||
var PACKAGE_NAME = require('./package.json').name;
|
||||
|
||||
/**
|
||||
* A webpack loader that resolves absolute url() paths relative to their original source file.
|
||||
* Requires source-maps to do any meaningful work.
|
||||
* @param {string} content Css content
|
||||
* @param {object} sourceMap The source-map
|
||||
* @returns {string|String}
|
||||
*/
|
||||
function resolveUrlLoader(content, sourceMap) {
|
||||
/* jshint validthis:true */
|
||||
|
||||
// details of the file being processed
|
||||
var loader = this;
|
||||
|
||||
// a relative loader.context is a problem
|
||||
if (/^\./.test(loader.context)) {
|
||||
return handleAsError(
|
||||
'webpack misconfiguration',
|
||||
'loader.context is relative, expected absolute'
|
||||
);
|
||||
}
|
||||
|
||||
// webpack 1: prefer loader query, else options object
|
||||
// webpack 2: prefer loader options
|
||||
// webpack 3: deprecate loader.options object
|
||||
// webpack 4: loader.options no longer defined
|
||||
var options = Object.assign(
|
||||
{
|
||||
sourceMap: loader.sourceMap,
|
||||
engine : 'postcss',
|
||||
silent : false,
|
||||
absolute : false,
|
||||
keepQuery: false,
|
||||
removeCR : false,
|
||||
root : false,
|
||||
debug : false,
|
||||
join : joinFn.defaultJoin
|
||||
},
|
||||
!!loader.options && loader.options[camelcase(PACKAGE_NAME)],
|
||||
loaderUtils.getOptions(loader)
|
||||
);
|
||||
|
||||
// maybe log options for the test harness
|
||||
logToTestHarness(options);
|
||||
|
||||
// defunct options
|
||||
if ('attempts' in options) {
|
||||
handleAsWarning(
|
||||
'loader misconfiguration',
|
||||
'"attempts" option is defunct (consider "join" option if search is needed)'
|
||||
);
|
||||
}
|
||||
if ('includeRoot' in options) {
|
||||
handleAsWarning(
|
||||
'loader misconfiguration',
|
||||
'"includeRoot" option is defunct (consider "join" option if search is needed)'
|
||||
);
|
||||
}
|
||||
if ('fail' in options) {
|
||||
handleAsWarning(
|
||||
'loader misconfiguration',
|
||||
'"fail" option is defunct'
|
||||
);
|
||||
}
|
||||
|
||||
// validate join option
|
||||
if (typeof options.join !== 'function') {
|
||||
return handleAsError(
|
||||
'loader misconfiguration',
|
||||
'"join" option must be a Function'
|
||||
);
|
||||
} else if (options.join.length !== 2) {
|
||||
return handleAsError(
|
||||
'loader misconfiguration',
|
||||
'"join" Function must take exactly 2 arguments (filename and options hash)'
|
||||
);
|
||||
}
|
||||
|
||||
// validate root option
|
||||
if (typeof options.root === 'string') {
|
||||
var isValid = (options.root === '') ||
|
||||
(path.isAbsolute(options.root) && fs.existsSync(options.root) && fs.statSync(options.root).isDirectory());
|
||||
|
||||
if (!isValid) {
|
||||
return handleAsError(
|
||||
'loader misconfiguration',
|
||||
'"root" option must be an empty string or an absolute path to an existing directory'
|
||||
);
|
||||
}
|
||||
} else if (options.root !== false) {
|
||||
handleAsWarning(
|
||||
'loader misconfiguration',
|
||||
'"root" option must be string where used or false where unused'
|
||||
);
|
||||
}
|
||||
|
||||
// loader result is cacheable
|
||||
loader.cacheable();
|
||||
|
||||
// incoming source-map
|
||||
var sourceMapConsumer, absSourceMap;
|
||||
if (sourceMap) {
|
||||
|
||||
// support non-standard string encoded source-map (per less-loader)
|
||||
if (typeof sourceMap === 'string') {
|
||||
try {
|
||||
sourceMap = JSON.parse(sourceMap);
|
||||
}
|
||||
catch (exception) {
|
||||
return handleAsError(
|
||||
'source-map error',
|
||||
'cannot parse source-map string (from less-loader?)'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// leverage adjust-sourcemap-loader's codecs to avoid having to make any assumptions about the sourcemap
|
||||
// historically this is a regular source of breakage
|
||||
try {
|
||||
absSourceMap = adjustSourceMap(loader, {format: 'absolute'}, sourceMap);
|
||||
}
|
||||
catch (exception) {
|
||||
return handleAsError(
|
||||
'source-map error',
|
||||
exception.message
|
||||
);
|
||||
}
|
||||
|
||||
// prepare the adjusted sass source-map for later look-ups
|
||||
sourceMapConsumer = new SourceMapConsumer(absSourceMap);
|
||||
}
|
||||
|
||||
// choose a CSS engine
|
||||
var enginePath = /^\w+$/.test(options.engine) && path.join(__dirname, 'lib', 'engine', options.engine + '.js');
|
||||
var isValidEngine = fs.existsSync(enginePath);
|
||||
if (!isValidEngine) {
|
||||
return handleAsError(
|
||||
'loader misconfiguration',
|
||||
'"engine" option is not valid'
|
||||
);
|
||||
}
|
||||
|
||||
// process async
|
||||
var callback = loader.async();
|
||||
Promise
|
||||
.resolve(require(enginePath)(loader.resourcePath, content, {
|
||||
outputSourceMap : !!options.sourceMap,
|
||||
transformDeclaration: valueProcessor(loader.resourcePath, options),
|
||||
absSourceMap : absSourceMap,
|
||||
sourceMapConsumer : sourceMapConsumer,
|
||||
removeCR : options.removeCR
|
||||
}))
|
||||
.catch(onFailure)
|
||||
.then(onSuccess);
|
||||
|
||||
function onFailure(error) {
|
||||
callback(encodeError('CSS error', error));
|
||||
}
|
||||
|
||||
function onSuccess(reworked) {
|
||||
if (reworked) {
|
||||
// complete with source-map
|
||||
// source-map sources are relative to the file being processed
|
||||
if (options.sourceMap) {
|
||||
var finalMap = adjustSourceMap(loader, {format: 'sourceRelative'}, reworked.map);
|
||||
callback(null, reworked.content, finalMap);
|
||||
}
|
||||
// complete without source-map
|
||||
else {
|
||||
callback(null, reworked.content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a warning for the given exception and return the original content.
|
||||
* @param {string} label Summary of the error
|
||||
* @param {string|Error} [exception] Optional extended error details
|
||||
* @returns {string} The original CSS content
|
||||
*/
|
||||
function handleAsWarning(label, exception) {
|
||||
if (!options.silent) {
|
||||
loader.emitWarning(encodeError(label, exception));
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a warning for the given exception and return the original content.
|
||||
* @param {string} label Summary of the error
|
||||
* @param {string|Error} [exception] Optional extended error details
|
||||
* @returns {string} The original CSS content
|
||||
*/
|
||||
function handleAsError(label, exception) {
|
||||
loader.emitError(encodeError(label, exception));
|
||||
return content;
|
||||
}
|
||||
|
||||
function encodeError(label, exception) {
|
||||
return new Error(
|
||||
[
|
||||
PACKAGE_NAME,
|
||||
': ',
|
||||
[label]
|
||||
.concat(
|
||||
(typeof exception === 'string') && exception ||
|
||||
(exception instanceof Error) && [exception.message, exception.stack.split('\n')[1].trim()] ||
|
||||
[]
|
||||
)
|
||||
.filter(Boolean)
|
||||
.join('\n ')
|
||||
].join('')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Object.assign(resolveUrlLoader, joinFn);
|
18
web/node_modules/resolve-url-loader/lib/engine/fail.js
generated
vendored
Normal file
18
web/node_modules/resolve-url-loader/lib/engine/fail.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Process the given CSS content into reworked CSS content.
|
||||
*/
|
||||
function process() {
|
||||
return new Promise(function (_, reject) {
|
||||
setTimeout(function () {
|
||||
reject(new Error('This "engine" is designed to fail, for testing purposes only'));
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = process;
|
89
web/node_modules/resolve-url-loader/lib/engine/postcss.js
generated
vendored
Normal file
89
web/node_modules/resolve-url-loader/lib/engine/postcss.js
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var os = require('os'),
|
||||
path = require('path'),
|
||||
postcss = require('postcss');
|
||||
|
||||
var fileProtocol = require('../file-protocol');
|
||||
|
||||
var ORPHAN_CR_REGEX = /\r(?!\n)(.|\n)?/g;
|
||||
|
||||
/**
|
||||
* Process the given CSS content into reworked CSS content.
|
||||
*
|
||||
* @param {string} sourceFile The absolute path of the file being processed
|
||||
* @param {string} sourceContent CSS content without source-map
|
||||
* @param {{outputSourceMap: boolean, transformDeclaration:function, absSourceMap:object,
|
||||
* sourceMapConsumer:object, removeCR:boolean}} params Named parameters
|
||||
* @return {{content: string, map: object}} Reworked CSS and optional source-map
|
||||
*/
|
||||
function process(sourceFile, sourceContent, params) {
|
||||
// #107 libsass emits orphan CR not considered newline, postcss does consider newline (content vs source-map mismatch)
|
||||
var correctedContent = params.removeCR && (os.EOL !== '\r') ?
|
||||
sourceContent.replace(ORPHAN_CR_REGEX, ' $1') :
|
||||
sourceContent;
|
||||
|
||||
// prepend file protocol to all sources to avoid problems with source map
|
||||
return postcss([
|
||||
postcss.plugin('postcss-resolve-url', postcssPlugin)
|
||||
])
|
||||
.process(correctedContent, {
|
||||
from: fileProtocol.prepend(sourceFile),
|
||||
map : params.outputSourceMap && {
|
||||
prev : !!params.absSourceMap && fileProtocol.prepend(params.absSourceMap),
|
||||
inline : false,
|
||||
annotation : false,
|
||||
sourcesContent: true // #98 sourcesContent missing from output map
|
||||
}
|
||||
})
|
||||
.then(result => ({
|
||||
content: result.css,
|
||||
map : params.outputSourceMap ? fileProtocol.remove(result.map.toJSON()) : null
|
||||
}));
|
||||
|
||||
/**
|
||||
* Plugin for postcss that follows SASS transpilation.
|
||||
*/
|
||||
function postcssPlugin() {
|
||||
return function(styles) {
|
||||
styles.walkDecls(eachDeclaration);
|
||||
};
|
||||
|
||||
/**
|
||||
* Process a declaration from the syntax tree.
|
||||
* @param declaration
|
||||
*/
|
||||
function eachDeclaration(declaration) {
|
||||
var isValid = declaration.value && (declaration.value.indexOf('url') >= 0);
|
||||
if (isValid) {
|
||||
|
||||
// reverse the original source-map to find the original source file before transpilation
|
||||
var startPosApparent = declaration.source.start,
|
||||
startPosOriginal = params.sourceMapConsumer &&
|
||||
params.sourceMapConsumer.originalPositionFor(startPosApparent);
|
||||
|
||||
// we require a valid directory for the specified file
|
||||
var directory =
|
||||
startPosOriginal &&
|
||||
startPosOriginal.source &&
|
||||
fileProtocol.remove(path.dirname(startPosOriginal.source));
|
||||
if (directory) {
|
||||
declaration.value = params.transformDeclaration(declaration.value, directory);
|
||||
}
|
||||
// source-map present but invalid entry
|
||||
else if (params.sourceMapConsumer) {
|
||||
throw new Error(
|
||||
'source-map information is not available at url() declaration ' +
|
||||
(ORPHAN_CR_REGEX.test(sourceContent) ? '(found orphan CR, try removeCR option)' : '(no orphan CR found)')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = process;
|
101
web/node_modules/resolve-url-loader/lib/engine/rework.js
generated
vendored
Normal file
101
web/node_modules/resolve-url-loader/lib/engine/rework.js
generated
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var path = require('path'),
|
||||
convert = require('convert-source-map'),
|
||||
rework = require('rework'),
|
||||
visit = require('rework-visit');
|
||||
|
||||
var fileProtocol = require('../file-protocol');
|
||||
|
||||
/**
|
||||
* Process the given CSS content into reworked CSS content.
|
||||
*
|
||||
* @param {string} sourceFile The absolute path of the file being processed
|
||||
* @param {string} sourceContent CSS content without source-map
|
||||
* @param {{outputSourceMap: boolean, transformDeclaration:function, absSourceMap:object,
|
||||
* sourceMapConsumer:object}} params Named parameters
|
||||
* @return {{content: string, map: object}} Reworked CSS and optional source-map
|
||||
*/
|
||||
function process(sourceFile, sourceContent, params) {
|
||||
|
||||
// embed source-map in css
|
||||
// prepend file protocol to all sources to avoid problems with source map
|
||||
var contentWithMap = sourceContent + (
|
||||
params.absSourceMap ?
|
||||
convert.fromObject(fileProtocol.prepend(params.absSourceMap)).toComment({multiline: true}) :
|
||||
''
|
||||
);
|
||||
|
||||
// need to prepend file protocol to source as well to avoid problems with source map
|
||||
var reworked = rework(contentWithMap, {source: fileProtocol.prepend(sourceFile)})
|
||||
.use(reworkPlugin)
|
||||
.toString({
|
||||
sourcemap : params.outputSourceMap,
|
||||
sourcemapAsObject: params.outputSourceMap
|
||||
});
|
||||
|
||||
// complete with source-map
|
||||
if (params.outputSourceMap) {
|
||||
return {
|
||||
content: reworked.code,
|
||||
map : fileProtocol.remove(reworked.map)
|
||||
};
|
||||
}
|
||||
// complete without source-map
|
||||
else {
|
||||
return {
|
||||
content: reworked,
|
||||
map : null
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin for css rework that follows SASS transpilation.
|
||||
*
|
||||
* @param {object} stylesheet AST for the CSS output from SASS
|
||||
*/
|
||||
function reworkPlugin(stylesheet) {
|
||||
|
||||
// visit each node (selector) in the stylesheet recursively using the official utility method
|
||||
// each node may have multiple declarations
|
||||
visit(stylesheet, function visitor(declarations) {
|
||||
if (declarations) {
|
||||
declarations.forEach(eachDeclaration);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Process a declaration from the syntax tree.
|
||||
* @param declaration
|
||||
*/
|
||||
function eachDeclaration(declaration) {
|
||||
var isValid = declaration.value && (declaration.value.indexOf('url') >= 0);
|
||||
if (isValid) {
|
||||
|
||||
// reverse the original source-map to find the original source file before transpilation
|
||||
var startPosApparent = declaration.position.start,
|
||||
startPosOriginal = params.sourceMapConsumer &&
|
||||
params.sourceMapConsumer.originalPositionFor(startPosApparent);
|
||||
|
||||
// we require a valid directory for the specified file
|
||||
var directory =
|
||||
startPosOriginal &&
|
||||
startPosOriginal.source &&
|
||||
fileProtocol.remove(path.dirname(startPosOriginal.source));
|
||||
if (directory) {
|
||||
declaration.value = params.transformDeclaration(declaration.value, directory);
|
||||
}
|
||||
// source-map present but invalid entry
|
||||
else if (params.sourceMapConsumer) {
|
||||
throw new Error('source-map information is not available at url() declaration');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = process;
|
39
web/node_modules/resolve-url-loader/lib/file-protocol.js
generated
vendored
Normal file
39
web/node_modules/resolve-url-loader/lib/file-protocol.js
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Prepend file:// protocol to source path string or source-map sources.
|
||||
*/
|
||||
function prepend(candidate) {
|
||||
if (typeof candidate === 'string') {
|
||||
return 'file://' + candidate;
|
||||
} else if (candidate && (typeof candidate === 'object') && Array.isArray(candidate.sources)) {
|
||||
return Object.assign({}, candidate, {
|
||||
sources: candidate.sources.map(prepend)
|
||||
});
|
||||
} else {
|
||||
throw new Error('expected string|object');
|
||||
}
|
||||
}
|
||||
|
||||
exports.prepend = prepend;
|
||||
|
||||
/**
|
||||
* Remove file:// protocol from source path string or source-map sources.
|
||||
*/
|
||||
function remove(candidate) {
|
||||
if (typeof candidate === 'string') {
|
||||
return candidate.replace(/^file:\/{2}/, '');
|
||||
} else if (candidate && (typeof candidate === 'object') && Array.isArray(candidate.sources)) {
|
||||
return Object.assign({}, candidate, {
|
||||
sources: candidate.sources.map(remove)
|
||||
});
|
||||
} else {
|
||||
throw new Error('expected string|object');
|
||||
}
|
||||
}
|
||||
|
||||
exports.remove = remove;
|
190
web/node_modules/resolve-url-loader/lib/join-function.js
generated
vendored
Normal file
190
web/node_modules/resolve-url-loader/lib/join-function.js
generated
vendored
Normal file
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var path = require('path'),
|
||||
fs = require('fs'),
|
||||
compose = require('compose-function'),
|
||||
Iterator = require('es6-iterator');
|
||||
|
||||
var PACKAGE_NAME = require('../package.json').name;
|
||||
|
||||
var simpleJoin = compose(path.normalize, path.join);
|
||||
|
||||
/**
|
||||
* The default join function iterates over possible base paths until a suitable join is found.
|
||||
*
|
||||
* The first base path is used as fallback for the case where none of the base paths can locate the actual file.
|
||||
*
|
||||
* @type {function}
|
||||
*/
|
||||
exports.defaultJoin = createJoinForPredicate(
|
||||
function predicate(_, uri, base, i, next) {
|
||||
var absolute = simpleJoin(base, uri);
|
||||
return fs.existsSync(absolute) ? absolute : next((i === 0) ? absolute : null);
|
||||
},
|
||||
'defaultJoin'
|
||||
);
|
||||
|
||||
/**
|
||||
* Define a join function by a predicate that tests possible base paths from an iterator.
|
||||
*
|
||||
* The `predicate` is of the form:
|
||||
*
|
||||
* ```
|
||||
* function(filename, uri, base, i, next):string|null
|
||||
* ```
|
||||
*
|
||||
* Given the uri and base it should either return:
|
||||
* - an absolute path success
|
||||
* - a call to `next(null)` as failure
|
||||
* - a call to `next(absolute)` where absolute is placeholder and the iterator continues
|
||||
*
|
||||
* The value given to `next(...)` is only used if success does not eventually occur.
|
||||
*
|
||||
* The `file` value is typically unused but useful if you would like to differentiate behaviour.
|
||||
*
|
||||
* You can write a much simpler function than this if you have specific requirements.
|
||||
*
|
||||
* @param {function} predicate A function that tests values
|
||||
* @param {string} [name] Optional name for the resulting join function
|
||||
*/
|
||||
function createJoinForPredicate(predicate, name) {
|
||||
/**
|
||||
* A factory for a join function with logging.
|
||||
*
|
||||
* @param {string} filename The current file being processed
|
||||
* @param {{debug:function|boolean,root:string}} options An options hash
|
||||
*/
|
||||
function join(filename, options) {
|
||||
var log = createDebugLogger(options.debug);
|
||||
|
||||
/**
|
||||
* Join function proper.
|
||||
*
|
||||
* For absolute uri only `uri` will be provided. In this case we substitute any `root` given in options.
|
||||
*
|
||||
* @param {string} uri A uri path, relative or absolute
|
||||
* @param {string|Iterator.<string>} [baseOrIteratorOrAbsent] Optional absolute base path or iterator thereof
|
||||
* @return {string} Just the uri where base is empty or the uri appended to the base
|
||||
*/
|
||||
return function joinProper(uri, baseOrIteratorOrAbsent) {
|
||||
var iterator =
|
||||
(typeof baseOrIteratorOrAbsent === 'undefined') && new Iterator([options.root ]) ||
|
||||
(typeof baseOrIteratorOrAbsent === 'string' ) && new Iterator([baseOrIteratorOrAbsent]) ||
|
||||
baseOrIteratorOrAbsent;
|
||||
|
||||
var result = runIterator([]);
|
||||
log(createJoinMsg, [filename, uri, result, result.isFound]);
|
||||
|
||||
return (typeof result.absolute === 'string') ? result.absolute : uri;
|
||||
|
||||
function runIterator(accumulator) {
|
||||
var nextItem = iterator.next();
|
||||
var base = !nextItem.done && nextItem.value;
|
||||
if (typeof base === 'string') {
|
||||
var element = predicate(filename, uri, base, accumulator.length, next);
|
||||
|
||||
if ((typeof element === 'string') && path.isAbsolute(element)) {
|
||||
return Object.assign(
|
||||
accumulator.concat(base),
|
||||
{isFound: true, absolute: element}
|
||||
);
|
||||
} else if (Array.isArray(element)) {
|
||||
return element;
|
||||
} else {
|
||||
throw new Error('predicate must return an absolute path or the result of calling next()');
|
||||
}
|
||||
} else {
|
||||
return accumulator;
|
||||
}
|
||||
|
||||
function next(fallback) {
|
||||
return runIterator(Object.assign(
|
||||
accumulator.concat(base),
|
||||
(typeof fallback === 'string') && {absolute: fallback}
|
||||
));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function toString() {
|
||||
return '[Function: ' + name + ']';
|
||||
}
|
||||
|
||||
return Object.assign(join, name && {
|
||||
valueOf : toString,
|
||||
toString: toString
|
||||
});
|
||||
}
|
||||
|
||||
exports.createJoinForPredicate = createJoinForPredicate;
|
||||
|
||||
/**
|
||||
* Format a debug message.
|
||||
*
|
||||
* @param {string} file The file being processed by webpack
|
||||
* @param {string} uri A uri path, relative or absolute
|
||||
* @param {Array.<string>} bases Absolute base paths up to and including the found one
|
||||
* @param {boolean} isFound Indicates the last base was correct
|
||||
* @return {string} Formatted message
|
||||
*/
|
||||
function createJoinMsg(file, uri, bases, isFound) {
|
||||
return [PACKAGE_NAME + ': ' + pathToString(file) + ': ' + uri]
|
||||
.concat(bases.map(pathToString).filter(Boolean))
|
||||
.concat(isFound ? 'FOUND' : 'NOT FOUND')
|
||||
.join('\n ');
|
||||
|
||||
/**
|
||||
* If given path is within `process.cwd()` then show relative posix path, otherwise show absolute posix path.
|
||||
*
|
||||
* @param {string} absolute An absolute path
|
||||
* @return {string} A relative or absolute path
|
||||
*/
|
||||
function pathToString(absolute) {
|
||||
if (!absolute) {
|
||||
return null;
|
||||
} else {
|
||||
var relative = path.relative(process.cwd(), absolute)
|
||||
.split(path.sep);
|
||||
|
||||
return ((relative[0] === '..') ? absolute.split(path.sep) : ['.'].concat(relative).filter(Boolean))
|
||||
.join('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.createJoinMsg = createJoinMsg;
|
||||
|
||||
/**
|
||||
* A factory for a log function predicated on the given debug parameter.
|
||||
*
|
||||
* The logging function created accepts a function that formats a message and parameters that the function utilises.
|
||||
* Presuming the message function may be expensive we only call it if logging is enabled.
|
||||
*
|
||||
* The log messages are de-duplicated based on the parameters, so it is assumed they are simple types that stringify
|
||||
* well.
|
||||
*
|
||||
* @param {function|boolean} debug A boolean or debug function
|
||||
* @return {function(function, array)} A logging function possibly degenerate
|
||||
*/
|
||||
function createDebugLogger(debug) {
|
||||
var log = !!debug && ((typeof debug === 'function') ? debug : console.log);
|
||||
var cache = {};
|
||||
return log ? actuallyLog : noop;
|
||||
|
||||
function noop() {}
|
||||
|
||||
function actuallyLog(msgFn, params) {
|
||||
var key = JSON.stringify(params);
|
||||
if (!cache[key]) {
|
||||
cache[key] = true;
|
||||
log(msgFn.apply(null, params));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.createDebugLogger = createDebugLogger;
|
26
web/node_modules/resolve-url-loader/lib/log-to-test-harness.js
generated
vendored
Normal file
26
web/node_modules/resolve-url-loader/lib/log-to-test-harness.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var stream = require('stream');
|
||||
|
||||
var maybeStream = process[process.env.RESOLVE_URL_LOADER_TEST_HARNESS];
|
||||
|
||||
function logToTestHarness(options) {
|
||||
if (!!maybeStream && (typeof maybeStream === 'object') && (maybeStream instanceof stream.Writable)) {
|
||||
Object.keys(options).map(eachOptionKey);
|
||||
maybeStream = null; // ensure we log only once
|
||||
}
|
||||
|
||||
function eachOptionKey(key) {
|
||||
var value = options[key];
|
||||
var text = (typeof value === 'undefined') ?
|
||||
String(value) :
|
||||
(JSON.stringify(value.valueOf()) || '-unstringifyable-');
|
||||
maybeStream.write(key + ': ' + text + '\n');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = logToTestHarness;
|
114
web/node_modules/resolve-url-loader/lib/value-processor.js
generated
vendored
Normal file
114
web/node_modules/resolve-url-loader/lib/value-processor.js
generated
vendored
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* MIT License http://opensource.org/licenses/MIT
|
||||
* Author: Ben Holloway @bholloway
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var path = require('path'),
|
||||
loaderUtils = require('loader-utils');
|
||||
|
||||
/**
|
||||
* Create a value processing function for a given file path.
|
||||
*
|
||||
* @param {string} filename The current file being processed
|
||||
* @param {{absolute:string, keepQuery:boolean, join:function, root:string}} options Options hash
|
||||
* @return {function} value processing function
|
||||
*/
|
||||
function valueProcessor(filename, options) {
|
||||
var URL_STATEMENT_REGEX = /(url\s*\()\s*(?:(['"])((?:(?!\2).)*)(\2)|([^'"](?:(?!\)).)*[^'"]))\s*(\))/g;
|
||||
var directory = path.dirname(filename);
|
||||
var join = options.join(filename, options);
|
||||
|
||||
/**
|
||||
* Process the given CSS declaration value.
|
||||
*
|
||||
* @param {string} value A declaration value that may or may not contain a url() statement
|
||||
* @param {string|Iterator.<string>} candidate An absolute path that may be the correct base or an Iterator thereof
|
||||
*/
|
||||
return function transformValue(value, candidate) {
|
||||
|
||||
// allow multiple url() values in the declaration
|
||||
// split by url statements and process the content
|
||||
// additional capture groups are needed to match quotations correctly
|
||||
// escaped quotations are not considered
|
||||
return value
|
||||
.split(URL_STATEMENT_REGEX)
|
||||
.map(eachSplitOrGroup)
|
||||
.join('');
|
||||
|
||||
/**
|
||||
* Encode the content portion of <code>url()</code> statements.
|
||||
* There are 4 capture groups in the split making every 5th unmatched.
|
||||
*
|
||||
* @param {string} token A single split item
|
||||
* @param {number} i The index of the item in the split
|
||||
* @param {Array} arr The array of split values
|
||||
* @returns {string} Every 3 or 5 items is an encoded url everything else is as is
|
||||
*/
|
||||
function eachSplitOrGroup(token, i, arr) {
|
||||
|
||||
// we can get groups as undefined under certain match circumstances
|
||||
var initialised = token || '';
|
||||
|
||||
// the content of the url() statement is either in group 3 or group 5
|
||||
var mod = i % 7;
|
||||
if ((mod === 3) || (mod === 5)) {
|
||||
|
||||
// detect quoted url and unescape backslashes
|
||||
var before = arr[i - 1],
|
||||
after = arr[i + 1],
|
||||
isQuoted = (before === after) && ((before === '\'') || (before === '"')),
|
||||
unescaped = isQuoted ? initialised.replace(/\\{2}/g, '\\') : initialised;
|
||||
|
||||
// split into uri and query/hash and then find the absolute path to the uri
|
||||
var split = unescaped.split(/([?#])/g),
|
||||
uri = split[0],
|
||||
absolute = testIsRelative(uri) && join(uri, candidate) || testIsAbsolute(uri) && join(uri),
|
||||
query = options.keepQuery ? split.slice(1).join('') : '';
|
||||
|
||||
// use the absolute path in absolute mode or else relative path (or default to initialised)
|
||||
// #6 - backslashes are not legal in URI
|
||||
if (!absolute) {
|
||||
return initialised;
|
||||
} else if (options.absolute) {
|
||||
return absolute.replace(/\\/g, '/') + query;
|
||||
} else {
|
||||
return loaderUtils.urlToRequest(
|
||||
path.relative(directory, absolute).replace(/\\/g, '/') + query
|
||||
);
|
||||
}
|
||||
}
|
||||
// everything else, including parentheses and quotation (where present) and media statements
|
||||
else {
|
||||
return initialised;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The loaderUtils.isUrlRequest() doesn't support windows absolute paths on principle. We do not subscribe to that
|
||||
* dogma so we add path.isAbsolute() check to allow them.
|
||||
*
|
||||
* We also eliminate module relative (~) paths.
|
||||
*
|
||||
* @param {string|undefined} uri A uri string possibly empty or undefined
|
||||
* @return {boolean} True for relative uri
|
||||
*/
|
||||
function testIsRelative(uri) {
|
||||
return !!uri && loaderUtils.isUrlRequest(uri, false) && !path.isAbsolute(uri) && (uri.indexOf('~') !== 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* The loaderUtils.isUrlRequest() doesn't support windows absolute paths on principle. We do not subscribe to that
|
||||
* dogma so we add path.isAbsolute() check to allow them.
|
||||
*
|
||||
* @param {string|undefined} uri A uri string possibly empty or undefined
|
||||
* @return {boolean} True for absolute uri
|
||||
*/
|
||||
function testIsAbsolute(uri) {
|
||||
return !!uri && (typeof options.root === 'string') && loaderUtils.isUrlRequest(uri, options.root) &&
|
||||
(/^\//.test(uri) || path.isAbsolute(uri));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = valueProcessor;
|
1
web/node_modules/resolve-url-loader/node_modules/.bin/json5
generated
vendored
Symbolic link
1
web/node_modules/resolve-url-loader/node_modules/.bin/json5
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../json5/lib/cli.js
|
63
web/node_modules/resolve-url-loader/node_modules/camelcase/index.d.ts
generated
vendored
Normal file
63
web/node_modules/resolve-url-loader/node_modules/camelcase/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
declare namespace camelcase {
|
||||
interface Options {
|
||||
/**
|
||||
Uppercase the first character: `foo-bar` → `FooBar`.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly pascalCase?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const camelcase: {
|
||||
/**
|
||||
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
|
||||
|
||||
@param input - String to convert to camel case.
|
||||
|
||||
@example
|
||||
```
|
||||
import camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
*/
|
||||
(input: string | ReadonlyArray<string>, options?: camelcase.Options): string;
|
||||
|
||||
// TODO: Remove this for the next major release, refactor the whole definition to:
|
||||
// declare function camelcase(
|
||||
// input: string | ReadonlyArray<string>,
|
||||
// options?: camelcase.Options
|
||||
// ): string;
|
||||
// export = camelcase;
|
||||
default: typeof camelcase;
|
||||
};
|
||||
|
||||
export = camelcase;
|
76
web/node_modules/resolve-url-loader/node_modules/camelcase/index.js
generated
vendored
Normal file
76
web/node_modules/resolve-url-loader/node_modules/camelcase/index.js
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
'use strict';
|
||||
|
||||
const preserveCamelCase = string => {
|
||||
let isLastCharLower = false;
|
||||
let isLastCharUpper = false;
|
||||
let isLastLastCharUpper = false;
|
||||
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
const character = string[i];
|
||||
|
||||
if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
|
||||
string = string.slice(0, i) + '-' + string.slice(i);
|
||||
isLastCharLower = false;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = true;
|
||||
i++;
|
||||
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
|
||||
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = false;
|
||||
isLastCharLower = true;
|
||||
} else {
|
||||
isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
|
||||
isLastLastCharUpper = isLastCharUpper;
|
||||
isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
};
|
||||
|
||||
const camelCase = (input, options) => {
|
||||
if (!(typeof input === 'string' || Array.isArray(input))) {
|
||||
throw new TypeError('Expected the input to be `string | string[]`');
|
||||
}
|
||||
|
||||
options = Object.assign({
|
||||
pascalCase: false
|
||||
}, options);
|
||||
|
||||
const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
input = input.map(x => x.trim())
|
||||
.filter(x => x.length)
|
||||
.join('-');
|
||||
} else {
|
||||
input = input.trim();
|
||||
}
|
||||
|
||||
if (input.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (input.length === 1) {
|
||||
return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
|
||||
}
|
||||
|
||||
const hasUpperCase = input !== input.toLowerCase();
|
||||
|
||||
if (hasUpperCase) {
|
||||
input = preserveCamelCase(input);
|
||||
}
|
||||
|
||||
input = input
|
||||
.replace(/^[_.\- ]+/, '')
|
||||
.toLowerCase()
|
||||
.replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase())
|
||||
.replace(/\d+(\w|$)/g, m => m.toUpperCase());
|
||||
|
||||
return postProcess(input);
|
||||
};
|
||||
|
||||
module.exports = camelCase;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = camelCase;
|
9
web/node_modules/resolve-url-loader/node_modules/camelcase/license
generated
vendored
Normal file
9
web/node_modules/resolve-url-loader/node_modules/camelcase/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
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.
|
43
web/node_modules/resolve-url-loader/node_modules/camelcase/package.json
generated
vendored
Normal file
43
web/node_modules/resolve-url-loader/node_modules/camelcase/package.json
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"name": "camelcase",
|
||||
"version": "5.3.1",
|
||||
"description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/camelcase",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"camelcase",
|
||||
"camel-case",
|
||||
"camel",
|
||||
"case",
|
||||
"dash",
|
||||
"hyphen",
|
||||
"dot",
|
||||
"underscore",
|
||||
"separator",
|
||||
"string",
|
||||
"text",
|
||||
"convert",
|
||||
"pascalcase",
|
||||
"pascal-case"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
99
web/node_modules/resolve-url-loader/node_modules/camelcase/readme.md
generated
vendored
Normal file
99
web/node_modules/resolve-url-loader/node_modules/camelcase/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,99 @@
|
|||
# camelcase [](https://travis-ci.org/sindresorhus/camelcase)
|
||||
|
||||
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=readme">Get professional support for 'camelcase' with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install camelcase
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### camelCase(input, [options])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string` `string[]`
|
||||
|
||||
String to convert to camel case.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### pascalCase
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Uppercase the first character: `foo-bar` → `FooBar`
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
|
||||
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
|
||||
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
|
||||
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
23
web/node_modules/resolve-url-loader/node_modules/convert-source-map/LICENSE
generated
vendored
Normal file
23
web/node_modules/resolve-url-loader/node_modules/convert-source-map/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
Copyright 2013 Thorsten Lorenz.
|
||||
All rights reserved.
|
||||
|
||||
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.
|
125
web/node_modules/resolve-url-loader/node_modules/convert-source-map/README.md
generated
vendored
Normal file
125
web/node_modules/resolve-url-loader/node_modules/convert-source-map/README.md
generated
vendored
Normal file
|
@ -0,0 +1,125 @@
|
|||
# convert-source-map [](http://travis-ci.org/thlorenz/convert-source-map)
|
||||
|
||||
<a href="https://www.patreon.com/bePatron?u=8663953"><img alt="become a patron" src="https://c5.patreon.com/external/logo/become_a_patron_button.png" height="35px"></a>
|
||||
|
||||
Converts a source-map from/to different formats and allows adding/changing properties.
|
||||
|
||||
```js
|
||||
var convert = require('convert-source-map');
|
||||
|
||||
var json = convert
|
||||
.fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
|
||||
.toJSON();
|
||||
|
||||
var modified = convert
|
||||
.fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
|
||||
.setProperty('sources', [ 'SRC/FOO.JS' ])
|
||||
.toJSON();
|
||||
|
||||
console.log(json);
|
||||
console.log(modified);
|
||||
```
|
||||
|
||||
```json
|
||||
{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
|
||||
{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### fromObject(obj)
|
||||
|
||||
Returns source map converter from given object.
|
||||
|
||||
### fromJSON(json)
|
||||
|
||||
Returns source map converter from given json string.
|
||||
|
||||
### fromBase64(base64)
|
||||
|
||||
Returns source map converter from given base64 encoded json string.
|
||||
|
||||
### fromComment(comment)
|
||||
|
||||
Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`.
|
||||
|
||||
### fromMapFileComment(comment, mapFileDir)
|
||||
|
||||
Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`.
|
||||
|
||||
`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the
|
||||
generated file, i.e. the one containing the source map.
|
||||
|
||||
### fromSource(source)
|
||||
|
||||
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
|
||||
|
||||
### fromMapFileSource(source, mapFileDir)
|
||||
|
||||
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was
|
||||
found.
|
||||
|
||||
The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see
|
||||
fromMapFileComment.
|
||||
|
||||
### toObject()
|
||||
|
||||
Returns a copy of the underlying source map.
|
||||
|
||||
### toJSON([space])
|
||||
|
||||
Converts source map to json string. If `space` is given (optional), this will be passed to
|
||||
[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the
|
||||
JSON string is generated.
|
||||
|
||||
### toBase64()
|
||||
|
||||
Converts source map to base64 encoded json string.
|
||||
|
||||
### toComment([options])
|
||||
|
||||
Converts source map to an inline comment that can be appended to the source-file.
|
||||
|
||||
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would
|
||||
normally see in a JS source file.
|
||||
|
||||
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file.
|
||||
|
||||
### addProperty(key, value)
|
||||
|
||||
Adds given property to the source map. Throws an error if property already exists.
|
||||
|
||||
### setProperty(key, value)
|
||||
|
||||
Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated.
|
||||
|
||||
### getProperty(key)
|
||||
|
||||
Gets given property of the source map.
|
||||
|
||||
### removeComments(src)
|
||||
|
||||
Returns `src` with all source map comments removed
|
||||
|
||||
### removeMapFileComments(src)
|
||||
|
||||
Returns `src` with all source map comments pointing to map files removed.
|
||||
|
||||
### commentRegex
|
||||
|
||||
Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments.
|
||||
|
||||
### mapFileCommentRegex
|
||||
|
||||
Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files.
|
||||
|
||||
### generateMapFileComment(file, [options])
|
||||
|
||||
Returns a comment that links to an external source map via `file`.
|
||||
|
||||
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file.
|
||||
|
||||
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file.
|
||||
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
136
web/node_modules/resolve-url-loader/node_modules/convert-source-map/index.js
generated
vendored
Normal file
136
web/node_modules/resolve-url-loader/node_modules/convert-source-map/index.js
generated
vendored
Normal file
|
@ -0,0 +1,136 @@
|
|||
'use strict';
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var SafeBuffer = require('safe-buffer');
|
||||
|
||||
Object.defineProperty(exports, 'commentRegex', {
|
||||
get: function getCommentRegex () {
|
||||
return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(exports, 'mapFileCommentRegex', {
|
||||
get: function getMapFileCommentRegex () {
|
||||
// Matches sourceMappingURL in either // or /* comment styles.
|
||||
return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function decodeBase64(base64) {
|
||||
return SafeBuffer.Buffer.from(base64, 'base64').toString();
|
||||
}
|
||||
|
||||
function stripComment(sm) {
|
||||
return sm.split(',').pop();
|
||||
}
|
||||
|
||||
function readFromFileMap(sm, dir) {
|
||||
// NOTE: this will only work on the server since it attempts to read the map file
|
||||
|
||||
var r = exports.mapFileCommentRegex.exec(sm);
|
||||
|
||||
// for some odd reason //# .. captures in 1 and /* .. */ in 2
|
||||
var filename = r[1] || r[2];
|
||||
var filepath = path.resolve(dir, filename);
|
||||
|
||||
try {
|
||||
return fs.readFileSync(filepath, 'utf8');
|
||||
} catch (e) {
|
||||
throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e);
|
||||
}
|
||||
}
|
||||
|
||||
function Converter (sm, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
|
||||
if (opts.hasComment) sm = stripComment(sm);
|
||||
if (opts.isEncoded) sm = decodeBase64(sm);
|
||||
if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
|
||||
|
||||
this.sourcemap = sm;
|
||||
}
|
||||
|
||||
Converter.prototype.toJSON = function (space) {
|
||||
return JSON.stringify(this.sourcemap, null, space);
|
||||
};
|
||||
|
||||
Converter.prototype.toBase64 = function () {
|
||||
var json = this.toJSON();
|
||||
return SafeBuffer.Buffer.from(json, 'utf8').toString('base64');
|
||||
};
|
||||
|
||||
Converter.prototype.toComment = function (options) {
|
||||
var base64 = this.toBase64();
|
||||
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
|
||||
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
|
||||
};
|
||||
|
||||
// returns copy instead of original
|
||||
Converter.prototype.toObject = function () {
|
||||
return JSON.parse(this.toJSON());
|
||||
};
|
||||
|
||||
Converter.prototype.addProperty = function (key, value) {
|
||||
if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
|
||||
return this.setProperty(key, value);
|
||||
};
|
||||
|
||||
Converter.prototype.setProperty = function (key, value) {
|
||||
this.sourcemap[key] = value;
|
||||
return this;
|
||||
};
|
||||
|
||||
Converter.prototype.getProperty = function (key) {
|
||||
return this.sourcemap[key];
|
||||
};
|
||||
|
||||
exports.fromObject = function (obj) {
|
||||
return new Converter(obj);
|
||||
};
|
||||
|
||||
exports.fromJSON = function (json) {
|
||||
return new Converter(json, { isJSON: true });
|
||||
};
|
||||
|
||||
exports.fromBase64 = function (base64) {
|
||||
return new Converter(base64, { isEncoded: true });
|
||||
};
|
||||
|
||||
exports.fromComment = function (comment) {
|
||||
comment = comment
|
||||
.replace(/^\/\*/g, '//')
|
||||
.replace(/\*\/$/g, '');
|
||||
|
||||
return new Converter(comment, { isEncoded: true, hasComment: true });
|
||||
};
|
||||
|
||||
exports.fromMapFileComment = function (comment, dir) {
|
||||
return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });
|
||||
};
|
||||
|
||||
// Finds last sourcemap comment in file or returns null if none was found
|
||||
exports.fromSource = function (content) {
|
||||
var m = content.match(exports.commentRegex);
|
||||
return m ? exports.fromComment(m.pop()) : null;
|
||||
};
|
||||
|
||||
// Finds last sourcemap comment in file or returns null if none was found
|
||||
exports.fromMapFileSource = function (content, dir) {
|
||||
var m = content.match(exports.mapFileCommentRegex);
|
||||
return m ? exports.fromMapFileComment(m.pop(), dir) : null;
|
||||
};
|
||||
|
||||
exports.removeComments = function (src) {
|
||||
return src.replace(exports.commentRegex, '');
|
||||
};
|
||||
|
||||
exports.removeMapFileComments = function (src) {
|
||||
return src.replace(exports.mapFileCommentRegex, '');
|
||||
};
|
||||
|
||||
exports.generateMapFileComment = function (file, options) {
|
||||
var data = 'sourceMappingURL=' + file;
|
||||
return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
|
||||
};
|
44
web/node_modules/resolve-url-loader/node_modules/convert-source-map/package.json
generated
vendored
Normal file
44
web/node_modules/resolve-url-loader/node_modules/convert-source-map/package.json
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"name": "convert-source-map",
|
||||
"version": "1.7.0",
|
||||
"description": "Converts a source-map from/to different formats and allows adding/changing properties.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap test/*.js --color"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/thlorenz/convert-source-map.git"
|
||||
},
|
||||
"homepage": "https://github.com/thlorenz/convert-source-map",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"inline-source-map": "~0.6.2",
|
||||
"tap": "~9.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"convert",
|
||||
"sourcemap",
|
||||
"source",
|
||||
"map",
|
||||
"browser",
|
||||
"debug"
|
||||
],
|
||||
"author": {
|
||||
"name": "Thorsten Lorenz",
|
||||
"email": "thlorenz@gmx.de",
|
||||
"url": "http://thlorenz.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"engine": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"browser": {
|
||||
"fs": false
|
||||
}
|
||||
}
|
70
web/node_modules/resolve-url-loader/node_modules/emojis-list/CHANGELOG.md
generated
vendored
Normal file
70
web/node_modules/resolve-url-loader/node_modules/emojis-list/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
<a name="2.1.0"></a>
|
||||
# 2.1.0 (2016-10-03)
|
||||
|
||||
* Fetch new emoji ([7dbe84d](https://github.com/kikobeats/emojis-list/commit/7dbe84d))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## 2.0.1 (2016-05-12)
|
||||
|
||||
* Fix typo ([3808909](https://github.com/kikobeats/emojis-list/commit/3808909))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# 2.0.0 (2016-05-12)
|
||||
|
||||
* Add update script ([f846dd6](https://github.com/kikobeats/emojis-list/commit/f846dd6))
|
||||
* Block dependencies in last version ([1d9e0a5](https://github.com/kikobeats/emojis-list/commit/1d9e0a5))
|
||||
* Extract main file name ([9ffe7bb](https://github.com/kikobeats/emojis-list/commit/9ffe7bb))
|
||||
* Remove unnecessary files ([4c34729](https://github.com/kikobeats/emojis-list/commit/4c34729))
|
||||
* Update docs, special webpack setup is not necessary ([c4aefe9](https://github.com/kikobeats/emojis-list/commit/c4aefe9))
|
||||
* Update example ([1e2ae03](https://github.com/kikobeats/emojis-list/commit/1e2ae03))
|
||||
* Update how to generate emojis array ([b56bad9](https://github.com/kikobeats/emojis-list/commit/b56bad9))
|
||||
* Update main file based in the new interface ([996fccb](https://github.com/kikobeats/emojis-list/commit/996fccb))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
## 1.0.3 (2016-05-12)
|
||||
|
||||
* Add standard as linter ([5e939d6](https://github.com/kikobeats/emojis-list/commit/5e939d6))
|
||||
* Change interface ([16bc0c0](https://github.com/kikobeats/emojis-list/commit/16bc0c0))
|
||||
* Generate emoji file ([fbcf8e9](https://github.com/kikobeats/emojis-list/commit/fbcf8e9))
|
||||
* Remove unnecessary special doc ([2b12bec](https://github.com/kikobeats/emojis-list/commit/2b12bec))
|
||||
* chore(package): update browserify to version 13.0.1 ([e2c98bf](https://github.com/kikobeats/emojis-list/commit/e2c98bf))
|
||||
* chore(package): update gulp-header to version 1.8.1 ([28de793](https://github.com/kikobeats/emojis-list/commit/28de793))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## 1.0.2 (2016-05-05)
|
||||
|
||||
* fixed #2 ([9a6abe7](https://github.com/kikobeats/emojis-list/commit/9a6abe7)), closes [#2](https://github.com/kikobeats/emojis-list/issues/2)
|
||||
* Fomar using standard ([5202f9f](https://github.com/kikobeats/emojis-list/commit/5202f9f))
|
||||
* Update badge ([53fad9b](https://github.com/kikobeats/emojis-list/commit/53fad9b))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## 1.0.1 (2016-04-13)
|
||||
|
||||
* lock versions ([4a5d82e](https://github.com/kikobeats/emojis-list/commit/4a5d82e))
|
||||
* setup devDependencies ([d1de0fc](https://github.com/kikobeats/emojis-list/commit/d1de0fc))
|
||||
* update bumped ([9941038](https://github.com/kikobeats/emojis-list/commit/9941038))
|
||||
* Update package.json ([6c14b74](https://github.com/kikobeats/emojis-list/commit/6c14b74))
|
||||
* Update README.md ([1d9beeb](https://github.com/kikobeats/emojis-list/commit/1d9beeb))
|
||||
* Update README.md ([73f215e](https://github.com/kikobeats/emojis-list/commit/73f215e))
|
||||
* Update tests ([a94f7dc](https://github.com/kikobeats/emojis-list/commit/a94f7dc))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2015-05-12)
|
||||
|
||||
* first commit ([a65b79d](https://github.com/kikobeats/emojis-list/commit/a65b79d))
|
||||
* updated ([9f0564c](https://github.com/kikobeats/emojis-list/commit/9f0564c))
|
||||
|
||||
|
||||
|
9
web/node_modules/resolve-url-loader/node_modules/emojis-list/LICENSE.md
generated
vendored
Executable file
9
web/node_modules/resolve-url-loader/node_modules/emojis-list/LICENSE.md
generated
vendored
Executable file
|
@ -0,0 +1,9 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2015 Kiko Beats
|
||||
|
||||
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.
|
48
web/node_modules/resolve-url-loader/node_modules/emojis-list/README.md
generated
vendored
Executable file
48
web/node_modules/resolve-url-loader/node_modules/emojis-list/README.md
generated
vendored
Executable file
|
@ -0,0 +1,48 @@
|
|||
# emojis-list
|
||||
|
||||
[](https://david-dm.org/Kikobeats/emojis-list)
|
||||
[](https://david-dm.org/Kikobeats/emojis-list#info=devDependencies)
|
||||
[](https://www.npmjs.org/package/emojis-list)
|
||||
[](https://paypal.me/kikobeats)
|
||||
|
||||
> Complete list of standard Unicode Hex Character Code that represent emojis.
|
||||
|
||||
**NOTE**: The lists is related with the Unicode Hex Character Code. The representation of the emoji depend of the system. Will be possible that the system don't have all the representations.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install emojis-list --save
|
||||
```
|
||||
|
||||
If you want to use in the browser (powered by [Browserify](http://browserify.org/)):
|
||||
|
||||
```bash
|
||||
bower install emojis-list --save
|
||||
```
|
||||
|
||||
and later link in your HTML:
|
||||
|
||||
```html
|
||||
<script src="bower_components/emojis-list/dist/emojis-list.js"></script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
var emojis = require('emojis-list');
|
||||
console.log(emojis[0]);
|
||||
// => 🀄
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
* [emojis-unicode](https://github.com/Kikobeats/emojis-unicode) – Complete list of standard Unicode codes that represent emojis.
|
||||
* [emojis-keywords](https://github.com/Kikobeats/emojis-keywords) – Complete list of am emoji shortcuts.
|
||||
* [is-emoji-keyword](https://github.com/Kikobeats/is-emoji-keyword) – Check if a word is a emoji shortcut.
|
||||
* [is-standard-emoji](https://github.com/kikobeats/is-standard-emoji) – Simply way to check if a emoji is a standard emoji.
|
||||
* [trim-emoji](https://github.com/Kikobeats/trim-emoji) – Deletes ':' from the begin and the end of an emoji shortcut.
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kiko Beats](http://www.kikobeats.com)
|
2479
web/node_modules/resolve-url-loader/node_modules/emojis-list/index.js
generated
vendored
Normal file
2479
web/node_modules/resolve-url-loader/node_modules/emojis-list/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
51
web/node_modules/resolve-url-loader/node_modules/emojis-list/package.json
generated
vendored
Normal file
51
web/node_modules/resolve-url-loader/node_modules/emojis-list/package.json
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": "emojis-list",
|
||||
"description": "Complete list of standard emojis.",
|
||||
"homepage": "https://github.com/Kikobeats/emojis-list",
|
||||
"version": "2.1.0",
|
||||
"main": "./index.js",
|
||||
"author": {
|
||||
"email": "josefrancisco.verdu@gmail.com",
|
||||
"name": "Kiko Beats",
|
||||
"url": "https://github.com/Kikobeats"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kikobeats/emojis-list.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Kikobeats/emojis-list/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"archive",
|
||||
"complete",
|
||||
"emoji",
|
||||
"list",
|
||||
"standard"
|
||||
],
|
||||
"devDependencies": {
|
||||
"acho": "latest",
|
||||
"browserify": "latest",
|
||||
"cheerio": "latest",
|
||||
"got": ">=5 <6",
|
||||
"gulp": "latest",
|
||||
"gulp-header": "latest",
|
||||
"gulp-uglify": "latest",
|
||||
"gulp-util": "latest",
|
||||
"standard": "latest",
|
||||
"vinyl-buffer": "latest",
|
||||
"vinyl-source-stream": "latest"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"pretest": "standard update.js",
|
||||
"test": "echo 'YOLO'",
|
||||
"update": "node update"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
274
web/node_modules/resolve-url-loader/node_modules/json5/CHANGELOG.md
generated
vendored
Normal file
274
web/node_modules/resolve-url-loader/node_modules/json5/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,274 @@
|
|||
### v1.0.1 [[code][c1.0.1], [diff][d1.0.1]]
|
||||
|
||||
[c1.0.1]: https://github.com/json5/json5/tree/v1.0.1
|
||||
[d1.0.1]: https://github.com/json5/json5/compare/v1.0.0...v1.0.1
|
||||
|
||||
This release includes a bug fix and minor change.
|
||||
|
||||
- Fix: `parse` throws on unclosed objects and arrays.
|
||||
|
||||
- New: `package.json5` has been removed until an easier way to keep it in sync
|
||||
with `package.json` is found.
|
||||
|
||||
|
||||
### v1.0.0 [[code][c1.0.0], [diff][d1.0.0]]
|
||||
|
||||
[c1.0.0]: https://github.com/json5/json5/tree/v1.0.0
|
||||
[d1.0.0]: https://github.com/json5/json5/compare/v0.5.1...v1.0.0
|
||||
|
||||
This release includes major internal changes and public API enhancements.
|
||||
|
||||
- **Major** JSON5 officially supports Node.js v4 and later. Support for Node.js
|
||||
v0.10 and v0.12 have been dropped.
|
||||
|
||||
- New: Unicode property names and Unicode escapes in property names are
|
||||
supported. ([#1])
|
||||
|
||||
- New: `stringify` outputs trailing commas in objects and arrays when a `space`
|
||||
option is provided. ([#66])
|
||||
|
||||
- New: JSON5 allows line and paragraph separator characters (U+2028 and U+2029)
|
||||
in strings in order to be compatible with JSON. However, ES5 does not allow
|
||||
these characters in strings, so JSON5 gives a warning when they are parsed and
|
||||
escapes them when they are stringified. ([#70])
|
||||
|
||||
- New: `stringify` accepts an options object as its second argument. The
|
||||
supported options are `replacer`, `space`, and a new `quote` option that
|
||||
specifies the quote character used in strings. ([#71])
|
||||
|
||||
- New: The CLI supports STDIN and STDOUT and adds `--out-file`, `--space`, and
|
||||
`--validate` options. See `json5 --help` for more information. ([#72], [#84],
|
||||
and [#108])
|
||||
|
||||
- New: In addition to the white space characters space `\t`, `\v`, `\f`, `\n`,
|
||||
`\r`, and `\xA0`, the additional white space characters `\u2028`, `\u2029`,
|
||||
and all other characters in the Space Separator Unicode category are allowed.
|
||||
|
||||
- New: In addition to the character escapes `\'`, `\"`, `\\`, `\b`, `\f`, `\n`,
|
||||
`\r`, and `\t`, the additional character escapes `\v` and `\0`, hexadecimal
|
||||
escapes like `\x0F`, and unnecessary escapes like `\a` are allowed in string
|
||||
values and string property names.
|
||||
|
||||
- New: `stringify` outputs strings with single quotes by default but
|
||||
intelligently uses double quotes if there are more single quotes than double
|
||||
quotes inside the string. (i.e. `stringify('Stay here.')` outputs
|
||||
`'Stay here.'` while `stringify('Let\'s go.')` outputs `"Let's go."`)
|
||||
|
||||
- New: When a character is not allowed in a string, `stringify` outputs a
|
||||
character escape like `\t` when available, a hexadecimal escape like `\x0F`
|
||||
when the Unicode code point is less than 256, or a Unicode character escape
|
||||
like `\u01FF`, in that order.
|
||||
|
||||
- New: `stringify` checks for a `toJSON5` method on objects and, if it exists,
|
||||
stringifies its return value instead of the object. `toJSON5` overrides
|
||||
`toJSON` if they both exist.
|
||||
|
||||
- New: To `require` or `import` JSON5 files, use `require('json5/lib/register')`
|
||||
or `import 'json5/lib/register'`. Previous versions used `json5/lib/require`,
|
||||
which still exists for backward compatibility but is deprecated and will give
|
||||
a warning.
|
||||
|
||||
- New: To use JSON5 in browsers, use the file at `dist/index.js` or
|
||||
`https://unpkg.com/json5@^1.0.0`.
|
||||
|
||||
- Fix: `stringify` properly outputs `Infinity` and `NaN`. ([#67])
|
||||
|
||||
- Fix: `isWord` no longer becomes a property of `JSON5` after calling
|
||||
`stringify`. ([#68] and [#89])
|
||||
|
||||
- Fix: `stringify` no longer throws when an object does not have a `prototype`.
|
||||
([#154])
|
||||
|
||||
- Fix: `stringify` properly handles the `key` argument of `toJSON(key)` methods.
|
||||
`toJSON5(key)` follows this pattern.
|
||||
|
||||
- Fix: `stringify` accepts `Number` and `String` objects as its `space`
|
||||
argument.
|
||||
|
||||
- Fix: In addition to a function, `stringify` also accepts an array of keys to
|
||||
include in the output as its `replacer` argument. Numbers, `Number` objects,
|
||||
and `String` objects will be converted to a string if they are given as array
|
||||
values.
|
||||
|
||||
|
||||
### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]]
|
||||
|
||||
[c0.5.1]: https://github.com/json5/json5/tree/v0.5.1
|
||||
[d0.5.1]: https://github.com/json5/json5/compare/v0.5.0...v0.5.1
|
||||
|
||||
This release includes a minor fix for indentations when stringifying empty
|
||||
arrays.
|
||||
|
||||
- Fix: Indents no longer appear in empty arrays when stringified. ([#134])
|
||||
|
||||
|
||||
### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]]
|
||||
|
||||
[c0.5.0]: https://github.com/json5/json5/tree/v0.5.0
|
||||
[d0.5.0]: https://github.com/json5/json5/compare/v0.4.0...v0.5.0
|
||||
|
||||
This release includes major internal changes and public API enhancements.
|
||||
|
||||
- **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for
|
||||
Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12
|
||||
remain.
|
||||
|
||||
- Fix: YUI Compressor no longer fails when compressing json5.js. ([#97])
|
||||
|
||||
- New: `parse` and the CLI provide line and column numbers when displaying error
|
||||
messages. ([#101]; awesome work by [@amb26].)
|
||||
|
||||
|
||||
### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]]
|
||||
|
||||
[c0.4.0]: https://github.com/json5/json5/tree/v0.4.0
|
||||
[d0.4.0]: https://github.com/json5/json5/compare/v0.2.0...v0.4.0
|
||||
|
||||
Note that v0.3.0 was tagged, but never published to npm, so this v0.4.0
|
||||
changelog entry includes v0.3.0 features.
|
||||
|
||||
This is a massive release that adds `stringify` support, among other things.
|
||||
|
||||
- **Major:** `JSON5.stringify()` now exists!
|
||||
This method is analogous to the native `JSON.stringify()`;
|
||||
it just avoids quoting keys where possible.
|
||||
See the [usage documentation](./README.md#usage) for more.
|
||||
([#32]; huge thanks and props [@aeisenberg]!)
|
||||
|
||||
- New: `NaN` and `-NaN` are now allowed number literals.
|
||||
([#30]; thanks [@rowanhill].)
|
||||
|
||||
- New: Duplicate object keys are now allowed; the last value is used.
|
||||
This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].)
|
||||
|
||||
- Fix: Properly handle various whitespace and newline cases now.
|
||||
E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings,
|
||||
and JSON5 now accepts the same whitespace as JSON (stricter than ES5).
|
||||
([#58], [#60], and [#63]; thanks [@jordanbtucker].)
|
||||
|
||||
- New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again.
|
||||
(They were disallowed in v0.2.0; see below.)
|
||||
It turns out they *are* valid in ES5, so JSON5 supports them now too.
|
||||
([#36]; thanks [@jordanbtucker]!)
|
||||
|
||||
|
||||
### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]]
|
||||
|
||||
[c0.2.0]: https://github.com/json5/json5/tree/v0.2.0
|
||||
[d0.2.0]: https://github.com/json5/json5/compare/v0.1.0...v0.2.0
|
||||
|
||||
This release fixes some bugs and adds some more utility features to help you
|
||||
express data more easily:
|
||||
|
||||
- **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now.
|
||||
While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid
|
||||
in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome
|
||||
and Node), so JSON5 officially rejects them now, too. ([#36])
|
||||
|
||||
- New: Trailing decimal points in decimal numbers are allowed again.
|
||||
(They were disallowed in v0.1.0; see below.)
|
||||
They're allowed by ES5, and differentiating between integers and floats may
|
||||
make sense on some platforms. ([#16]; thanks [@Midar].)
|
||||
|
||||
- New: `Infinity` and `-Infinity` are now allowed number literals.
|
||||
([#30]; thanks [@pepkin88].)
|
||||
|
||||
- New: Plus signs (`+`) in front of numbers are now allowed, since it can
|
||||
be helpful in some contexts to explicitly mark numbers as positive.
|
||||
(E.g. when a property represents changes or deltas.)
|
||||
|
||||
- Fix: unescaped newlines in strings are rejected now.
|
||||
([#24]; thanks [@Midar].)
|
||||
|
||||
|
||||
### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]]
|
||||
|
||||
[c0.1.0]: https://github.com/json5/json5/tree/v0.1.0
|
||||
[d0.1.0]: https://github.com/json5/json5/compare/v0.0.1...v0.1.0
|
||||
|
||||
This release tightens JSON5 support and adds helpful utility features:
|
||||
|
||||
- New: Support hexadecimal numbers. (Thanks [@MaxNanasy].)
|
||||
|
||||
- Fix: Reject octal numbers properly now. Previously, they were accepted but
|
||||
improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].)
|
||||
|
||||
- **Breaking:** Reject "noctal" numbers now (base-10 numbers that begin with a
|
||||
leading zero). These are disallowed by both JSON5 and JSON, as well as by
|
||||
ES5's strict mode. (Thanks [@MaxNanasy].)
|
||||
|
||||
- New: Support leading decimal points in decimal numbers.
|
||||
(Thanks [@MaxNanasy].)
|
||||
|
||||
- **Breaking:** Reject trailing decimal points in decimal numbers now. These
|
||||
are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].)
|
||||
|
||||
- **Breaking:** Reject omitted elements in arrays now. These are disallowed by
|
||||
both JSON5 and JSON.
|
||||
|
||||
- Fix: Throw proper `SyntaxError` instances on errors now.
|
||||
|
||||
- New: Add Node.js `require()` hook. Register via `json5/lib/require`.
|
||||
|
||||
- New: Add Node.js `json5` executable to compile JSON5 files to JSON.
|
||||
|
||||
|
||||
### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]]
|
||||
|
||||
[c0.0.1]: https://github.com/json5/json5/tree/v0.0.1
|
||||
[d0.0.1]: https://github.com/json5/json5/compare/v0.0.0...v0.0.1
|
||||
|
||||
This was the first implementation of this JSON5 parser.
|
||||
|
||||
- Support unquoted object keys, including reserved words. Unicode characters
|
||||
and escape sequences sequences aren't yet supported.
|
||||
|
||||
- Support single-quoted strings.
|
||||
|
||||
- Support multi-line strings.
|
||||
|
||||
- Support trailing commas in arrays and objects.
|
||||
|
||||
- Support comments, both inline and block.
|
||||
|
||||
|
||||
### v0.0.0 [[code](https://github.com/json5/json5/tree/v0.0.0)]
|
||||
|
||||
Let's consider this to be Douglas Crockford's original [json_parse.js] — a
|
||||
parser for the regular JSON format.
|
||||
|
||||
|
||||
[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
|
||||
[v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240
|
||||
|
||||
[@MaxNanasy]: https://github.com/MaxNanasy
|
||||
[@Midar]: https://github.com/Midar
|
||||
[@pepkin88]: https://github.com/pepkin88
|
||||
[@rowanhill]: https://github.com/rowanhill
|
||||
[@aeisenberg]: https://github.com/aeisenberg
|
||||
[@jordanbtucker]: https://github.com/jordanbtucker
|
||||
[@amb26]: https://github.com/amb26
|
||||
|
||||
[#1]: https://github.com/json5/json5/issues/1
|
||||
[#16]: https://github.com/json5/json5/issues/16
|
||||
[#24]: https://github.com/json5/json5/issues/24
|
||||
[#30]: https://github.com/json5/json5/issues/30
|
||||
[#32]: https://github.com/json5/json5/issues/32
|
||||
[#36]: https://github.com/json5/json5/issues/36
|
||||
[#57]: https://github.com/json5/json5/issues/57
|
||||
[#58]: https://github.com/json5/json5/pull/58
|
||||
[#60]: https://github.com/json5/json5/pull/60
|
||||
[#63]: https://github.com/json5/json5/pull/63
|
||||
[#66]: https://github.com/json5/json5/issues/66
|
||||
[#67]: https://github.com/json5/json5/issues/67
|
||||
[#68]: https://github.com/json5/json5/issues/68
|
||||
[#70]: https://github.com/json5/json5/issues/70
|
||||
[#71]: https://github.com/json5/json5/issues/71
|
||||
[#72]: https://github.com/json5/json5/issues/72
|
||||
[#84]: https://github.com/json5/json5/pull/84
|
||||
[#89]: https://github.com/json5/json5/pull/89
|
||||
[#97]: https://github.com/json5/json5/pull/97
|
||||
[#101]: https://github.com/json5/json5/pull/101
|
||||
[#108]: https://github.com/json5/json5/pull/108
|
||||
[#134]: https://github.com/json5/json5/pull/134
|
||||
[#154]: https://github.com/json5/json5/issues/154
|
23
web/node_modules/resolve-url-loader/node_modules/json5/LICENSE.md
generated
vendored
Normal file
23
web/node_modules/resolve-url-loader/node_modules/json5/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2012-2018 Aseem Kishore, and [others].
|
||||
|
||||
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.
|
||||
|
||||
[others]: https://github.com/json5/json5/contributors
|
234
web/node_modules/resolve-url-loader/node_modules/json5/README.md
generated
vendored
Normal file
234
web/node_modules/resolve-url-loader/node_modules/json5/README.md
generated
vendored
Normal file
|
@ -0,0 +1,234 @@
|
|||
# JSON5 – JSON for Humans
|
||||
|
||||
[][Build Status]
|
||||
[][Coverage
|
||||
Status]
|
||||
|
||||
The JSON5 Data Interchange Format (JSON5) is a superset of [JSON] that aims to
|
||||
alleviate some of the limitations of JSON by expanding its syntax to include
|
||||
some productions from [ECMAScript 5.1].
|
||||
|
||||
This JavaScript library is the official reference implementation for JSON5
|
||||
parsing and serialization libraries.
|
||||
|
||||
[Build Status]: https://travis-ci.org/json5/json5
|
||||
|
||||
[Coverage Status]: https://coveralls.io/github/json5/json5
|
||||
|
||||
[JSON]: https://tools.ietf.org/html/rfc7159
|
||||
|
||||
[ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/
|
||||
|
||||
## Summary of Features
|
||||
The following ECMAScript 5.1 features, which are not supported in JSON, have
|
||||
been extended to JSON5.
|
||||
|
||||
### Objects
|
||||
- Object keys may be an ECMAScript 5.1 _[IdentifierName]_.
|
||||
- Objects may have a single trailing comma.
|
||||
|
||||
### Arrays
|
||||
- Arrays may have a single trailing comma.
|
||||
|
||||
### Strings
|
||||
- Strings may be single quoted.
|
||||
- Strings may span multiple lines by escaping new line characters.
|
||||
- Strings may include character escapes.
|
||||
|
||||
### Numbers
|
||||
- Numbers may be hexadecimal.
|
||||
- Numbers may have a leading or trailing decimal point.
|
||||
- Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN.
|
||||
- Numbers may begin with an explicit plus sign.
|
||||
|
||||
### Comments
|
||||
- Single and multi-line comments are allowed.
|
||||
|
||||
### White Space
|
||||
- Additional white space characters are allowed.
|
||||
|
||||
[IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6
|
||||
|
||||
[IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933
|
||||
|
||||
## Short Example
|
||||
```js
|
||||
{
|
||||
// comments
|
||||
unquoted: 'and you can quote me on that',
|
||||
singleQuotes: 'I can use "double quotes" here',
|
||||
lineBreaks: "Look, Mom! \
|
||||
No \\n's!",
|
||||
hexadecimal: 0xdecaf,
|
||||
leadingDecimalPoint: .8675309, andTrailing: 8675309.,
|
||||
positiveSign: +1,
|
||||
trailingComma: 'in objects', andIn: ['arrays',],
|
||||
"backwardsCompatible": "with JSON",
|
||||
}
|
||||
```
|
||||
|
||||
## Specification
|
||||
For a detailed explanation of the JSON5 format, please read the [official
|
||||
specification](https://json5.github.io/json5-spec/).
|
||||
|
||||
## Installation
|
||||
### Node.js
|
||||
```sh
|
||||
npm install json5
|
||||
```
|
||||
|
||||
```js
|
||||
const JSON5 = require('json5')
|
||||
```
|
||||
|
||||
### Browsers
|
||||
```html
|
||||
<script src="https://unpkg.com/json5@^1.0.0"></script>
|
||||
```
|
||||
|
||||
This will create a global `JSON5` variable.
|
||||
|
||||
## API
|
||||
The JSON5 API is compatible with the [JSON API].
|
||||
|
||||
[JSON API]:
|
||||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
|
||||
|
||||
### JSON5.parse()
|
||||
Parses a JSON5 string, constructing the JavaScript value or object described by
|
||||
the string. An optional reviver function can be provided to perform a
|
||||
transformation on the resulting object before it is returned.
|
||||
|
||||
#### Syntax
|
||||
JSON5.parse(text[, reviver])
|
||||
|
||||
#### Parameters
|
||||
- `text`: The string to parse as JSON5.
|
||||
- `reviver`: If a function, this prescribes how the value originally produced by
|
||||
parsing is transformed, before being returned.
|
||||
|
||||
#### Return value
|
||||
The object corresponding to the given JSON5 text.
|
||||
|
||||
### JSON5.stringify()
|
||||
Converts a JavaScript value to a JSON5 string, optionally replacing values if a
|
||||
replacer function is specified, or optionally including only the specified
|
||||
properties if a replacer array is specified.
|
||||
|
||||
#### Syntax
|
||||
JSON5.stringify(value[, replacer[, space]])
|
||||
JSON5.stringify(value[, options])
|
||||
|
||||
#### Parameters
|
||||
- `value`: The value to convert to a JSON5 string.
|
||||
- `replacer`: A function that alters the behavior of the stringification
|
||||
process, or an array of String and Number objects that serve as a whitelist
|
||||
for selecting/filtering the properties of the value object to be included in
|
||||
the JSON5 string. If this value is null or not provided, all properties of the
|
||||
object are included in the resulting JSON5 string.
|
||||
- `space`: A String or Number object that's used to insert white space into the
|
||||
output JSON5 string for readability purposes. If this is a Number, it
|
||||
indicates the number of space characters to use as white space; this number is
|
||||
capped at 10 (if it is greater, the value is just 10). Values less than 1
|
||||
indicate that no space should be used. If this is a String, the string (or the
|
||||
first 10 characters of the string, if it's longer than that) is used as white
|
||||
space. If this parameter is not provided (or is null), no white space is used.
|
||||
If white space is used, trailing commas will be used in objects and arrays.
|
||||
- `options`: An object with the following properties:
|
||||
- `replacer`: Same as the `replacer` parameter.
|
||||
- `space`: Same as the `space` parameter.
|
||||
- `quote`: A String representing the quote character to use when serializing
|
||||
strings.
|
||||
|
||||
#### Return value
|
||||
A JSON5 string representing the value.
|
||||
|
||||
### Node.js `require()` JSON5 files
|
||||
When using Node.js, you can `require()` JSON5 files by adding the following
|
||||
statement.
|
||||
|
||||
```js
|
||||
require('json5/lib/register')
|
||||
```
|
||||
|
||||
Then you can load a JSON5 file with a Node.js `require()` statement. For
|
||||
example:
|
||||
|
||||
```js
|
||||
const config = require('./config.json5')
|
||||
```
|
||||
|
||||
## CLI
|
||||
Since JSON is more widely used than JSON5, this package includes a CLI for
|
||||
converting JSON5 to JSON and for validating the syntax of JSON5 documents.
|
||||
|
||||
### Installation
|
||||
```sh
|
||||
npm install --global json5
|
||||
```
|
||||
|
||||
### Usage
|
||||
```sh
|
||||
json5 [options] <file>
|
||||
```
|
||||
|
||||
If `<file>` is not provided, then STDIN is used.
|
||||
|
||||
#### Options:
|
||||
- `-s`, `--space`: The number of spaces to indent or `t` for tabs
|
||||
- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT
|
||||
- `-v`, `--validate`: Validate JSON5 but do not output JSON
|
||||
- `-V`, `--version`: Output the version number
|
||||
- `-h`, `--help`: Output usage information
|
||||
|
||||
## Contibuting
|
||||
### Development
|
||||
```sh
|
||||
git clone https://github.com/json5/json5
|
||||
cd json5
|
||||
npm install
|
||||
```
|
||||
|
||||
When contributing code, please write relevant tests and run `npm test` and `npm
|
||||
run lint` before submitting pull requests. Please use an editor that supports
|
||||
[EditorConfig](http://editorconfig.org/).
|
||||
|
||||
### Issues
|
||||
To report bugs or request features regarding the JSON5 data format, please
|
||||
submit an issue to the [official specification
|
||||
repository](https://github.com/json5/json5-spec).
|
||||
|
||||
To report bugs or request features regarding the JavaScript implentation of
|
||||
JSON5, please submit an issue to this repository.
|
||||
|
||||
## License
|
||||
MIT. See [LICENSE.md](./LICENSE.md) for details.
|
||||
|
||||
## Credits
|
||||
[Assem Kishore](https://github.com/aseemk) founded this project.
|
||||
|
||||
[Michael Bolin](http://bolinfest.com/) independently arrived at and published
|
||||
some of these same ideas with awesome explanations and detail. Recommended
|
||||
reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html)
|
||||
|
||||
[Douglas Crockford](http://www.crockford.com/) of course designed and built
|
||||
JSON, but his state machine diagrams on the [JSON website](http://json.org/), as
|
||||
cheesy as it may sound, gave us motivation and confidence that building a new
|
||||
parser to implement these ideas was within reach! The original
|
||||
implementation of JSON5 was also modeled directly off of Doug’s open-source
|
||||
[json_parse.js] parser. We’re grateful for that clean and well-documented
|
||||
code.
|
||||
|
||||
[json_parse.js]:
|
||||
https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
|
||||
|
||||
[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific
|
||||
supporter, contributing multiple patches and ideas.
|
||||
|
||||
[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original
|
||||
`stringify` method.
|
||||
|
||||
[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely
|
||||
with ES5, wrote the official JSON5 specification, completely rewrote the
|
||||
codebase from the ground up, and is actively maintaining this project.
|
1
web/node_modules/resolve-url-loader/node_modules/json5/dist/index.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/dist/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
web/node_modules/resolve-url-loader/node_modules/json5/lib/cli.js
generated
vendored
Executable file
2
web/node_modules/resolve-url-loader/node_modules/json5/lib/cli.js
generated
vendored
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';var _fs=require('fs');var _fs2=_interopRequireDefault(_fs);var _path=require('path');var _path2=_interopRequireDefault(_path);var _minimist=require('minimist');var _minimist2=_interopRequireDefault(_minimist);var _package=require('../package.json');var _package2=_interopRequireDefault(_package);var _=require('./');var _2=_interopRequireDefault(_);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var argv=(0,_minimist2.default)(process.argv.slice(2),{alias:{'convert':'c','space':'s','validate':'v','out-file':'o','version':'V','help':'h'},boolean:['convert','validate','version','help'],string:['space','out-file']});if(argv.version){version()}else if(argv.help){usage()}else{var inFilename=argv._[0];var readStream=void 0;if(inFilename){readStream=_fs2.default.createReadStream(inFilename)}else{readStream=process.stdin}var json5='';readStream.on('data',function(data){json5+=data});readStream.on('end',function(){var space=void 0;if(argv.space==='t'||argv.space==='tab'){space='\t'}else{space=Number(argv.space)}var value=void 0;try{value=_2.default.parse(json5);if(!argv.validate){var json=JSON.stringify(value,null,space);var writeStream=void 0;if(argv.convert&&inFilename&&!argv.o){var parsedFilename=_path2.default.parse(inFilename);var outFilename=_path2.default.format(Object.assign(parsedFilename,{base:_path2.default.basename(parsedFilename.base,parsedFilename.ext)+'.json'}));writeStream=_fs2.default.createWriteStream(outFilename)}else if(argv.o){writeStream=_fs2.default.createWriteStream(argv.o)}else{writeStream=process.stdout}writeStream.write(json)}}catch(err){console.error(err.message);process.exit(1)}})}function version(){console.log(_package2.default.version)}function usage(){console.log('\n Usage: json5 [options] <file>\n\n If <file> is not provided, then STDIN is used.\n\n Options:\n\n -s, --space The number of spaces to indent or \'t\' for tabs\n -o, --out-file [file] Output to the specified file, otherwise STDOUT\n -v, --validate Validate JSON5 but do not output JSON\n -V, --version Output the version number\n -h, --help Output usage information')}
|
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/index.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _parse=require('./parse');var _parse2=_interopRequireDefault(_parse);var _stringify=require('./stringify');var _stringify2=_interopRequireDefault(_stringify);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={parse:_parse2.default,stringify:_stringify2.default};module.exports=exports['default'];
|
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/parse.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/parse.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/register.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/register.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';var _fs=require('fs');var _fs2=_interopRequireDefault(_fs);var _=require('./');var _2=_interopRequireDefault(_);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}require.extensions['.json5']=function(module,filename){var content=_fs2.default.readFileSync(filename,'utf8');try{module.exports=_2.default.parse(content)}catch(err){err.message=filename+': '+err.message;throw err}};
|
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/require.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/require.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
"use strict";require("./register");console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.");
|
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/stringify.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/stringify.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/unicode.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/unicode.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/util.js
generated
vendored
Normal file
1
web/node_modules/resolve-url-loader/node_modules/json5/lib/util.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';Object.defineProperty(exports,'__esModule',{value:true});exports.isSpaceSeparator=isSpaceSeparator;exports.isIdStartChar=isIdStartChar;exports.isIdContinueChar=isIdContinueChar;exports.isDigit=isDigit;exports.isHexDigit=isHexDigit;var _unicode=require('../lib/unicode');var unicode=_interopRequireWildcard(_unicode);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function isSpaceSeparator(c){return unicode.Space_Separator.test(c)}function isIdStartChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c==='$'||c==='_'||unicode.ID_Start.test(c)}function isIdContinueChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c>='0'&&c<='9'||c==='$'||c==='_'||c==='\u200C'||c==='\u200D'||unicode.ID_Continue.test(c)}function isDigit(c){return /[0-9]/.test(c)}function isHexDigit(c){return /[0-9A-Fa-f]/.test(c)}
|
76
web/node_modules/resolve-url-loader/node_modules/json5/package.json
generated
vendored
Normal file
76
web/node_modules/resolve-url-loader/node_modules/json5/package.json
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"name": "json5",
|
||||
"version": "1.0.1",
|
||||
"description": "JSON for humans.",
|
||||
"main": "lib/index.js",
|
||||
"bin": "lib/cli.js",
|
||||
"browser": "dist/index.js",
|
||||
"files": [
|
||||
"lib/",
|
||||
"dist/"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "babel-node build/build.js && babel src -d lib && rollup -c",
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"lint": "eslint --fix build src",
|
||||
"prepublishOnly": "npm run lint && npm test && npm run production",
|
||||
"pretest": "cross-env NODE_ENV=test npm run build",
|
||||
"preversion": "npm run lint && npm test && npm run production",
|
||||
"production": "cross-env NODE_ENV=production npm run build",
|
||||
"test": "nyc --reporter=html --reporter=text mocha"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/json5/json5.git"
|
||||
},
|
||||
"keywords": [
|
||||
"json",
|
||||
"json5",
|
||||
"es5",
|
||||
"es2015",
|
||||
"ecmascript"
|
||||
],
|
||||
"author": "Aseem Kishore <aseem.kishore@gmail.com>",
|
||||
"contributors": [
|
||||
"Max Nanasy <max.nanasy@gmail.com>",
|
||||
"Andrew Eisenberg <andrew@eisenberg.as>",
|
||||
"Jordan Tucker <jordanbtucker@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/json5/json5/issues"
|
||||
},
|
||||
"homepage": "http://json5.org/",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-plugin-external-helpers": "^6.22.0",
|
||||
"babel-plugin-istanbul": "^4.1.5",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-register": "^6.26.0",
|
||||
"babelrc-rollup": "^3.0.0",
|
||||
"coveralls": "^3.0.0",
|
||||
"cross-env": "^5.1.4",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^4.18.2",
|
||||
"eslint-config-standard": "^11.0.0",
|
||||
"eslint-plugin-import": "^2.9.0",
|
||||
"eslint-plugin-node": "^6.0.1",
|
||||
"eslint-plugin-promise": "^3.7.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"mocha": "^5.0.4",
|
||||
"nyc": "^11.4.1",
|
||||
"regenerate": "^1.3.3",
|
||||
"rollup": "^0.56.5",
|
||||
"rollup-plugin-babel": "^3.0.3",
|
||||
"rollup-plugin-commonjs": "^9.0.0",
|
||||
"rollup-plugin-node-resolve": "^3.2.0",
|
||||
"rollup-plugin-uglify": "^3.0.0",
|
||||
"sinon": "^4.4.2",
|
||||
"unicode-9.0.0": "^0.7.5"
|
||||
}
|
||||
}
|
67
web/node_modules/resolve-url-loader/node_modules/loader-utils/CHANGELOG.md
generated
vendored
Normal file
67
web/node_modules/resolve-url-loader/node_modules/loader-utils/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="1.2.3"></a>
|
||||
## [1.2.3](https://github.com/webpack/loader-utils/compare/v1.2.2...v1.2.3) (2018-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **interpolateName:** don't interpolated `hashType` without `hash` or `contenthash` ([#140](https://github.com/webpack/loader-utils/issues/140)) ([3528fd9](https://github.com/webpack/loader-utils/commit/3528fd9))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.2"></a>
|
||||
## [1.2.2](https://github.com/webpack/loader-utils/compare/v1.2.1...v1.2.2) (2018-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixed a hash type extracting in interpolateName ([#137](https://github.com/webpack/loader-utils/issues/137)) ([f8a71f4](https://github.com/webpack/loader-utils/commit/f8a71f4))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.1"></a>
|
||||
## [1.2.1](https://github.com/webpack/loader-utils/compare/v1.2.0...v1.2.1) (2018-12-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **isUrlRequest:** better handle absolute urls and non standards ([#134](https://github.com/webpack/loader-utils/issues/134)) ([aca43da](https://github.com/webpack/loader-utils/commit/aca43da))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* PR [#79](https://github.com/webpack/loader-utils/issues/79) ([#135](https://github.com/webpack/loader-utils/issues/135)) ([73d350a](https://github.com/webpack/loader-utils/commit/73d350a))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.0"></a>
|
||||
# [1.2.0](https://github.com/webpack/loader-utils/compare/v1.1.0...v1.2.0) (2018-12-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **interpolateName:** support `[contenthash]`
|
||||
|
||||
### Fixes
|
||||
|
||||
* **urlToRequest:** empty urls are not rewritten to relative requests
|
||||
* **urlToRequest:** don't rewrite absolute urls
|
||||
* **isUrlRequest:** ignore all url with `extension` (like `moz-extension:`, `ms-browser-extension:` and etc)
|
||||
* **isUrlRequest:** ignore `about:blank`
|
||||
* **interpolateName:** failing explicitly when ran out of emoji
|
||||
* **interpolateName:** `[hash]` token regex in interpolate string to capture any hash algorithm name
|
||||
* **interpolateName:** parse string for emoji count before use
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/webpack/loader-utils/compare/v1.0.4...v1.1.0) (2017-03-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **automatic-release:** Generation of automatic release ([7484d13](https://github.com/webpack/loader-utils/commit/7484d13))
|
||||
* **parseQuery:** export parseQuery ([ddf64e4](https://github.com/webpack/loader-utils/commit/ddf64e4))
|
20
web/node_modules/resolve-url-loader/node_modules/loader-utils/LICENSE
generated
vendored
Normal file
20
web/node_modules/resolve-url-loader/node_modules/loader-utils/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
Copyright JS Foundation and other contributors
|
||||
|
||||
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.
|
255
web/node_modules/resolve-url-loader/node_modules/loader-utils/README.md
generated
vendored
Normal file
255
web/node_modules/resolve-url-loader/node_modules/loader-utils/README.md
generated
vendored
Normal file
|
@ -0,0 +1,255 @@
|
|||
# loader-utils
|
||||
|
||||
## Methods
|
||||
|
||||
### `getOptions`
|
||||
|
||||
Recommended way to retrieve the options of a loader invocation:
|
||||
|
||||
```javascript
|
||||
// inside your loader
|
||||
const options = loaderUtils.getOptions(this);
|
||||
```
|
||||
|
||||
1. If `this.query` is a string:
|
||||
- Tries to parse the query string and returns a new object
|
||||
- Throws if it's not a valid query string
|
||||
2. If `this.query` is object-like, it just returns `this.query`
|
||||
3. In any other case, it just returns `null`
|
||||
|
||||
**Please note:** The returned `options` object is *read-only*. It may be re-used across multiple invocations.
|
||||
If you pass it on to another library, make sure to make a *deep copy* of it:
|
||||
|
||||
```javascript
|
||||
const options = Object.assign(
|
||||
{},
|
||||
defaultOptions,
|
||||
loaderUtils.getOptions(this) // it is safe to pass null to Object.assign()
|
||||
);
|
||||
// don't forget nested objects or arrays
|
||||
options.obj = Object.assign({}, options.obj);
|
||||
options.arr = options.arr.slice();
|
||||
someLibrary(options);
|
||||
```
|
||||
|
||||
[clone](https://www.npmjs.com/package/clone) is a good library to make a deep copy of the options.
|
||||
|
||||
#### Options as query strings
|
||||
|
||||
If the loader options have been passed as loader query string (`loader?some¶ms`), the string is parsed by using [`parseQuery`](#parsequery).
|
||||
|
||||
### `parseQuery`
|
||||
|
||||
Parses a passed string (e.g. `loaderContext.resourceQuery`) as a query string, and returns an object.
|
||||
|
||||
``` javascript
|
||||
const params = loaderUtils.parseQuery(this.resourceQuery); // resource: `file?param1=foo`
|
||||
if (params.param1 === "foo") {
|
||||
// do something
|
||||
}
|
||||
```
|
||||
|
||||
The string is parsed like this:
|
||||
|
||||
``` text
|
||||
-> Error
|
||||
? -> {}
|
||||
?flag -> { flag: true }
|
||||
?+flag -> { flag: true }
|
||||
?-flag -> { flag: false }
|
||||
?xyz=test -> { xyz: "test" }
|
||||
?xyz=1 -> { xyz: "1" } // numbers are NOT parsed
|
||||
?xyz[]=a -> { xyz: ["a"] }
|
||||
?flag1&flag2 -> { flag1: true, flag2: true }
|
||||
?+flag1,-flag2 -> { flag1: true, flag2: false }
|
||||
?xyz[]=a,xyz[]=b -> { xyz: ["a", "b"] }
|
||||
?a%2C%26b=c%2C%26d -> { "a,&b": "c,&d" }
|
||||
?{data:{a:1},isJSON5:true} -> { data: { a: 1 }, isJSON5: true }
|
||||
```
|
||||
|
||||
### `stringifyRequest`
|
||||
|
||||
Turns a request into a string that can be used inside `require()` or `import` while avoiding absolute paths.
|
||||
Use it instead of `JSON.stringify(...)` if you're generating code inside a loader.
|
||||
|
||||
**Why is this necessary?** Since webpack calculates the hash before module paths are translated into module ids, we must avoid absolute paths to ensure
|
||||
consistent hashes across different compilations.
|
||||
|
||||
This function:
|
||||
|
||||
- resolves absolute requests into relative requests if the request and the module are on the same hard drive
|
||||
- replaces `\` with `/` if the request and the module are on the same hard drive
|
||||
- won't change the path at all if the request and the module are on different hard drives
|
||||
- applies `JSON.stringify` to the result
|
||||
|
||||
```javascript
|
||||
loaderUtils.stringifyRequest(this, "./test.js");
|
||||
// "\"./test.js\""
|
||||
|
||||
loaderUtils.stringifyRequest(this, ".\\test.js");
|
||||
// "\"./test.js\""
|
||||
|
||||
loaderUtils.stringifyRequest(this, "test");
|
||||
// "\"test\""
|
||||
|
||||
loaderUtils.stringifyRequest(this, "test/lib/index.js");
|
||||
// "\"test/lib/index.js\""
|
||||
|
||||
loaderUtils.stringifyRequest(this, "otherLoader?andConfig!test?someConfig");
|
||||
// "\"otherLoader?andConfig!test?someConfig\""
|
||||
|
||||
loaderUtils.stringifyRequest(this, require.resolve("test"));
|
||||
// "\"../node_modules/some-loader/lib/test.js\""
|
||||
|
||||
loaderUtils.stringifyRequest(this, "C:\\module\\test.js");
|
||||
// "\"../../test.js\"" (on Windows, in case the module and the request are on the same drive)
|
||||
|
||||
loaderUtils.stringifyRequest(this, "C:\\module\\test.js");
|
||||
// "\"C:\\module\\test.js\"" (on Windows, in case the module and the request are on different drives)
|
||||
|
||||
loaderUtils.stringifyRequest(this, "\\\\network-drive\\test.js");
|
||||
// "\"\\\\network-drive\\\\test.js\"" (on Windows, in case the module and the request are on different drives)
|
||||
```
|
||||
|
||||
### `urlToRequest`
|
||||
|
||||
Converts some resource URL to a webpack module request.
|
||||
|
||||
> i Before call `urlToRequest` you need call `isUrlRequest` to ensure it is requestable url
|
||||
|
||||
```javascript
|
||||
const url = "path/to/module.js";
|
||||
|
||||
if (loaderUtils.isUrlRequest(url)) {
|
||||
// Logic for requestable url
|
||||
const request = loaderUtils.urlToRequest(url);
|
||||
} else {
|
||||
// Logic for not requestable url
|
||||
}
|
||||
```
|
||||
|
||||
Simple example:
|
||||
|
||||
```javascript
|
||||
const url = "path/to/module.js";
|
||||
const request = loaderUtils.urlToRequest(url); // "./path/to/module.js"
|
||||
```
|
||||
|
||||
#### Module URLs
|
||||
|
||||
Any URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path.
|
||||
|
||||
```javascript
|
||||
const url = "~path/to/module.js";
|
||||
const request = loaderUtils.urlToRequest(url); // "path/to/module.js"
|
||||
```
|
||||
|
||||
#### Root-relative URLs
|
||||
|
||||
URLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter:
|
||||
|
||||
```javascript
|
||||
const url = "/path/to/module.js";
|
||||
const root = "./root";
|
||||
const request = loaderUtils.urlToRequest(url, root); // "./root/path/to/module.js"
|
||||
```
|
||||
|
||||
To convert a root-relative URL into a module URL, specify a `root` value that starts with `~`:
|
||||
|
||||
```javascript
|
||||
const url = "/path/to/module.js";
|
||||
const root = "~";
|
||||
const request = loaderUtils.urlToRequest(url, root); // "path/to/module.js"
|
||||
```
|
||||
|
||||
### `interpolateName`
|
||||
|
||||
Interpolates a filename template using multiple placeholders and/or a regular expression.
|
||||
The template and regular expression are set as query params called `name` and `regExp` on the current loader's context.
|
||||
|
||||
```javascript
|
||||
const interpolatedName = loaderUtils.interpolateName(loaderContext, name, options);
|
||||
```
|
||||
|
||||
The following tokens are replaced in the `name` parameter:
|
||||
|
||||
* `[ext]` the extension of the resource
|
||||
* `[name]` the basename of the resource
|
||||
* `[path]` the path of the resource relative to the `context` query parameter or option.
|
||||
* `[folder]` the folder of the resource is in.
|
||||
* `[emoji]` a random emoji representation of `options.content`
|
||||
* `[emoji:<length>]` same as above, but with a customizable number of emojis
|
||||
* `[contenthash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash)
|
||||
* `[<hashType>:contenthash:<digestType>:<length>]` optionally one can configure
|
||||
* other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512`
|
||||
* other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`
|
||||
* and `length` the length in chars
|
||||
* `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash)
|
||||
* `[<hashType>:hash:<digestType>:<length>]` optionally one can configure
|
||||
* other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512`
|
||||
* other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`
|
||||
* and `length` the length in chars
|
||||
* `[N]` the N-th match obtained from matching the current file name against `options.regExp`
|
||||
|
||||
In loader context `[hash]` and `[contenthash]` are the same, but we recommend using `[contenthash]` for avoid misleading.
|
||||
|
||||
Examples
|
||||
|
||||
``` javascript
|
||||
// loaderContext.resourcePath = "/app/js/javascript.js"
|
||||
loaderUtils.interpolateName(loaderContext, "js/[hash].script.[ext]", { content: ... });
|
||||
// => js/9473fdd0d880a43c21b7778d34872157.script.js
|
||||
|
||||
// loaderContext.resourcePath = "/app/js/javascript.js"
|
||||
loaderUtils.interpolateName(loaderContext, "js/[contenthash].script.[ext]", { content: ... });
|
||||
// => js/9473fdd0d880a43c21b7778d34872157.script.js
|
||||
|
||||
// loaderContext.resourcePath = "/app/page.html"
|
||||
loaderUtils.interpolateName(loaderContext, "html-[hash:6].html", { content: ... });
|
||||
// => html-9473fd.html
|
||||
|
||||
// loaderContext.resourcePath = "/app/flash.txt"
|
||||
loaderUtils.interpolateName(loaderContext, "[hash]", { content: ... });
|
||||
// => c31e9820c001c9c4a86bce33ce43b679
|
||||
|
||||
// loaderContext.resourcePath = "/app/img/image.gif"
|
||||
loaderUtils.interpolateName(loaderContext, "[emoji]", { content: ... });
|
||||
// => 👍
|
||||
|
||||
// loaderContext.resourcePath = "/app/img/image.gif"
|
||||
loaderUtils.interpolateName(loaderContext, "[emoji:4]", { content: ... });
|
||||
// => 🙍🏢📤🐝
|
||||
|
||||
// loaderContext.resourcePath = "/app/img/image.png"
|
||||
loaderUtils.interpolateName(loaderContext, "[sha512:hash:base64:7].[ext]", { content: ... });
|
||||
// => 2BKDTjl.png
|
||||
// use sha512 hash instead of md5 and with only 7 chars of base64
|
||||
|
||||
// loaderContext.resourcePath = "/app/img/myself.png"
|
||||
// loaderContext.query.name =
|
||||
loaderUtils.interpolateName(loaderContext, "picture.png");
|
||||
// => picture.png
|
||||
|
||||
// loaderContext.resourcePath = "/app/dir/file.png"
|
||||
loaderUtils.interpolateName(loaderContext, "[path][name].[ext]?[hash]", { content: ... });
|
||||
// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157
|
||||
|
||||
// loaderContext.resourcePath = "/app/js/page-home.js"
|
||||
loaderUtils.interpolateName(loaderContext, "script-[1].[ext]", { regExp: "page-(.*)\\.js", content: ... });
|
||||
// => script-home.js
|
||||
```
|
||||
|
||||
### `getHashDigest`
|
||||
|
||||
``` javascript
|
||||
const digestString = loaderUtils.getHashDigest(buffer, hashType, digestType, maxLength);
|
||||
```
|
||||
|
||||
* `buffer` the content that should be hashed
|
||||
* `hashType` one of `sha1`, `md5`, `sha256`, `sha512` or any other node.js supported hash type
|
||||
* `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`
|
||||
* `maxLength` the maximum length in chars
|
||||
|
||||
## License
|
||||
|
||||
MIT (http://www.opensource.org/licenses/mit-license.php)
|
16
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getCurrentRequest.js
generated
vendored
Normal file
16
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getCurrentRequest.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
function getCurrentRequest(loaderContext) {
|
||||
if (loaderContext.currentRequest) {
|
||||
return loaderContext.currentRequest;
|
||||
}
|
||||
|
||||
const request = loaderContext.loaders
|
||||
.slice(loaderContext.loaderIndex)
|
||||
.map((obj) => obj.request)
|
||||
.concat([loaderContext.resource]);
|
||||
|
||||
return request.join('!');
|
||||
}
|
||||
|
||||
module.exports = getCurrentRequest;
|
69
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getHashDigest.js
generated
vendored
Normal file
69
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getHashDigest.js
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
'use strict';
|
||||
|
||||
const baseEncodeTables = {
|
||||
26: 'abcdefghijklmnopqrstuvwxyz',
|
||||
32: '123456789abcdefghjkmnpqrstuvwxyz', // no 0lio
|
||||
36: '0123456789abcdefghijklmnopqrstuvwxyz',
|
||||
49: 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', // no lIO
|
||||
52: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
58: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', // no 0lIO
|
||||
62: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
64: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_',
|
||||
};
|
||||
|
||||
function encodeBufferToBase(buffer, base) {
|
||||
const encodeTable = baseEncodeTables[base];
|
||||
if (!encodeTable) {
|
||||
throw new Error('Unknown encoding base' + base);
|
||||
}
|
||||
|
||||
const readLength = buffer.length;
|
||||
const Big = require('big.js');
|
||||
|
||||
Big.RM = Big.DP = 0;
|
||||
let b = new Big(0);
|
||||
|
||||
for (let i = readLength - 1; i >= 0; i--) {
|
||||
b = b.times(256).plus(buffer[i]);
|
||||
}
|
||||
|
||||
let output = '';
|
||||
while (b.gt(0)) {
|
||||
output = encodeTable[b.mod(base)] + output;
|
||||
b = b.div(base);
|
||||
}
|
||||
|
||||
Big.DP = 20;
|
||||
Big.RM = 1;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function getHashDigest(buffer, hashType, digestType, maxLength) {
|
||||
hashType = hashType || 'md5';
|
||||
maxLength = maxLength || 9999;
|
||||
|
||||
const hash = require('crypto').createHash(hashType);
|
||||
|
||||
hash.update(buffer);
|
||||
|
||||
if (
|
||||
digestType === 'base26' ||
|
||||
digestType === 'base32' ||
|
||||
digestType === 'base36' ||
|
||||
digestType === 'base49' ||
|
||||
digestType === 'base52' ||
|
||||
digestType === 'base58' ||
|
||||
digestType === 'base62' ||
|
||||
digestType === 'base64'
|
||||
) {
|
||||
return encodeBufferToBase(hash.digest(), digestType.substr(4)).substr(
|
||||
0,
|
||||
maxLength
|
||||
);
|
||||
} else {
|
||||
return hash.digest(digestType || 'hex').substr(0, maxLength);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = getHashDigest;
|
20
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getOptions.js
generated
vendored
Normal file
20
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getOptions.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
const parseQuery = require('./parseQuery');
|
||||
|
||||
function getOptions(loaderContext) {
|
||||
const query = loaderContext.query;
|
||||
|
||||
if (typeof query === 'string' && query !== '') {
|
||||
return parseQuery(loaderContext.query);
|
||||
}
|
||||
|
||||
if (!query || typeof query !== 'object') {
|
||||
// Not object-like queries are not supported.
|
||||
return null;
|
||||
}
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
module.exports = getOptions;
|
16
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getRemainingRequest.js
generated
vendored
Normal file
16
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/getRemainingRequest.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
function getRemainingRequest(loaderContext) {
|
||||
if (loaderContext.remainingRequest) {
|
||||
return loaderContext.remainingRequest;
|
||||
}
|
||||
|
||||
const request = loaderContext.loaders
|
||||
.slice(loaderContext.loaderIndex + 1)
|
||||
.map((obj) => obj.request)
|
||||
.concat([loaderContext.resource]);
|
||||
|
||||
return request.join('!');
|
||||
}
|
||||
|
||||
module.exports = getRemainingRequest;
|
23
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/index.js
generated
vendored
Normal file
23
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
const getOptions = require('./getOptions');
|
||||
const parseQuery = require('./parseQuery');
|
||||
const stringifyRequest = require('./stringifyRequest');
|
||||
const getRemainingRequest = require('./getRemainingRequest');
|
||||
const getCurrentRequest = require('./getCurrentRequest');
|
||||
const isUrlRequest = require('./isUrlRequest');
|
||||
const urlToRequest = require('./urlToRequest');
|
||||
const parseString = require('./parseString');
|
||||
const getHashDigest = require('./getHashDigest');
|
||||
const interpolateName = require('./interpolateName');
|
||||
|
||||
exports.getOptions = getOptions;
|
||||
exports.parseQuery = parseQuery;
|
||||
exports.stringifyRequest = stringifyRequest;
|
||||
exports.getRemainingRequest = getRemainingRequest;
|
||||
exports.getCurrentRequest = getCurrentRequest;
|
||||
exports.isUrlRequest = isUrlRequest;
|
||||
exports.urlToRequest = urlToRequest;
|
||||
exports.parseString = parseString;
|
||||
exports.getHashDigest = getHashDigest;
|
||||
exports.interpolateName = interpolateName;
|
133
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/interpolateName.js
generated
vendored
Normal file
133
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/interpolateName.js
generated
vendored
Normal file
|
@ -0,0 +1,133 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const emojisList = require('emojis-list');
|
||||
const getHashDigest = require('./getHashDigest');
|
||||
|
||||
const emojiRegex = /[\uD800-\uDFFF]./;
|
||||
const emojiList = emojisList.filter((emoji) => emojiRegex.test(emoji));
|
||||
const emojiCache = {};
|
||||
|
||||
function encodeStringToEmoji(content, length) {
|
||||
if (emojiCache[content]) {
|
||||
return emojiCache[content];
|
||||
}
|
||||
|
||||
length = length || 1;
|
||||
|
||||
const emojis = [];
|
||||
|
||||
do {
|
||||
if (!emojiList.length) {
|
||||
throw new Error('Ran out of emoji');
|
||||
}
|
||||
|
||||
const index = Math.floor(Math.random() * emojiList.length);
|
||||
|
||||
emojis.push(emojiList[index]);
|
||||
emojiList.splice(index, 1);
|
||||
} while (--length > 0);
|
||||
|
||||
const emojiEncoding = emojis.join('');
|
||||
|
||||
emojiCache[content] = emojiEncoding;
|
||||
|
||||
return emojiEncoding;
|
||||
}
|
||||
|
||||
function interpolateName(loaderContext, name, options) {
|
||||
let filename;
|
||||
|
||||
if (typeof name === 'function') {
|
||||
filename = name(loaderContext.resourcePath);
|
||||
} else {
|
||||
filename = name || '[hash].[ext]';
|
||||
}
|
||||
|
||||
const context = options.context;
|
||||
const content = options.content;
|
||||
const regExp = options.regExp;
|
||||
|
||||
let ext = 'bin';
|
||||
let basename = 'file';
|
||||
let directory = '';
|
||||
let folder = '';
|
||||
|
||||
if (loaderContext.resourcePath) {
|
||||
const parsed = path.parse(loaderContext.resourcePath);
|
||||
let resourcePath = loaderContext.resourcePath;
|
||||
|
||||
if (parsed.ext) {
|
||||
ext = parsed.ext.substr(1);
|
||||
}
|
||||
|
||||
if (parsed.dir) {
|
||||
basename = parsed.name;
|
||||
resourcePath = parsed.dir + path.sep;
|
||||
}
|
||||
|
||||
if (typeof context !== 'undefined') {
|
||||
directory = path
|
||||
.relative(context, resourcePath + '_')
|
||||
.replace(/\\/g, '/')
|
||||
.replace(/\.\.(\/)?/g, '_$1');
|
||||
directory = directory.substr(0, directory.length - 1);
|
||||
} else {
|
||||
directory = resourcePath.replace(/\\/g, '/').replace(/\.\.(\/)?/g, '_$1');
|
||||
}
|
||||
|
||||
if (directory.length === 1) {
|
||||
directory = '';
|
||||
} else if (directory.length > 1) {
|
||||
folder = path.basename(directory);
|
||||
}
|
||||
}
|
||||
|
||||
let url = filename;
|
||||
|
||||
if (content) {
|
||||
// Match hash template
|
||||
url = url
|
||||
// `hash` and `contenthash` are same in `loader-utils` context
|
||||
// let's keep `hash` for backward compatibility
|
||||
.replace(
|
||||
/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
|
||||
(all, hashType, digestType, maxLength) =>
|
||||
getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))
|
||||
)
|
||||
.replace(/\[emoji(?::(\d+))?\]/gi, (all, length) =>
|
||||
encodeStringToEmoji(content, parseInt(length, 10))
|
||||
);
|
||||
}
|
||||
|
||||
url = url
|
||||
.replace(/\[ext\]/gi, () => ext)
|
||||
.replace(/\[name\]/gi, () => basename)
|
||||
.replace(/\[path\]/gi, () => directory)
|
||||
.replace(/\[folder\]/gi, () => folder);
|
||||
|
||||
if (regExp && loaderContext.resourcePath) {
|
||||
const match = loaderContext.resourcePath.match(new RegExp(regExp));
|
||||
|
||||
match &&
|
||||
match.forEach((matched, i) => {
|
||||
url = url.replace(new RegExp('\\[' + i + '\\]', 'ig'), matched);
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
typeof loaderContext.options === 'object' &&
|
||||
typeof loaderContext.options.customInterpolateName === 'function'
|
||||
) {
|
||||
url = loaderContext.options.customInterpolateName.call(
|
||||
loaderContext,
|
||||
url,
|
||||
name,
|
||||
options
|
||||
);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
module.exports = interpolateName;
|
31
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/isUrlRequest.js
generated
vendored
Normal file
31
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/isUrlRequest.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
function isUrlRequest(url, root) {
|
||||
// An URL is not an request if
|
||||
|
||||
// 1. It's an absolute url and it is not `windows` path like `C:\dir\file`
|
||||
if (/^[a-z][a-z0-9+.-]*:/i.test(url) && !path.win32.isAbsolute(url)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. It's a protocol-relative
|
||||
if (/^\/\//.test(url)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. It's some kind of url for a template
|
||||
if (/^[{}[\]#*;,'§$%&(=?`´^°<>]/.test(url)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 4. It's also not an request if root isn't set and it's a root-relative url
|
||||
if ((root === undefined || root === false) && /^\//.test(url)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = isUrlRequest;
|
68
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/parseQuery.js
generated
vendored
Normal file
68
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/parseQuery.js
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
'use strict';
|
||||
|
||||
const JSON5 = require('json5');
|
||||
|
||||
const specialValues = {
|
||||
null: null,
|
||||
true: true,
|
||||
false: false,
|
||||
};
|
||||
|
||||
function parseQuery(query) {
|
||||
if (query.substr(0, 1) !== '?') {
|
||||
throw new Error(
|
||||
"A valid query string passed to parseQuery should begin with '?'"
|
||||
);
|
||||
}
|
||||
|
||||
query = query.substr(1);
|
||||
|
||||
if (!query) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (query.substr(0, 1) === '{' && query.substr(-1) === '}') {
|
||||
return JSON5.parse(query);
|
||||
}
|
||||
|
||||
const queryArgs = query.split(/[,&]/g);
|
||||
const result = {};
|
||||
|
||||
queryArgs.forEach((arg) => {
|
||||
const idx = arg.indexOf('=');
|
||||
|
||||
if (idx >= 0) {
|
||||
let name = arg.substr(0, idx);
|
||||
let value = decodeURIComponent(arg.substr(idx + 1));
|
||||
|
||||
if (specialValues.hasOwnProperty(value)) {
|
||||
value = specialValues[value];
|
||||
}
|
||||
|
||||
if (name.substr(-2) === '[]') {
|
||||
name = decodeURIComponent(name.substr(0, name.length - 2));
|
||||
|
||||
if (!Array.isArray(result[name])) {
|
||||
result[name] = [];
|
||||
}
|
||||
|
||||
result[name].push(value);
|
||||
} else {
|
||||
name = decodeURIComponent(name);
|
||||
result[name] = value;
|
||||
}
|
||||
} else {
|
||||
if (arg.substr(0, 1) === '-') {
|
||||
result[decodeURIComponent(arg.substr(1))] = false;
|
||||
} else if (arg.substr(0, 1) === '+') {
|
||||
result[decodeURIComponent(arg.substr(1))] = true;
|
||||
} else {
|
||||
result[decodeURIComponent(arg)] = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = parseQuery;
|
23
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/parseString.js
generated
vendored
Normal file
23
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/parseString.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
function parseString(str) {
|
||||
try {
|
||||
if (str[0] === '"') {
|
||||
return JSON.parse(str);
|
||||
}
|
||||
|
||||
if (str[0] === "'" && str.substr(str.length - 1) === "'") {
|
||||
return parseString(
|
||||
str
|
||||
.replace(/\\.|"/g, (x) => (x === '"' ? '\\"' : x))
|
||||
.replace(/^'|'$/g, '"')
|
||||
);
|
||||
}
|
||||
|
||||
return JSON.parse('"' + str + '"');
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = parseString;
|
51
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/stringifyRequest.js
generated
vendored
Normal file
51
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/stringifyRequest.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const matchRelativePath = /^\.\.?[/\\]/;
|
||||
|
||||
function isAbsolutePath(str) {
|
||||
return path.posix.isAbsolute(str) || path.win32.isAbsolute(str);
|
||||
}
|
||||
|
||||
function isRelativePath(str) {
|
||||
return matchRelativePath.test(str);
|
||||
}
|
||||
|
||||
function stringifyRequest(loaderContext, request) {
|
||||
const splitted = request.split('!');
|
||||
const context =
|
||||
loaderContext.context ||
|
||||
(loaderContext.options && loaderContext.options.context);
|
||||
|
||||
return JSON.stringify(
|
||||
splitted
|
||||
.map((part) => {
|
||||
// First, separate singlePath from query, because the query might contain paths again
|
||||
const splittedPart = part.match(/^(.*?)(\?.*)/);
|
||||
const query = splittedPart ? splittedPart[2] : '';
|
||||
let singlePath = splittedPart ? splittedPart[1] : part;
|
||||
|
||||
if (isAbsolutePath(singlePath) && context) {
|
||||
singlePath = path.relative(context, singlePath);
|
||||
|
||||
if (isAbsolutePath(singlePath)) {
|
||||
// If singlePath still matches an absolute path, singlePath was on a different drive than context.
|
||||
// In this case, we leave the path platform-specific without replacing any separators.
|
||||
// @see https://github.com/webpack/loader-utils/pull/14
|
||||
return singlePath + query;
|
||||
}
|
||||
|
||||
if (isRelativePath(singlePath) === false) {
|
||||
// Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules).
|
||||
singlePath = './' + singlePath;
|
||||
}
|
||||
}
|
||||
|
||||
return singlePath.replace(/\\/g, '/') + query;
|
||||
})
|
||||
.join('!')
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = stringifyRequest;
|
60
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/urlToRequest.js
generated
vendored
Normal file
60
web/node_modules/resolve-url-loader/node_modules/loader-utils/lib/urlToRequest.js
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
'use strict';
|
||||
|
||||
// we can't use path.win32.isAbsolute because it also matches paths starting with a forward slash
|
||||
const matchNativeWin32Path = /^[A-Z]:[/\\]|^\\\\/i;
|
||||
|
||||
function urlToRequest(url, root) {
|
||||
// Do not rewrite an empty url
|
||||
if (url === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
const moduleRequestRegex = /^[^?]*~/;
|
||||
let request;
|
||||
|
||||
if (matchNativeWin32Path.test(url)) {
|
||||
// absolute windows path, keep it
|
||||
request = url;
|
||||
} else if (root !== undefined && root !== false && /^\//.test(url)) {
|
||||
// if root is set and the url is root-relative
|
||||
switch (typeof root) {
|
||||
// 1. root is a string: root is prefixed to the url
|
||||
case 'string':
|
||||
// special case: `~` roots convert to module request
|
||||
if (moduleRequestRegex.test(root)) {
|
||||
request = root.replace(/([^~/])$/, '$1/') + url.slice(1);
|
||||
} else {
|
||||
request = root + url;
|
||||
}
|
||||
break;
|
||||
// 2. root is `true`: absolute paths are allowed
|
||||
// *nix only, windows-style absolute paths are always allowed as they doesn't start with a `/`
|
||||
case 'boolean':
|
||||
request = url;
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
"Unexpected parameters to loader-utils 'urlToRequest': url = " +
|
||||
url +
|
||||
', root = ' +
|
||||
root +
|
||||
'.'
|
||||
);
|
||||
}
|
||||
} else if (/^\.\.?\//.test(url)) {
|
||||
// A relative url stays
|
||||
request = url;
|
||||
} else {
|
||||
// every other url is threaded like a relative url
|
||||
request = './' + url;
|
||||
}
|
||||
|
||||
// A `~` makes the url an module
|
||||
if (moduleRequestRegex.test(request)) {
|
||||
request = request.replace(moduleRequestRegex, '');
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
module.exports = urlToRequest;
|
39
web/node_modules/resolve-url-loader/node_modules/loader-utils/package.json
generated
vendored
Normal file
39
web/node_modules/resolve-url-loader/node_modules/loader-utils/package.json
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"name": "loader-utils",
|
||||
"version": "1.2.3",
|
||||
"author": "Tobias Koppers @sokra",
|
||||
"description": "utils for webpack loaders",
|
||||
"dependencies": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^2.0.0",
|
||||
"json5": "^1.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint lib test",
|
||||
"pretest": "yarn lint",
|
||||
"test": "jest",
|
||||
"test:ci": "jest --coverage",
|
||||
"release": "yarn test && standard-version"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webpack/loader-utils.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^3.0.2",
|
||||
"eslint": "^5.11.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"jest": "^21.2.1",
|
||||
"prettier": "^1.15.3",
|
||||
"standard-version": "^4.0.0"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
]
|
||||
}
|
51
web/node_modules/resolve-url-loader/package.json
generated
vendored
Normal file
51
web/node_modules/resolve-url-loader/package.json
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": "resolve-url-loader",
|
||||
"version": "3.1.4",
|
||||
"description": "Webpack loader that resolves relative paths in url() statements based on the original source file",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bholloway/resolve-url-loader.git",
|
||||
"directory": "packages/resolve-url-loader"
|
||||
},
|
||||
"keywords": [
|
||||
"webpack",
|
||||
"loader",
|
||||
"css",
|
||||
"normalize",
|
||||
"rewrite",
|
||||
"resolve",
|
||||
"url",
|
||||
"sass",
|
||||
"relative",
|
||||
"file"
|
||||
],
|
||||
"author": "bholloway",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bholloway/resolve-url-loader/issues"
|
||||
},
|
||||
"homepage": "https://github.com/bholloway/resolve-url-loader/tree/v3-maintenance/packages/resolve-url-loader",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/**/+([a-z-]).js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "jshint --exclude **/node_modules index.js lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"adjust-sourcemap-loader": "3.0.0",
|
||||
"camelcase": "5.3.1",
|
||||
"compose-function": "3.0.3",
|
||||
"convert-source-map": "1.7.0",
|
||||
"es6-iterator": "2.0.3",
|
||||
"loader-utils": "1.2.3",
|
||||
"postcss": "7.0.36",
|
||||
"rework": "1.0.1",
|
||||
"rework-visit": "1.0.0",
|
||||
"source-map": "0.6.1"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue