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
109
web/node_modules/postcss-normalize-url/CHANGELOG.md
generated
vendored
Normal file
109
web/node_modules/postcss-normalize-url/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
# 4.0.0-rc.0
|
||||
|
||||
* Breaking: Drops support for Node 0.12, we now require at least Node 4.
|
||||
* Breaking: Update PostCSS to 6.0.0.
|
||||
* Breaking: `stripWWW` is now set to `false` by default.
|
||||
|
||||
# 3.0.8
|
||||
|
||||
* Fixes `@namespace` URL conversion; now the semantics of the URL are preserved
|
||||
and only the `url(foo)` to `"foo"` optimisation is performed.
|
||||
|
||||
# 3.0.7
|
||||
|
||||
* Fix `main` field in `package.json`.
|
||||
|
||||
# 3.0.6
|
||||
|
||||
* Now compiled with Babel 6.
|
||||
|
||||
# 3.0.5
|
||||
|
||||
* Fixes an issue where base64 encoded OpenType font urls were being erroneously
|
||||
converted by the module (thanks to @ln-e).
|
||||
|
||||
# 3.0.4
|
||||
|
||||
* Fixes incorrect minification of empty non-url functions.
|
||||
|
||||
# 3.0.3
|
||||
|
||||
* Updates postcss-value-parser to version 3 (thanks to @TrySound).
|
||||
|
||||
# 3.0.2
|
||||
|
||||
* Fixes incorrect minification of chrome-extension urls.
|
||||
|
||||
# 3.0.1
|
||||
|
||||
* Bump postcss-value-parser to `2.0.2`.
|
||||
|
||||
# 3.0.0
|
||||
|
||||
* Upgraded to PostCSS 5.
|
||||
|
||||
# 2.1.3
|
||||
|
||||
* Replaces trim space nodes function with a built in method
|
||||
of postcss-value-parser.
|
||||
|
||||
# 2.1.2
|
||||
|
||||
* postcss-normalize-url now uses postcss-value-parser to iterate
|
||||
url values (thanks to @TrySound).
|
||||
* Fixed `@namespace` URL reduction behaviour. (thanks to @TrySound).
|
||||
|
||||
# 2.1.1
|
||||
|
||||
* Increased performance by using a single call to `eachInside` rather than two.
|
||||
|
||||
# 2.1.0
|
||||
|
||||
* Adds `keepWWW` option.
|
||||
* Compatibility fixes for `is-absolute-url@2.0.0`.
|
||||
|
||||
# 2.0.3
|
||||
|
||||
* Fixes an issue where embedded base 64 data was being converted as if it were
|
||||
a URL.
|
||||
|
||||
# 2.0.2
|
||||
|
||||
* Addresses an issue where relative path separators were converted to
|
||||
backslashes on Windows.
|
||||
|
||||
# 2.0.1
|
||||
|
||||
* Documentation/metadata tweaks for plugin guidelines compatibility.
|
||||
* Bump css-list to 0.1.0, use instead of postcss.list.space for namespace
|
||||
rule normalization.
|
||||
|
||||
# 2.0.0
|
||||
|
||||
* Improved URL detection when using two or more in the same declaration.
|
||||
* node 0.10 is no longer supported.
|
||||
|
||||
# 1.2.1
|
||||
|
||||
* Patch to address incorrect transformation of `@document` rules.
|
||||
|
||||
# 1.2.0
|
||||
|
||||
* Fixes an issue where options could not be passed through.
|
||||
* Support for normalising URLs in `@namespace` rules.
|
||||
|
||||
# 1.1.0
|
||||
|
||||
* Now uses the PostCSS `4.1` plugin API.
|
||||
|
||||
# 1.0.2
|
||||
|
||||
* Adds a JSHint config, code tidied up.
|
||||
|
||||
# 1.0.1
|
||||
|
||||
* Bug fix; does not transform embedded base 64 or svg images.
|
||||
|
||||
# 1.0.0
|
||||
|
||||
* Initial release.
|
22
web/node_modules/postcss-normalize-url/LICENSE-MIT
generated
vendored
Normal file
22
web/node_modules/postcss-normalize-url/LICENSE-MIT
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
|
||||
|
||||
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.
|
55
web/node_modules/postcss-normalize-url/README.md
generated
vendored
Normal file
55
web/node_modules/postcss-normalize-url/README.md
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
# [postcss][postcss]-normalize-url
|
||||
|
||||
> [Normalize URLs](https://github.com/sindresorhus/normalize-url) with PostCSS.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://npmjs.org/package/postcss-normalize-url) do:
|
||||
|
||||
```
|
||||
npm install postcss-normalize-url --save
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
### Input
|
||||
|
||||
```css
|
||||
h1 {
|
||||
background: url("http://site.com:80/image.jpg")
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```css
|
||||
h1 {
|
||||
background: url(http://site.com/image.jpg)
|
||||
}
|
||||
```
|
||||
|
||||
Note that this module will also try to normalize relative URLs, and is capable
|
||||
of stripping unnecessary quotes. For more examples, see the [tests](test.js).
|
||||
|
||||
## Usage
|
||||
|
||||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
||||
examples for your environment.
|
||||
|
||||
## API
|
||||
|
||||
### normalize([options])
|
||||
|
||||
Please see the [normalize-url documentation][docs]. By default,
|
||||
`normalizeProtocol`, `stripFragment` & `stripWWW` are set to `false`.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Ben Briggs](http://beneb.info)
|
||||
|
||||
[docs]: https://github.com/sindresorhus/normalize-url#options
|
||||
[postcss]: https://github.com/postcss/postcss
|
122
web/node_modules/postcss-normalize-url/dist/index.js
generated
vendored
Normal file
122
web/node_modules/postcss-normalize-url/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _path = require('path');
|
||||
|
||||
var _path2 = _interopRequireDefault(_path);
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
var _postcss2 = _interopRequireDefault(_postcss);
|
||||
|
||||
var _postcssValueParser = require('postcss-value-parser');
|
||||
|
||||
var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
|
||||
|
||||
var _normalizeUrl = require('normalize-url');
|
||||
|
||||
var _normalizeUrl2 = _interopRequireDefault(_normalizeUrl);
|
||||
|
||||
var _isAbsoluteUrl = require('is-absolute-url');
|
||||
|
||||
var _isAbsoluteUrl2 = _interopRequireDefault(_isAbsoluteUrl);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const multiline = /\\[\r\n]/;
|
||||
const escapeChars = /([\s\(\)"'])/g;
|
||||
|
||||
function convert(url, options) {
|
||||
if ((0, _isAbsoluteUrl2.default)(url) || url.startsWith('//')) {
|
||||
let normalizedURL = null;
|
||||
|
||||
try {
|
||||
normalizedURL = (0, _normalizeUrl2.default)(url, options);
|
||||
} catch (e) {
|
||||
normalizedURL = url;
|
||||
}
|
||||
|
||||
return normalizedURL;
|
||||
}
|
||||
|
||||
// `path.normalize` always returns backslashes on Windows, need replace in `/`
|
||||
return _path2.default.normalize(url).replace(new RegExp('\\' + _path2.default.sep, 'g'), '/');
|
||||
}
|
||||
|
||||
function transformNamespace(rule) {
|
||||
rule.params = (0, _postcssValueParser2.default)(rule.params).walk(node => {
|
||||
if (node.type === 'function' && node.value.toLowerCase() === 'url' && node.nodes.length) {
|
||||
node.type = 'string';
|
||||
node.quote = node.nodes[0].quote || '"';
|
||||
node.value = node.nodes[0].value;
|
||||
}
|
||||
if (node.type === 'string') {
|
||||
node.value = node.value.trim();
|
||||
}
|
||||
return false;
|
||||
}).toString();
|
||||
}
|
||||
|
||||
function transformDecl(decl, opts) {
|
||||
decl.value = (0, _postcssValueParser2.default)(decl.value).walk(node => {
|
||||
if (node.type !== 'function' || node.value.toLowerCase() !== 'url' || !node.nodes.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let url = node.nodes[0];
|
||||
let escaped;
|
||||
|
||||
node.before = node.after = '';
|
||||
url.value = url.value.trim().replace(multiline, '');
|
||||
|
||||
// Skip empty URLs
|
||||
// Empty URL function equals request to current stylesheet where it is declared
|
||||
if (url.value.length === 0) {
|
||||
url.quote = '';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (/^data:(.*)?,/i.test(url.value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!/^.+-extension:\//i.test(url.value)) {
|
||||
url.value = convert(url.value, opts);
|
||||
}
|
||||
|
||||
if (escapeChars.test(url.value) && url.type === 'string') {
|
||||
escaped = url.value.replace(escapeChars, '\\$1');
|
||||
if (escaped.length < url.value.length + 2) {
|
||||
url.value = escaped;
|
||||
url.type = 'word';
|
||||
}
|
||||
} else {
|
||||
url.type = 'word';
|
||||
}
|
||||
|
||||
return false;
|
||||
}).toString();
|
||||
}
|
||||
|
||||
exports.default = _postcss2.default.plugin('postcss-normalize-url', opts => {
|
||||
opts = Object.assign({}, {
|
||||
normalizeProtocol: false,
|
||||
stripFragment: false,
|
||||
stripWWW: false
|
||||
}, opts);
|
||||
|
||||
return css => {
|
||||
css.walk(node => {
|
||||
if (node.type === 'decl') {
|
||||
return transformDecl(node, opts);
|
||||
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'namespace') {
|
||||
return transformNamespace(node);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
module.exports = exports['default'];
|
139
web/node_modules/postcss-normalize-url/node_modules/normalize-url/index.js
generated
vendored
Normal file
139
web/node_modules/postcss-normalize-url/node_modules/normalize-url/index.js
generated
vendored
Normal file
|
@ -0,0 +1,139 @@
|
|||
'use strict';
|
||||
// TODO: Use the `URL` global when targeting Node.js 10
|
||||
const URLParser = typeof URL === 'undefined' ? require('url').URL : URL;
|
||||
|
||||
const testParameter = (name, filters) => {
|
||||
return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
|
||||
};
|
||||
|
||||
module.exports = (urlString, opts) => {
|
||||
opts = Object.assign({
|
||||
defaultProtocol: 'http:',
|
||||
normalizeProtocol: true,
|
||||
forceHttp: false,
|
||||
forceHttps: false,
|
||||
stripHash: true,
|
||||
stripWWW: true,
|
||||
removeQueryParameters: [/^utm_\w+/i],
|
||||
removeTrailingSlash: true,
|
||||
removeDirectoryIndex: false,
|
||||
sortQueryParameters: true
|
||||
}, opts);
|
||||
|
||||
// Backwards compatibility
|
||||
if (Reflect.has(opts, 'normalizeHttps')) {
|
||||
opts.forceHttp = opts.normalizeHttps;
|
||||
}
|
||||
|
||||
if (Reflect.has(opts, 'normalizeHttp')) {
|
||||
opts.forceHttps = opts.normalizeHttp;
|
||||
}
|
||||
|
||||
if (Reflect.has(opts, 'stripFragment')) {
|
||||
opts.stripHash = opts.stripFragment;
|
||||
}
|
||||
|
||||
urlString = urlString.trim();
|
||||
|
||||
const hasRelativeProtocol = urlString.startsWith('//');
|
||||
const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
|
||||
|
||||
// Prepend protocol
|
||||
if (!isRelativeUrl) {
|
||||
urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, opts.defaultProtocol);
|
||||
}
|
||||
|
||||
const urlObj = new URLParser(urlString);
|
||||
|
||||
if (opts.forceHttp && opts.forceHttps) {
|
||||
throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
|
||||
}
|
||||
|
||||
if (opts.forceHttp && urlObj.protocol === 'https:') {
|
||||
urlObj.protocol = 'http:';
|
||||
}
|
||||
|
||||
if (opts.forceHttps && urlObj.protocol === 'http:') {
|
||||
urlObj.protocol = 'https:';
|
||||
}
|
||||
|
||||
// Remove hash
|
||||
if (opts.stripHash) {
|
||||
urlObj.hash = '';
|
||||
}
|
||||
|
||||
// Remove duplicate slashes if not preceded by a protocol
|
||||
if (urlObj.pathname) {
|
||||
// TODO: Use the following instead when targeting Node.js 10
|
||||
// `urlObj.pathname = urlObj.pathname.replace(/(?<!https?:)\/{2,}/g, '/');`
|
||||
urlObj.pathname = urlObj.pathname.replace(/((?![https?:]).)\/{2,}/g, (_, p1) => {
|
||||
if (/^(?!\/)/g.test(p1)) {
|
||||
return `${p1}/`;
|
||||
}
|
||||
return '/';
|
||||
});
|
||||
}
|
||||
|
||||
// Decode URI octets
|
||||
if (urlObj.pathname) {
|
||||
urlObj.pathname = decodeURI(urlObj.pathname);
|
||||
}
|
||||
|
||||
// Remove directory index
|
||||
if (opts.removeDirectoryIndex === true) {
|
||||
opts.removeDirectoryIndex = [/^index\.[a-z]+$/];
|
||||
}
|
||||
|
||||
if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length > 0) {
|
||||
let pathComponents = urlObj.pathname.split('/');
|
||||
const lastComponent = pathComponents[pathComponents.length - 1];
|
||||
|
||||
if (testParameter(lastComponent, opts.removeDirectoryIndex)) {
|
||||
pathComponents = pathComponents.slice(0, pathComponents.length - 1);
|
||||
urlObj.pathname = pathComponents.slice(1).join('/') + '/';
|
||||
}
|
||||
}
|
||||
|
||||
if (urlObj.hostname) {
|
||||
// Remove trailing dot
|
||||
urlObj.hostname = urlObj.hostname.replace(/\.$/, '');
|
||||
|
||||
// Remove `www.`
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
if (opts.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z\.]{2,5})$/.test(urlObj.hostname)) {
|
||||
// Each label should be max 63 at length (min: 2).
|
||||
// The extension should be max 5 at length (min: 2).
|
||||
// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
|
||||
urlObj.hostname = urlObj.hostname.replace(/^www\./, '');
|
||||
}
|
||||
}
|
||||
|
||||
// Remove query unwanted parameters
|
||||
if (Array.isArray(opts.removeQueryParameters)) {
|
||||
for (const key of [...urlObj.searchParams.keys()]) {
|
||||
if (testParameter(key, opts.removeQueryParameters)) {
|
||||
urlObj.searchParams.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sort query parameters
|
||||
if (opts.sortQueryParameters) {
|
||||
urlObj.searchParams.sort();
|
||||
}
|
||||
|
||||
// Take advantage of many of the Node `url` normalizations
|
||||
urlString = urlObj.toString();
|
||||
|
||||
// Remove ending `/`
|
||||
if (opts.removeTrailingSlash || urlObj.pathname === '/') {
|
||||
urlString = urlString.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
// Restore relative protocol, if applicable
|
||||
if (hasRelativeProtocol && !opts.normalizeProtocol) {
|
||||
urlString = urlString.replace(/^http:\/\//, '//');
|
||||
}
|
||||
|
||||
return urlString;
|
||||
};
|
9
web/node_modules/postcss-normalize-url/node_modules/normalize-url/license
generated
vendored
Normal file
9
web/node_modules/postcss-normalize-url/node_modules/normalize-url/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.
|
42
web/node_modules/postcss-normalize-url/node_modules/normalize-url/package.json
generated
vendored
Normal file
42
web/node_modules/postcss-normalize-url/node_modules/normalize-url/package.json
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"name": "normalize-url",
|
||||
"version": "3.3.0",
|
||||
"description": "Normalize a URL",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/normalize-url",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"normalize",
|
||||
"url",
|
||||
"uri",
|
||||
"address",
|
||||
"string",
|
||||
"normalization",
|
||||
"normalisation",
|
||||
"query",
|
||||
"querystring",
|
||||
"simplify",
|
||||
"strip",
|
||||
"trim",
|
||||
"canonical"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"coveralls": "^3.0.0",
|
||||
"nyc": "^12.0.2",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
194
web/node_modules/postcss-normalize-url/node_modules/normalize-url/readme.md
generated
vendored
Normal file
194
web/node_modules/postcss-normalize-url/node_modules/normalize-url/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,194 @@
|
|||
# normalize-url [](https://travis-ci.org/sindresorhus/normalize-url) [](https://coveralls.io/github/sindresorhus/normalize-url?branch=master)
|
||||
|
||||
> [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL
|
||||
|
||||
Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install normalize-url
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const normalizeUrl = require('normalize-url');
|
||||
|
||||
normalizeUrl('sindresorhus.com');
|
||||
//=> 'http://sindresorhus.com'
|
||||
|
||||
normalizeUrl('HTTP://xn--xample-hva.com:80/?b=bar&a=foo');
|
||||
//=> 'http://êxample.com/?a=foo&b=bar'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### normalizeUrl(url, [options])
|
||||
|
||||
#### url
|
||||
|
||||
Type: `string`
|
||||
|
||||
URL to normalize.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### defaultProtocol
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `http:`
|
||||
|
||||
##### normalizeProtocol
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Prepends `defaultProtocol` to the URL if it's protocol-relative.
|
||||
|
||||
```js
|
||||
normalizeUrl('//sindresorhus.com:80/');
|
||||
//=> 'http://sindresorhus.com'
|
||||
|
||||
normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});
|
||||
//=> '//sindresorhus.com'
|
||||
```
|
||||
|
||||
##### forceHttp
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Normalizes `https:` URLs to `http:`.
|
||||
|
||||
```js
|
||||
normalizeUrl('https://sindresorhus.com:80/');
|
||||
//=> 'https://sindresorhus.com'
|
||||
|
||||
normalizeUrl('https://sindresorhus.com:80/', {normalizeHttps: true});
|
||||
//=> 'http://sindresorhus.com'
|
||||
```
|
||||
|
||||
##### forceHttps
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Normalizes `http:` URLs to `https:`.
|
||||
|
||||
```js
|
||||
normalizeUrl('https://sindresorhus.com:80/');
|
||||
//=> 'https://sindresorhus.com'
|
||||
|
||||
normalizeUrl('http://sindresorhus.com:80/', {normalizeHttp: true});
|
||||
//=> 'https://sindresorhus.com'
|
||||
```
|
||||
|
||||
This option can't be used with the `forceHttp` option at the same time.
|
||||
|
||||
##### stripHash
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Removes hash from the URL.
|
||||
|
||||
```js
|
||||
normalizeUrl('sindresorhus.com/about.html#contact');
|
||||
//=> 'http://sindresorhus.com/about.html'
|
||||
|
||||
normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: false});
|
||||
//=> 'http://sindresorhus.com/about.html#contact'
|
||||
```
|
||||
|
||||
##### stripWWW
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Removes `www.` from the URL.
|
||||
|
||||
```js
|
||||
normalizeUrl('http://www.sindresorhus.com/about.html#contact');
|
||||
//=> 'http://sindresorhus.com/about.html#contact'
|
||||
|
||||
normalizeUrl('http://www.sindresorhus.com/about.html#contact', {stripWWW: false});
|
||||
//=> 'http://www.sindresorhus.com/about.html#contact'
|
||||
```
|
||||
|
||||
##### removeQueryParameters
|
||||
|
||||
Type: `Array<RegExp|string>`<br>
|
||||
Default: `[/^utm_\w+/i]`
|
||||
|
||||
Removes query parameters that matches any of the provided strings or regexes.
|
||||
|
||||
```js
|
||||
normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
|
||||
removeQueryParameters: ['ref']
|
||||
});
|
||||
//=> 'http://sindresorhus.com/?foo=bar'
|
||||
```
|
||||
|
||||
##### removeTrailingSlash
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Removes trailing slash.
|
||||
|
||||
**Note:** Trailing slash is always removed if the URL doesn't have a pathname.
|
||||
|
||||
```js
|
||||
normalizeUrl('http://sindresorhus.com/redirect/');
|
||||
//=> 'http://sindresorhus.com/redirect'
|
||||
|
||||
normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
|
||||
//=> 'http://sindresorhus.com/redirect/'
|
||||
|
||||
normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
|
||||
//=> 'http://sindresorhus.com'
|
||||
```
|
||||
|
||||
##### removeDirectoryIndex
|
||||
|
||||
Type: `boolean` `Array<RegExp|string>`<br>
|
||||
Default: `false`
|
||||
|
||||
Removes the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\.[a-z]+$/` is used.
|
||||
|
||||
```js
|
||||
normalizeUrl('www.sindresorhus.com/foo/default.php', {
|
||||
removeDirectoryIndex: [/^default\.[a-z]+$/]
|
||||
});
|
||||
//=> 'http://sindresorhus.com/foo'
|
||||
```
|
||||
|
||||
##### sortQueryParameters
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Sorts the query parameters alphabetically by key.
|
||||
|
||||
```js
|
||||
normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
|
||||
sortQueryParameters: false
|
||||
});
|
||||
//=> 'http://sindresorhus.com/?b=two&a=one&c=three'
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
22
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/LICENSE
generated
vendored
Normal file
22
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) Bogdan Chadkin <trysound@yandex.ru>
|
||||
|
||||
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.
|
253
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/README.md
generated
vendored
Normal file
253
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/README.md
generated
vendored
Normal file
|
@ -0,0 +1,253 @@
|
|||
# postcss-value-parser
|
||||
|
||||
[](https://travis-ci.org/TrySound/postcss-value-parser)
|
||||
|
||||
Transforms CSS declaration values and at-rule parameters into a tree of nodes, and provides a simple traversal API.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var valueParser = require('postcss-value-parser');
|
||||
var cssBackgroundValue = 'url(foo.png) no-repeat 40px 73%';
|
||||
var parsedValue = valueParser(cssBackgroundValue);
|
||||
// parsedValue exposes an API described below,
|
||||
// e.g. parsedValue.walk(..), parsedValue.toString(), etc.
|
||||
```
|
||||
|
||||
For example, parsing the value `rgba(233, 45, 66, .5)` will return the following:
|
||||
|
||||
```js
|
||||
{
|
||||
nodes: [
|
||||
{
|
||||
type: 'function',
|
||||
value: 'rgba',
|
||||
before: '',
|
||||
after: '',
|
||||
nodes: [
|
||||
{ type: 'word', value: '233' },
|
||||
{ type: 'div', value: ',', before: '', after: ' ' },
|
||||
{ type: 'word', value: '45' },
|
||||
{ type: 'div', value: ',', before: '', after: ' ' },
|
||||
{ type: 'word', value: '66' },
|
||||
{ type: 'div', value: ',', before: ' ', after: '' },
|
||||
{ type: 'word', value: '.5' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
If you wanted to convert each `rgba()` value in `sourceCSS` to a hex value, you could do so like this:
|
||||
|
||||
```js
|
||||
var valueParser = require('postcss-value-parser');
|
||||
|
||||
var parsed = valueParser(sourceCSS);
|
||||
|
||||
// walk() will visit all the of the nodes in the tree,
|
||||
// invoking the callback for each.
|
||||
parsed.walk(function (node) {
|
||||
|
||||
// Since we only want to transform rgba() values,
|
||||
// we can ignore anything else.
|
||||
if (node.type !== 'function' && node.value !== 'rgba') return;
|
||||
|
||||
// We can make an array of the rgba() arguments to feed to a
|
||||
// convertToHex() function
|
||||
var color = node.nodes.filter(function (node) {
|
||||
return node.type === 'word';
|
||||
}).map(function (node) {
|
||||
return Number(node.value);
|
||||
}); // [233, 45, 66, .5]
|
||||
|
||||
// Now we will transform the existing rgba() function node
|
||||
// into a word node with the hex value
|
||||
node.type = 'word';
|
||||
node.value = convertToHex(color);
|
||||
})
|
||||
|
||||
parsed.toString(); // #E92D42
|
||||
```
|
||||
|
||||
## Nodes
|
||||
|
||||
Each node is an object with these common properties:
|
||||
|
||||
- **type**: The type of node (`word`, `string`, `div`, `space`, `comment`, or `function`).
|
||||
Each type is documented below.
|
||||
- **value**: Each node has a `value` property; but what exactly `value` means
|
||||
is specific to the node type. Details are documented for each type below.
|
||||
- **sourceIndex**: The starting index of the node within the original source
|
||||
string. For example, given the source string `10px 20px`, the `word` node
|
||||
whose value is `20px` will have a `sourceIndex` of `5`.
|
||||
|
||||
### word
|
||||
|
||||
The catch-all node type that includes keywords (e.g. `no-repeat`),
|
||||
quantities (e.g. `20px`, `75%`, `1.5`), and hex colors (e.g. `#e6e6e6`).
|
||||
|
||||
Node-specific properties:
|
||||
|
||||
- **value**: The "word" itself.
|
||||
|
||||
### string
|
||||
|
||||
A quoted string value, e.g. `"something"` in `content: "something";`.
|
||||
|
||||
Node-specific properties:
|
||||
|
||||
- **value**: The text content of the string.
|
||||
- **quote**: The quotation mark surrounding the string, either `"` or `'`.
|
||||
- **unclosed**: `true` if the string was not closed properly. e.g. `"unclosed string `.
|
||||
|
||||
### div
|
||||
|
||||
A divider, for example
|
||||
|
||||
- `,` in `animation-duration: 1s, 2s, 3s`
|
||||
- `/` in `border-radius: 10px / 23px`
|
||||
- `:` in `(min-width: 700px)`
|
||||
|
||||
Node-specific properties:
|
||||
|
||||
- **value**: The divider character. Either `,`, `/`, or `:` (see examples above).
|
||||
- **before**: Whitespace before the divider.
|
||||
- **after**: Whitespace after the divider.
|
||||
|
||||
### space
|
||||
|
||||
Whitespace used as a separator, e.g. ` ` occurring twice in `border: 1px solid black;`.
|
||||
|
||||
Node-specific properties:
|
||||
|
||||
- **value**: The whitespace itself.
|
||||
|
||||
### comment
|
||||
|
||||
A CSS comment starts with `/*` and ends with `*/`
|
||||
|
||||
Node-specific properties:
|
||||
|
||||
- **value**: The comment value without `/*` and `*/`
|
||||
- **unclosed**: `true` if the comment was not closed properly. e.g. `/* comment without an end `.
|
||||
|
||||
### function
|
||||
|
||||
A CSS function, e.g. `rgb(0,0,0)` or `url(foo.bar)`.
|
||||
|
||||
Function nodes have nodes nested within them: the function arguments.
|
||||
|
||||
Additional properties:
|
||||
|
||||
- **value**: The name of the function, e.g. `rgb` in `rgb(0,0,0)`.
|
||||
- **before**: Whitespace after the opening parenthesis and before the first argument,
|
||||
e.g. ` ` in `rgb( 0,0,0)`.
|
||||
- **after**: Whitespace before the closing parenthesis and after the last argument,
|
||||
e.g. ` ` in `rgb(0,0,0 )`.
|
||||
- **nodes**: More nodes representing the arguments to the function.
|
||||
- **unclosed**: `true` if the parentheses was not closed properly. e.g. `( unclosed-function `.
|
||||
|
||||
Media features surrounded by parentheses are considered functions with an
|
||||
empty value. For example, `(min-width: 700px)` parses to these nodes:
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
type: 'function', value: '', before: '', after: '',
|
||||
nodes: [
|
||||
{ type: 'word', value: 'min-width' },
|
||||
{ type: 'div', value: ':', before: '', after: ' ' },
|
||||
{ type: 'word', value: '700px' }
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
`url()` functions can be parsed a little bit differently depending on
|
||||
whether the first character in the argument is a quotation mark.
|
||||
|
||||
`url( /gfx/img/bg.jpg )` parses to:
|
||||
|
||||
```js
|
||||
{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [
|
||||
{ type: 'word', sourceIndex: 5, value: '/gfx/img/bg.jpg' }
|
||||
] }
|
||||
```
|
||||
|
||||
`url( "/gfx/img/bg.jpg" )`, on the other hand, parses to:
|
||||
|
||||
```js
|
||||
{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [
|
||||
type: 'string', sourceIndex: 5, quote: '"', value: '/gfx/img/bg.jpg' },
|
||||
] }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```
|
||||
var valueParser = require('postcss-value-parser');
|
||||
```
|
||||
|
||||
### valueParser.unit(quantity)
|
||||
|
||||
Parses `quantity`, distinguishing the number from the unit. Returns an object like the following:
|
||||
|
||||
```js
|
||||
// Given 2rem
|
||||
{
|
||||
number: '2',
|
||||
unit: 'rem'
|
||||
}
|
||||
```
|
||||
|
||||
If the `quantity` argument cannot be parsed as a number, returns `false`.
|
||||
|
||||
*This function does not parse complete values*: you cannot pass it `1px solid black` and expect `px` as
|
||||
the unit. Instead, you should pass it single quantities only. Parse `1px solid black`, then pass it
|
||||
the stringified `1px` node (a `word` node) to parse the number and unit.
|
||||
|
||||
### valueParser.stringify(nodes[, custom])
|
||||
|
||||
Stringifies a node or array of nodes.
|
||||
|
||||
The `custom` function is called for each `node`; return a string to override the default behaviour.
|
||||
|
||||
### valueParser.walk(nodes, callback[, bubble])
|
||||
|
||||
Walks each provided node, recursively walking all descendent nodes within functions.
|
||||
|
||||
Returning `false` in the `callback` will prevent traversal of descendent nodes (within functions).
|
||||
You can use this feature to for shallow iteration, walking over only the *immediate* children.
|
||||
*Note: This only applies if `bubble` is `false` (which is the default).*
|
||||
|
||||
By default, the tree is walked from the outermost node inwards.
|
||||
To reverse the direction, pass `true` for the `bubble` argument.
|
||||
|
||||
The `callback` is invoked with three arguments: `callback(node, index, nodes)`.
|
||||
|
||||
- `node`: The current node.
|
||||
- `index`: The index of the current node.
|
||||
- `nodes`: The complete nodes array passed to `walk()`.
|
||||
|
||||
Returns the `valueParser` instance.
|
||||
|
||||
### var parsed = valueParser(value)
|
||||
|
||||
Returns the parsed node tree.
|
||||
|
||||
### parsed.nodes
|
||||
|
||||
The array of nodes.
|
||||
|
||||
### parsed.toString()
|
||||
|
||||
Stringifies the node tree.
|
||||
|
||||
### parsed.walk(callback[, bubble])
|
||||
|
||||
Walks each node inside `parsed.nodes`. See the documentation for `valueParser.walk()` above.
|
||||
|
||||
# License
|
||||
|
||||
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
|
28
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/index.js
generated
vendored
Normal file
28
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
var parse = require("./parse");
|
||||
var walk = require("./walk");
|
||||
var stringify = require("./stringify");
|
||||
|
||||
function ValueParser(value) {
|
||||
if (this instanceof ValueParser) {
|
||||
this.nodes = parse(value);
|
||||
return this;
|
||||
}
|
||||
return new ValueParser(value);
|
||||
}
|
||||
|
||||
ValueParser.prototype.toString = function() {
|
||||
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
||||
};
|
||||
|
||||
ValueParser.prototype.walk = function(cb, bubble) {
|
||||
walk(this.nodes, cb, bubble);
|
||||
return this;
|
||||
};
|
||||
|
||||
ValueParser.unit = require("./unit");
|
||||
|
||||
ValueParser.walk = walk;
|
||||
|
||||
ValueParser.stringify = stringify;
|
||||
|
||||
module.exports = ValueParser;
|
251
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/parse.js
generated
vendored
Normal file
251
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/parse.js
generated
vendored
Normal file
|
@ -0,0 +1,251 @@
|
|||
var openParentheses = "(".charCodeAt(0);
|
||||
var closeParentheses = ")".charCodeAt(0);
|
||||
var singleQuote = "'".charCodeAt(0);
|
||||
var doubleQuote = '"'.charCodeAt(0);
|
||||
var backslash = "\\".charCodeAt(0);
|
||||
var slash = "/".charCodeAt(0);
|
||||
var comma = ",".charCodeAt(0);
|
||||
var colon = ":".charCodeAt(0);
|
||||
var star = "*".charCodeAt(0);
|
||||
|
||||
module.exports = function(input) {
|
||||
var tokens = [];
|
||||
var value = input;
|
||||
|
||||
var next, quote, prev, token, escape, escapePos, whitespacePos;
|
||||
var pos = 0;
|
||||
var code = value.charCodeAt(pos);
|
||||
var max = value.length;
|
||||
var stack = [{ nodes: tokens }];
|
||||
var balanced = 0;
|
||||
var parent;
|
||||
|
||||
var name = "";
|
||||
var before = "";
|
||||
var after = "";
|
||||
|
||||
while (pos < max) {
|
||||
// Whitespaces
|
||||
if (code <= 32) {
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
prev = tokens[tokens.length - 1];
|
||||
if (code === closeParentheses && balanced) {
|
||||
after = token;
|
||||
} else if (prev && prev.type === "div") {
|
||||
prev.after = token;
|
||||
} else if (
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
(code === slash && value.charCodeAt(next + 1) !== star)
|
||||
) {
|
||||
before = token;
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "space",
|
||||
sourceIndex: pos,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
|
||||
// Quotes
|
||||
} else if (code === singleQuote || code === doubleQuote) {
|
||||
next = pos;
|
||||
quote = code === singleQuote ? "'" : '"';
|
||||
token = {
|
||||
type: "string",
|
||||
sourceIndex: pos,
|
||||
quote: quote
|
||||
};
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(quote, next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += quote;
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
token.value = value.slice(pos + 1, next);
|
||||
|
||||
tokens.push(token);
|
||||
pos = next + 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Comments
|
||||
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
||||
token = {
|
||||
type: "comment",
|
||||
sourceIndex: pos
|
||||
};
|
||||
|
||||
next = value.indexOf("*/", pos);
|
||||
if (next === -1) {
|
||||
token.unclosed = true;
|
||||
next = value.length;
|
||||
}
|
||||
|
||||
token.value = value.slice(pos + 2, next);
|
||||
tokens.push(token);
|
||||
|
||||
pos = next + 2;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Dividers
|
||||
} else if (code === slash || code === comma || code === colon) {
|
||||
token = value[pos];
|
||||
|
||||
tokens.push({
|
||||
type: "div",
|
||||
sourceIndex: pos - before.length,
|
||||
value: token,
|
||||
before: before,
|
||||
after: ""
|
||||
});
|
||||
before = "";
|
||||
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Open parentheses
|
||||
} else if (openParentheses === code) {
|
||||
// Whitespaces after open parentheses
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
token = {
|
||||
type: "function",
|
||||
sourceIndex: pos - name.length,
|
||||
value: name,
|
||||
before: value.slice(pos + 1, next)
|
||||
};
|
||||
pos = next;
|
||||
|
||||
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
||||
next -= 1;
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(")", next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += ")";
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
// Whitespaces before closed
|
||||
whitespacePos = next;
|
||||
do {
|
||||
whitespacePos -= 1;
|
||||
code = value.charCodeAt(whitespacePos);
|
||||
} while (code <= 32);
|
||||
if (pos !== whitespacePos + 1) {
|
||||
token.nodes = [
|
||||
{
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
value: value.slice(pos, whitespacePos + 1)
|
||||
}
|
||||
];
|
||||
} else {
|
||||
token.nodes = [];
|
||||
}
|
||||
if (token.unclosed && whitespacePos + 1 !== next) {
|
||||
token.after = "";
|
||||
token.nodes.push({
|
||||
type: "space",
|
||||
sourceIndex: whitespacePos + 1,
|
||||
value: value.slice(whitespacePos + 1, next)
|
||||
});
|
||||
} else {
|
||||
token.after = value.slice(whitespacePos + 1, next);
|
||||
}
|
||||
pos = next + 1;
|
||||
code = value.charCodeAt(pos);
|
||||
tokens.push(token);
|
||||
} else {
|
||||
balanced += 1;
|
||||
token.after = "";
|
||||
tokens.push(token);
|
||||
stack.push(token);
|
||||
tokens = token.nodes = [];
|
||||
parent = token;
|
||||
}
|
||||
name = "";
|
||||
|
||||
// Close parentheses
|
||||
} else if (closeParentheses === code && balanced) {
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
parent.after = after;
|
||||
after = "";
|
||||
balanced -= 1;
|
||||
stack.pop();
|
||||
parent = stack[balanced];
|
||||
tokens = parent.nodes;
|
||||
|
||||
// Words
|
||||
} else {
|
||||
next = pos;
|
||||
do {
|
||||
if (code === backslash) {
|
||||
next += 1;
|
||||
}
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (
|
||||
next < max &&
|
||||
!(
|
||||
code <= 32 ||
|
||||
code === singleQuote ||
|
||||
code === doubleQuote ||
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
code === slash ||
|
||||
code === openParentheses ||
|
||||
(code === closeParentheses && balanced)
|
||||
)
|
||||
);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
if (openParentheses === code) {
|
||||
name = token;
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
}
|
||||
}
|
||||
|
||||
for (pos = stack.length - 1; pos; pos -= 1) {
|
||||
stack[pos].unclosed = true;
|
||||
}
|
||||
|
||||
return stack[0].nodes;
|
||||
};
|
48
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/stringify.js
generated
vendored
Normal file
48
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/stringify.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
function stringifyNode(node, custom) {
|
||||
var type = node.type;
|
||||
var value = node.value;
|
||||
var buf;
|
||||
var customResult;
|
||||
|
||||
if (custom && (customResult = custom(node)) !== undefined) {
|
||||
return customResult;
|
||||
} else if (type === "word" || type === "space") {
|
||||
return value;
|
||||
} else if (type === "string") {
|
||||
buf = node.quote || "";
|
||||
return buf + value + (node.unclosed ? "" : buf);
|
||||
} else if (type === "comment") {
|
||||
return "/*" + value + (node.unclosed ? "" : "*/");
|
||||
} else if (type === "div") {
|
||||
return (node.before || "") + value + (node.after || "");
|
||||
} else if (Array.isArray(node.nodes)) {
|
||||
buf = stringify(node.nodes);
|
||||
if (type !== "function") {
|
||||
return buf;
|
||||
}
|
||||
return (
|
||||
value +
|
||||
"(" +
|
||||
(node.before || "") +
|
||||
buf +
|
||||
(node.after || "") +
|
||||
(node.unclosed ? "" : ")")
|
||||
);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function stringify(nodes, custom) {
|
||||
var result, i;
|
||||
|
||||
if (Array.isArray(nodes)) {
|
||||
result = "";
|
||||
for (i = nodes.length - 1; ~i; i -= 1) {
|
||||
result = stringifyNode(nodes[i], custom) + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return stringifyNode(nodes, custom);
|
||||
}
|
||||
|
||||
module.exports = stringify;
|
49
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/unit.js
generated
vendored
Normal file
49
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/unit.js
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
var minus = "-".charCodeAt(0);
|
||||
var plus = "+".charCodeAt(0);
|
||||
var dot = ".".charCodeAt(0);
|
||||
var exp = "e".charCodeAt(0);
|
||||
var EXP = "E".charCodeAt(0);
|
||||
|
||||
module.exports = function(value) {
|
||||
var pos = 0;
|
||||
var length = value.length;
|
||||
var dotted = false;
|
||||
var sciPos = -1;
|
||||
var containsNumber = false;
|
||||
var code;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code >= 48 && code <= 57) {
|
||||
containsNumber = true;
|
||||
} else if (code === exp || code === EXP) {
|
||||
if (sciPos > -1) {
|
||||
break;
|
||||
}
|
||||
sciPos = pos;
|
||||
} else if (code === dot) {
|
||||
if (dotted) {
|
||||
break;
|
||||
}
|
||||
dotted = true;
|
||||
} else if (code === plus || code === minus) {
|
||||
if (pos !== 0) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
if (sciPos + 1 === pos) pos--;
|
||||
|
||||
return containsNumber
|
||||
? {
|
||||
number: value.slice(0, pos),
|
||||
unit: value.slice(pos)
|
||||
}
|
||||
: false;
|
||||
};
|
22
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/walk.js
generated
vendored
Normal file
22
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/lib/walk.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
module.exports = function walk(nodes, cb, bubble) {
|
||||
var i, max, node, result;
|
||||
|
||||
for (i = 0, max = nodes.length; i < max; i += 1) {
|
||||
node = nodes[i];
|
||||
if (!bubble) {
|
||||
result = cb(node, i, nodes);
|
||||
}
|
||||
|
||||
if (
|
||||
result !== false &&
|
||||
node.type === "function" &&
|
||||
Array.isArray(node.nodes)
|
||||
) {
|
||||
walk(node.nodes, cb, bubble);
|
||||
}
|
||||
|
||||
if (bubble) {
|
||||
cb(node, i, nodes);
|
||||
}
|
||||
}
|
||||
};
|
58
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/package.json
generated
vendored
Normal file
58
web/node_modules/postcss-normalize-url/node_modules/postcss-value-parser/package.json
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"name": "postcss-value-parser",
|
||||
"version": "3.3.1",
|
||||
"description": "Transforms css values and at-rule params into the tree",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"devDependencies": {
|
||||
"eslint": "^5.6.1",
|
||||
"husky": "^1.0.0",
|
||||
"lint-staged": "^7.3.0",
|
||||
"prettier": "^1.4.4",
|
||||
"tap-spec": "^5.0.0",
|
||||
"tape": "^4.2.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint:prettier": "prettier '**/*.js' --list-different",
|
||||
"lint:js": "eslint . --cache",
|
||||
"lint": "yarn lint:js && yarn lint:prettier",
|
||||
"pretest": "yarn lint",
|
||||
"test": "tape test/*.js | tap-spec"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint",
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"author": "Bogdan Chadkin <trysound@yandex.ru>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/TrySound/postcss-value-parser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/TrySound/postcss-value-parser.git"
|
||||
},
|
||||
"keywords": [
|
||||
"postcss",
|
||||
"value",
|
||||
"parser"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/TrySound/postcss-value-parser/issues"
|
||||
}
|
||||
}
|
46
web/node_modules/postcss-normalize-url/package.json
generated
vendored
Normal file
46
web/node_modules/postcss-normalize-url/package.json
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "postcss-normalize-url",
|
||||
"version": "4.0.1",
|
||||
"description": "Normalize URLs with PostCSS",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
"LICENSE-MIT"
|
||||
],
|
||||
"scripts": {
|
||||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
||||
},
|
||||
"keywords": [
|
||||
"css",
|
||||
"normalize",
|
||||
"optimise",
|
||||
"optimisation",
|
||||
"postcss",
|
||||
"postcss-plugin",
|
||||
"url"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-absolute-url": "^2.0.0",
|
||||
"normalize-url": "^3.0.0",
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-value-parser": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.0.0",
|
||||
"cross-env": "^5.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"repository": "cssnano/cssnano",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue