forked from enviPath/enviPy
Current Dev State
This commit is contained in:
29
static/js/ketcher2/node_modules/require-uncached/index.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/require-uncached/index.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
var resolveFrom = require('resolve-from');
|
||||
var callerPath = require('caller-path');
|
||||
|
||||
module.exports = function (moduleId) {
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
var filePath = resolveFrom(path.dirname(callerPath()), moduleId);
|
||||
|
||||
// delete itself from module parent
|
||||
if (require.cache[filePath] && require.cache[filePath].parent) {
|
||||
var i = require.cache[filePath].parent.children.length;
|
||||
|
||||
while (i--) {
|
||||
if (require.cache[filePath].parent.children[i].id === filePath) {
|
||||
require.cache[filePath].parent.children.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// delete module from cache
|
||||
delete require.cache[filePath];
|
||||
|
||||
// return fresh module
|
||||
return require(filePath);
|
||||
};
|
||||
21
static/js/ketcher2/node_modules/require-uncached/license
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/require-uncached/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.
|
||||
77
static/js/ketcher2/node_modules/require-uncached/package.json
generated
vendored
Normal file
77
static/js/ketcher2/node_modules/require-uncached/package.json
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"_from": "require-uncached@^1.0.2",
|
||||
"_id": "require-uncached@1.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
|
||||
"_location": "/require-uncached",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "require-uncached@^1.0.2",
|
||||
"name": "require-uncached",
|
||||
"escapedName": "require-uncached",
|
||||
"rawSpec": "^1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/eslint"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
|
||||
"_shasum": "4e0d56d6c9662fd31e43011c4b95aa49955421d3",
|
||||
"_spec": "require-uncached@^1.0.2",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/eslint",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/require-uncached/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"caller-path": "^0.1.0",
|
||||
"resolve-from": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Require a module bypassing the cache",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"heapdump": "^0.3.7",
|
||||
"xo": "^0.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/require-uncached#readme",
|
||||
"keywords": [
|
||||
"require",
|
||||
"cache",
|
||||
"uncache",
|
||||
"uncached",
|
||||
"module",
|
||||
"fresh",
|
||||
"bypass"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "require-uncached",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/require-uncached.git"
|
||||
},
|
||||
"scripts": {
|
||||
"heapdump": "node heapdump.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.3",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"import/no-dynamic-require": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
47
static/js/ketcher2/node_modules/require-uncached/readme.md
generated
vendored
Normal file
47
static/js/ketcher2/node_modules/require-uncached/readme.md
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# require-uncached [](https://travis-ci.org/sindresorhus/require-uncached)
|
||||
|
||||
> Require a module bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching)
|
||||
|
||||
Useful for testing purposes when you need to freshly require a module.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save require-uncached
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
let i = 0;
|
||||
module.exports = () => ++i;
|
||||
```
|
||||
|
||||
```js
|
||||
const requireUncached = require('require-uncached');
|
||||
|
||||
require('./foo')();
|
||||
//=> 1
|
||||
|
||||
require('./foo')();
|
||||
//=> 2
|
||||
|
||||
requireUncached('./foo')();
|
||||
//=> 1
|
||||
|
||||
requireUncached('./foo')();
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [clear-require](https://github.com/sindresorhus/clear-require) - Clear a module from the require cache
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user