forked from enviPath/enviPy
Current Dev State
This commit is contained in:
21
static/js/ketcher2/node_modules/reload-css/LICENSE.md
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/reload-css/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2017 Jam3
|
||||
|
||||
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.
|
||||
|
||||
31
static/js/ketcher2/node_modules/reload-css/README.md
generated
vendored
Normal file
31
static/js/ketcher2/node_modules/reload-css/README.md
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
# reload-css
|
||||
|
||||
[](http://github.com/badges/stability-badges)
|
||||
|
||||
This module reloads all style sheets associated with a specified `url`. This is primarily useful for LiveReload servers that wish to update style sheets without triggering a full page refresh.
|
||||
|
||||
If you omit the `url` argument, all style sheets will be cache busted.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install reload-css --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
[](https://www.npmjs.com/package/reload-css)
|
||||
|
||||
#### `reloadCSS([url], [opt])`
|
||||
|
||||
Cache-busts the URLs for all `<link>` tags that match the specified `url`, as well as any other style sheets that `@import` the URL.
|
||||
|
||||
By default, this will only look for local style sheets (i.e. `localhost`, `127.0.0.1`, or matching the document domain). You can pass `{ local: false }` as the options to cache bust all styles.
|
||||
|
||||
In some cases, it will walk upwards to a more top-level style sheet (i.e. in a long chain of import dependencies) to ensure a consistent result across browsers. Import statements are updated in the `cssRules`, and `<link>` tags are re-attached for a clean update (no flicker/flash).
|
||||
|
||||
You can omit `url` or pass `null` as the first argument to reload all styles instead of just a target one.
|
||||
|
||||
## License
|
||||
|
||||
MIT, see [LICENSE.md](http://github.com/Jam3/reload-css/blob/master/LICENSE.md) for details.
|
||||
244
static/js/ketcher2/node_modules/reload-css/index.js
generated
vendored
Normal file
244
static/js/ketcher2/node_modules/reload-css/index.js
generated
vendored
Normal file
@ -0,0 +1,244 @@
|
||||
var qs = require('query-string');
|
||||
var URL = require('./lib/url');
|
||||
var baseHosts = getBaseHosts();
|
||||
|
||||
module.exports = function (url, opt) {
|
||||
// by default, only reloads local style sheets
|
||||
var localOnly = true;
|
||||
if (opt && opt.local === false) {
|
||||
localOnly = false;
|
||||
}
|
||||
|
||||
// determine base URL
|
||||
var baseUrl = document.location.pathname;
|
||||
var baseTag = document.querySelector('base');
|
||||
if (baseTag) {
|
||||
baseUrl = baseTag.getAttribute('href');
|
||||
var parsedBase = URL.parse(baseUrl);
|
||||
parsedBase.pathname = '/';
|
||||
parsedBase.hash = null;
|
||||
parsedBase.query = null;
|
||||
parsedBase.search = null;
|
||||
baseUrl = URL.format(parsedBase);
|
||||
}
|
||||
|
||||
// Find all <link> and <style> tags
|
||||
var nodes = [ 'link', 'style' ]
|
||||
.map(elements)
|
||||
.reduce(function (a, b) {
|
||||
return a.concat(b);
|
||||
}, [])
|
||||
.filter(function (el) {
|
||||
return filterStyleSheet(el, localOnly);
|
||||
})
|
||||
.map(function (el) {
|
||||
var data = {
|
||||
element: el
|
||||
};
|
||||
var href = el.getAttribute('href');
|
||||
if (el.tagName === 'LINK' && href) {
|
||||
data.key = URL.key(href, baseUrl);
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
// Now gather all imports in those tags
|
||||
var imports = [];
|
||||
nodes.forEach(function (node) {
|
||||
recursiveFindImports(node, node.element.sheet, imports, baseUrl);
|
||||
});
|
||||
|
||||
// Now try to update the matched URLs
|
||||
var keyToMatch = url ? URL.key(url, baseUrl) : null;
|
||||
var matchImports = imports;
|
||||
if (keyToMatch) {
|
||||
// only match target imports
|
||||
matchImports = matchImports.filter(function (imported) {
|
||||
return imported.key === keyToMatch;
|
||||
});
|
||||
}
|
||||
|
||||
// Map them to the "top most" import that needs update
|
||||
// This isn't actually the root, just the most shallow
|
||||
// style sheet we need to update for it to work in Chrome/FF/Safari
|
||||
// (Chrome has an issue where updating a deep import will break)
|
||||
matchImports = matchImports.map(getTopmostImport);
|
||||
|
||||
// Filter out any potential duplicate top most imports
|
||||
// And reverse so we update deep to shallow
|
||||
matchImports = uniq(matchImports).reverse();
|
||||
|
||||
// Now cache bust each import
|
||||
matchImports.forEach(bust);
|
||||
|
||||
// Now find any URLs referenced by a <link> tag
|
||||
var matchLinks = nodes.filter(function (node) {
|
||||
// no keyToMatch just means bust all link tags
|
||||
var isMatch = keyToMatch
|
||||
? node.key === keyToMatch
|
||||
: true;
|
||||
return node.element.tagName === 'LINK' && isMatch;
|
||||
});
|
||||
|
||||
// And re-attach each link tag
|
||||
matchLinks.forEach(function (node) {
|
||||
node.element = reattachLink(node.element);
|
||||
});
|
||||
};
|
||||
|
||||
function bust (imported) {
|
||||
if (!imported.busted) {
|
||||
imported.rule = cacheBustImportRule(imported.rule, imported.index);
|
||||
}
|
||||
imported.busted = true;
|
||||
return imported;
|
||||
}
|
||||
|
||||
function reattachLink (link, cb) {
|
||||
var href = link.getAttribute('href');
|
||||
|
||||
var cloned = link.cloneNode(false);
|
||||
cloned.href = getCacheBustUrl(href);
|
||||
|
||||
var parent = link.parentNode;
|
||||
if (parent.lastChild === link) {
|
||||
parent.appendChild(cloned);
|
||||
} else {
|
||||
parent.insertBefore(cloned, link.nextSibling);
|
||||
}
|
||||
|
||||
cloned.onload = function () {
|
||||
if (link.parentNode) link.parentNode.removeChild(link);
|
||||
if (cb) cb();
|
||||
};
|
||||
return cloned;
|
||||
}
|
||||
|
||||
function filterStyleSheet (element, localOnly) {
|
||||
if (isPrintMedia(element)) return false;
|
||||
if (element.tagName === 'LINK') {
|
||||
if (!element.getAttribute('href')) return false;
|
||||
if (localOnly && !isLocalStylesheet(element)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function isLocalStylesheet (link) {
|
||||
var href = link.getAttribute('href');
|
||||
if (!href || link.getAttribute('rel') !== 'stylesheet') return false;
|
||||
var parsed = URL.parse(href);
|
||||
if (parsed.protocol && parsed.protocol !== window.document.location.protocol) {
|
||||
// different protocol, let's assume not local
|
||||
return false;
|
||||
}
|
||||
if (parsed.host) {
|
||||
// see if domain matches
|
||||
return baseHosts.indexOf(parsed.host.toLowerCase()) >= 0;
|
||||
}
|
||||
// no host / protocol... assume relative and thus local
|
||||
return true;
|
||||
}
|
||||
|
||||
function uniq (list) {
|
||||
var result = [];
|
||||
list.forEach(function (item) {
|
||||
if (result.indexOf(item) === -1) {
|
||||
result.push(item);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function isPrintMedia (link) {
|
||||
return link.getAttribute('media') === 'print';
|
||||
}
|
||||
|
||||
function elements (tag) {
|
||||
return Array.prototype.slice.call(document.getElementsByTagName(tag));
|
||||
}
|
||||
|
||||
function getBaseHosts () {
|
||||
var baseHosts = [
|
||||
'localhost', '127.0.0.1'
|
||||
].map(function (h) {
|
||||
return h + ':' + window.document.location.port;
|
||||
});
|
||||
|
||||
// handle current
|
||||
if (window.document.location.hostname !== 'localhost') {
|
||||
baseHosts = baseHosts.concat([ window.document.location.host ]);
|
||||
}
|
||||
|
||||
// normalize case
|
||||
return baseHosts.map(function (h) {
|
||||
return h.toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
function cacheBustImportRule (rule, index) {
|
||||
var parent = rule.parentStyleSheet;
|
||||
var newHref = getCacheBustUrl(rule.href);
|
||||
|
||||
var media = '';
|
||||
try {
|
||||
media = rule.media.length
|
||||
? Array.prototype.join.call(rule.media, ', ')
|
||||
: '';
|
||||
} catch (err) {
|
||||
// might get here if permission is denied for some reason
|
||||
}
|
||||
|
||||
var newRule = '@import url("' + newHref + '") ' + media + ';';
|
||||
parent.insertRule(newRule, index);
|
||||
parent.deleteRule(index + 1);
|
||||
return parent.cssRules[index];
|
||||
}
|
||||
|
||||
function getTopmostImport (imported) {
|
||||
var topmost = imported;
|
||||
while (topmost.parentImport) {
|
||||
topmost = topmost.parentImport;
|
||||
}
|
||||
return topmost;
|
||||
}
|
||||
|
||||
function recursiveFindImports (node, styleSheet, result, baseUrl, lastImport) {
|
||||
if (!styleSheet) return;
|
||||
var rules;
|
||||
try {
|
||||
rules = styleSheet.cssRules;
|
||||
} catch (err) {
|
||||
// some sort of security error
|
||||
}
|
||||
if (!rules || rules.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
var rule = rules[i];
|
||||
if (rule.type === window.CSSRule.IMPORT_RULE) {
|
||||
var parentHref = rule.parentStyleSheet.href || document.location.href;
|
||||
var absoluteHref = URL.resolve(parentHref, rule.href);
|
||||
var key = URL.key(absoluteHref, baseUrl);
|
||||
|
||||
var newImport = {
|
||||
index: i,
|
||||
rule: rule,
|
||||
parentImport: lastImport,
|
||||
key: key,
|
||||
href: rule.href
|
||||
};
|
||||
result.push(newImport);
|
||||
recursiveFindImports(node, rule.styleSheet, result, baseUrl, newImport);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCacheBustUrl (href) {
|
||||
var parsed = URL.parse(href);
|
||||
var qsObj = qs.parse(parsed.search);
|
||||
qsObj._livereload = String(Date.now());
|
||||
parsed.query = undefined;
|
||||
parsed.search = qs.stringify(qsObj);
|
||||
return URL.format(parsed);
|
||||
}
|
||||
21
static/js/ketcher2/node_modules/reload-css/lib/url.js
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/reload-css/lib/url.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
var URL = require('url');
|
||||
|
||||
module.exports.resolve = URL.resolve.bind(URL);
|
||||
module.exports.format = URL.format.bind(URL);
|
||||
|
||||
module.exports.parse = function (url) {
|
||||
// Handle protocol-relative URLs, a browser feature
|
||||
if (url.indexOf('//') === 0) {
|
||||
url = document.location.protocol + url;
|
||||
}
|
||||
return URL.parse(url);
|
||||
};
|
||||
|
||||
module.exports.key = function (url, baseUrl) {
|
||||
// Strip hash/query and get a resolved URL pathname
|
||||
var parsed = URL.parse(url);
|
||||
url = URL.format({
|
||||
pathname: (parsed.pathname || '').replace(/\/+$/, '/')
|
||||
});
|
||||
return URL.resolve(baseUrl || document.location.pathname, url);
|
||||
};
|
||||
205
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/index.js
generated
vendored
Normal file
205
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/index.js
generated
vendored
Normal file
@ -0,0 +1,205 @@
|
||||
'use strict';
|
||||
var strictUriEncode = require('strict-uri-encode');
|
||||
var objectAssign = require('object-assign');
|
||||
|
||||
function encoderForArrayFormat(opts) {
|
||||
switch (opts.arrayFormat) {
|
||||
case 'index':
|
||||
return function (key, value, index) {
|
||||
return value === null ? [
|
||||
encode(key, opts),
|
||||
'[',
|
||||
index,
|
||||
']'
|
||||
].join('') : [
|
||||
encode(key, opts),
|
||||
'[',
|
||||
encode(index, opts),
|
||||
']=',
|
||||
encode(value, opts)
|
||||
].join('');
|
||||
};
|
||||
|
||||
case 'bracket':
|
||||
return function (key, value) {
|
||||
return value === null ? encode(key, opts) : [
|
||||
encode(key, opts),
|
||||
'[]=',
|
||||
encode(value, opts)
|
||||
].join('');
|
||||
};
|
||||
|
||||
default:
|
||||
return function (key, value) {
|
||||
return value === null ? encode(key, opts) : [
|
||||
encode(key, opts),
|
||||
'=',
|
||||
encode(value, opts)
|
||||
].join('');
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function parserForArrayFormat(opts) {
|
||||
var result;
|
||||
|
||||
switch (opts.arrayFormat) {
|
||||
case 'index':
|
||||
return function (key, value, accumulator) {
|
||||
result = /\[(\d*)\]$/.exec(key);
|
||||
|
||||
key = key.replace(/\[\d*\]$/, '');
|
||||
|
||||
if (!result) {
|
||||
accumulator[key] = value;
|
||||
return;
|
||||
}
|
||||
|
||||
if (accumulator[key] === undefined) {
|
||||
accumulator[key] = {};
|
||||
}
|
||||
|
||||
accumulator[key][result[1]] = value;
|
||||
};
|
||||
|
||||
case 'bracket':
|
||||
return function (key, value, accumulator) {
|
||||
result = /(\[\])$/.exec(key);
|
||||
key = key.replace(/\[\]$/, '');
|
||||
|
||||
if (!result) {
|
||||
accumulator[key] = value;
|
||||
return;
|
||||
} else if (accumulator[key] === undefined) {
|
||||
accumulator[key] = [value];
|
||||
return;
|
||||
}
|
||||
|
||||
accumulator[key] = [].concat(accumulator[key], value);
|
||||
};
|
||||
|
||||
default:
|
||||
return function (key, value, accumulator) {
|
||||
if (accumulator[key] === undefined) {
|
||||
accumulator[key] = value;
|
||||
return;
|
||||
}
|
||||
|
||||
accumulator[key] = [].concat(accumulator[key], value);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function encode(value, opts) {
|
||||
if (opts.encode) {
|
||||
return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function keysSorter(input) {
|
||||
if (Array.isArray(input)) {
|
||||
return input.sort();
|
||||
} else if (typeof input === 'object') {
|
||||
return keysSorter(Object.keys(input)).sort(function (a, b) {
|
||||
return Number(a) - Number(b);
|
||||
}).map(function (key) {
|
||||
return input[key];
|
||||
});
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
exports.extract = function (str) {
|
||||
return str.split('?')[1] || '';
|
||||
};
|
||||
|
||||
exports.parse = function (str, opts) {
|
||||
opts = objectAssign({arrayFormat: 'none'}, opts);
|
||||
|
||||
var formatter = parserForArrayFormat(opts);
|
||||
|
||||
// Create an object with no prototype
|
||||
// https://github.com/sindresorhus/query-string/issues/47
|
||||
var ret = Object.create(null);
|
||||
|
||||
if (typeof str !== 'string') {
|
||||
return ret;
|
||||
}
|
||||
|
||||
str = str.trim().replace(/^(\?|#|&)/, '');
|
||||
|
||||
if (!str) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
str.split('&').forEach(function (param) {
|
||||
var parts = param.replace(/\+/g, ' ').split('=');
|
||||
// Firefox (pre 40) decodes `%3D` to `=`
|
||||
// https://github.com/sindresorhus/query-string/pull/37
|
||||
var key = parts.shift();
|
||||
var val = parts.length > 0 ? parts.join('=') : undefined;
|
||||
|
||||
// missing `=` should be `null`:
|
||||
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
|
||||
val = val === undefined ? null : decodeURIComponent(val);
|
||||
|
||||
formatter(decodeURIComponent(key), val, ret);
|
||||
});
|
||||
|
||||
return Object.keys(ret).sort().reduce(function (result, key) {
|
||||
var val = ret[key];
|
||||
if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {
|
||||
// Sort object keys, not values
|
||||
result[key] = keysSorter(val);
|
||||
} else {
|
||||
result[key] = val;
|
||||
}
|
||||
|
||||
return result;
|
||||
}, Object.create(null));
|
||||
};
|
||||
|
||||
exports.stringify = function (obj, opts) {
|
||||
var defaults = {
|
||||
encode: true,
|
||||
strict: true,
|
||||
arrayFormat: 'none'
|
||||
};
|
||||
|
||||
opts = objectAssign(defaults, opts);
|
||||
|
||||
var formatter = encoderForArrayFormat(opts);
|
||||
|
||||
return obj ? Object.keys(obj).sort().map(function (key) {
|
||||
var val = obj[key];
|
||||
|
||||
if (val === undefined) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (val === null) {
|
||||
return encode(key, opts);
|
||||
}
|
||||
|
||||
if (Array.isArray(val)) {
|
||||
var result = [];
|
||||
|
||||
val.slice().forEach(function (val2) {
|
||||
if (val2 === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
result.push(formatter(key, val2, result.length));
|
||||
});
|
||||
|
||||
return result.join('&');
|
||||
}
|
||||
|
||||
return encode(key, opts) + '=' + encode(val, opts);
|
||||
}).filter(function (x) {
|
||||
return x.length > 0;
|
||||
}).join('&') : '';
|
||||
};
|
||||
21
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/license
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
76
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/package.json
generated
vendored
Normal file
76
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/package.json
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
"_from": "query-string@^4.2.3",
|
||||
"_id": "query-string@4.3.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
|
||||
"_location": "/reload-css/query-string",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "query-string@^4.2.3",
|
||||
"name": "query-string",
|
||||
"escapedName": "query-string",
|
||||
"rawSpec": "^4.2.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.2.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/reload-css"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
|
||||
"_shasum": "bbb693b9ca915c232515b228b1a02b609043dbeb",
|
||||
"_spec": "query-string@^4.2.3",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/reload-css",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/query-string/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"object-assign": "^4.1.0",
|
||||
"strict-uri-encode": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Parse and stringify URL query strings",
|
||||
"devDependencies": {
|
||||
"ava": "^0.17.0",
|
||||
"xo": "^0.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/query-string#readme",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"querystring",
|
||||
"query",
|
||||
"string",
|
||||
"qs",
|
||||
"param",
|
||||
"parameter",
|
||||
"url",
|
||||
"uri",
|
||||
"parse",
|
||||
"stringify",
|
||||
"encode",
|
||||
"decode"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "query-string",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/query-string.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "4.3.4"
|
||||
}
|
||||
184
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/readme.md
generated
vendored
Normal file
184
static/js/ketcher2/node_modules/reload-css/node_modules/query-string/readme.md
generated
vendored
Normal file
@ -0,0 +1,184 @@
|
||||
# query-string [](https://travis-ci.org/sindresorhus/query-string)
|
||||
|
||||
> Parse and stringify URL [query strings](http://en.wikipedia.org/wiki/Query_string)
|
||||
|
||||
---
|
||||
|
||||
<p align="center"><b>🔥 Want to strengthen your core JavaScript skills and master ES6?</b><br>I would personally recommend this awesome <a href="https://ES6.io/friend/AWESOME">ES6 course</a> by Wes Bos. You might also like his <a href="https://ReactForBeginners.com/friend/AWESOME">React course</a>.</p>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save query-string
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const queryString = require('query-string');
|
||||
|
||||
console.log(location.search);
|
||||
//=> '?foo=bar'
|
||||
|
||||
const parsed = queryString.parse(location.search);
|
||||
console.log(parsed);
|
||||
//=> {foo: 'bar'}
|
||||
|
||||
console.log(location.hash);
|
||||
//=> '#token=bada55cafe'
|
||||
|
||||
const parsedHash = queryString.parse(location.hash);
|
||||
console.log(parsedHash);
|
||||
//=> {token: 'bada55cafe'}
|
||||
|
||||
parsed.foo = 'unicorn';
|
||||
parsed.ilike = 'pizza';
|
||||
|
||||
const stringified = queryString.stringify(parsed);
|
||||
//=> 'foo=unicorn&ilike=pizza'
|
||||
|
||||
location.search = stringified;
|
||||
// note that `location.search` automatically prepends a question mark
|
||||
console.log(location.search);
|
||||
//=> '?foo=unicorn&ilike=pizza'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### .parse(*string*, *[options]*)
|
||||
|
||||
Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly.
|
||||
|
||||
The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`.
|
||||
|
||||
#### arrayFormat
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `'none'`
|
||||
|
||||
Supports both `index` for an indexed array representation or `bracket` for a *bracketed* array representation.
|
||||
|
||||
- `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as:
|
||||
|
||||
```js
|
||||
queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'});
|
||||
//=> foo: [1,2,3]
|
||||
```
|
||||
|
||||
- `index`: stands for parsing taking the index into account, such as:
|
||||
|
||||
```js
|
||||
queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'});
|
||||
//=> foo: [1,2,3]
|
||||
```
|
||||
|
||||
- `none`: is the **default** option and removes any bracket representation, such as:
|
||||
|
||||
```js
|
||||
queryString.parse('foo=1&foo=2&foo=3');
|
||||
//=> foo: [1,2,3]
|
||||
```
|
||||
|
||||
### .stringify(*object*, *[options]*)
|
||||
|
||||
Stringify an object into a query string, sorting the keys.
|
||||
|
||||
#### strict
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Strictly encode URI components with [strict-uri-encode](https://github.com/kevva/strict-uri-encode). It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent)
|
||||
if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option.
|
||||
|
||||
#### encode
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
[URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values.
|
||||
|
||||
#### arrayFormat
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `'none'`
|
||||
|
||||
Supports both `index` for an indexed array representation or `bracket` for a *bracketed* array representation.
|
||||
|
||||
- `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as:
|
||||
|
||||
```js
|
||||
queryString.stringify({foo: [1,2,3]}, {arrayFormat: 'bracket'});
|
||||
// => foo[]=1&foo[]=2&foo[]=3
|
||||
```
|
||||
|
||||
- `index`: stands for parsing taking the index into account, such as:
|
||||
|
||||
```js
|
||||
queryString.stringify({foo: [1,2,3]}, {arrayFormat: 'index'});
|
||||
// => foo[0]=1&foo[1]=2&foo[3]=3
|
||||
```
|
||||
|
||||
- `none`: is the __default__ option and removes any bracket representation, such as:
|
||||
|
||||
```js
|
||||
queryString.stringify({foo: [1,2,3]});
|
||||
// => foo=1&foo=2&foo=3
|
||||
```
|
||||
|
||||
### .extract(*string*)
|
||||
|
||||
Extract a query string from a URL that can be passed into `.parse()`.
|
||||
|
||||
|
||||
## Nesting
|
||||
|
||||
This module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues).
|
||||
|
||||
You're much better off just converting the object to a JSON string:
|
||||
|
||||
```js
|
||||
queryString.stringify({
|
||||
foo: 'bar',
|
||||
nested: JSON.stringify({
|
||||
unicorn: 'cake'
|
||||
})
|
||||
});
|
||||
//=> 'foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D'
|
||||
```
|
||||
|
||||
However, there is support for multiple instances of the same key:
|
||||
|
||||
```js
|
||||
queryString.parse('likes=cake&name=bob&likes=icecream');
|
||||
//=> {likes: ['cake', 'icecream'], name: 'bob'}
|
||||
|
||||
queryString.stringify({color: ['taupe', 'chartreuse'], id: '515'});
|
||||
//=> 'color=chartreuse&color=taupe&id=515'
|
||||
```
|
||||
|
||||
|
||||
## Falsy values
|
||||
|
||||
Sometimes you want to unset a key, or maybe just make it present without assigning a value to it. Here is how falsy values are stringified:
|
||||
|
||||
```js
|
||||
queryString.stringify({foo: false});
|
||||
//=> 'foo=false'
|
||||
|
||||
queryString.stringify({foo: null});
|
||||
//=> 'foo'
|
||||
|
||||
queryString.stringify({foo: undefined});
|
||||
//=> ''
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
69
static/js/ketcher2/node_modules/reload-css/package.json
generated
vendored
Normal file
69
static/js/ketcher2/node_modules/reload-css/package.json
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"_from": "reload-css@^1.0.0",
|
||||
"_id": "reload-css@1.0.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-avsRFi4jFP7M2tbcX96CH9cxgzE=",
|
||||
"_location": "/reload-css",
|
||||
"_phantomChildren": {
|
||||
"object-assign": "4.1.1",
|
||||
"strict-uri-encode": "1.1.0"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "reload-css@^1.0.0",
|
||||
"name": "reload-css",
|
||||
"escapedName": "reload-css",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/budo"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/reload-css/-/reload-css-1.0.2.tgz",
|
||||
"_shasum": "6afb11162e2314feccdad6dc5fde821fd7318331",
|
||||
"_spec": "reload-css@^1.0.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/budo",
|
||||
"author": {
|
||||
"name": "Matt DesLauriers",
|
||||
"email": "dave.des@gmail.com",
|
||||
"url": "https://github.com/mattdesl"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Jam3/reload-css/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"query-string": "^4.2.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Reloads all style sheets in the page associated with a URL",
|
||||
"devDependencies": {},
|
||||
"homepage": "https://github.com/Jam3/reload-css",
|
||||
"keywords": [
|
||||
"reload",
|
||||
"livereload",
|
||||
"live",
|
||||
"css",
|
||||
"inject",
|
||||
"css-reload",
|
||||
"css-inject",
|
||||
"lr",
|
||||
"budo",
|
||||
"development",
|
||||
"dev",
|
||||
"server"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "reload-css",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Jam3/reload-css.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.2"
|
||||
}
|
||||
Reference in New Issue
Block a user