mirror of
https://github.com/actions/setup-python.git
synced 2025-06-11 06:47:13 +02:00
Initial pass
This commit is contained in:
29
node_modules/import-fresh/index.js
generated
vendored
Normal file
29
node_modules/import-fresh/index.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const resolveFrom = require('resolve-from');
|
||||
const callerPath = require('caller-path');
|
||||
|
||||
module.exports = moduleId => {
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
const filePath = resolveFrom(path.dirname(callerPath()), moduleId);
|
||||
|
||||
// Delete itself from module parent
|
||||
if (require.cache[filePath] && require.cache[filePath].parent) {
|
||||
let 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
node_modules/import-fresh/license
generated
vendored
Normal file
21
node_modules/import-fresh/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.
|
84
node_modules/import-fresh/package.json
generated
vendored
Normal file
84
node_modules/import-fresh/package.json
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"import-fresh@2.0.0",
|
||||
"C:\\Users\\Administrator\\Documents\\setup-python"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "import-fresh@2.0.0",
|
||||
"_id": "import-fresh@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
|
||||
"_location": "/import-fresh",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "import-fresh@2.0.0",
|
||||
"name": "import-fresh",
|
||||
"escapedName": "import-fresh",
|
||||
"rawSpec": "2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cosmiconfig"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
|
||||
"_spec": "2.0.0",
|
||||
"_where": "C:\\Users\\Administrator\\Documents\\setup-python",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/import-fresh/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"caller-path": "^2.0.0",
|
||||
"resolve-from": "^3.0.0"
|
||||
},
|
||||
"description": "Import a module while bypassing the cache",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"optional-dev-dependency": "^2.0.1",
|
||||
"xo": "^0.18.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/import-fresh#readme",
|
||||
"keywords": [
|
||||
"require",
|
||||
"cache",
|
||||
"uncache",
|
||||
"uncached",
|
||||
"module",
|
||||
"fresh",
|
||||
"bypass"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "import-fresh",
|
||||
"optionalDevDependencies": {
|
||||
"heapdump": "^0.3.7"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/import-fresh.git"
|
||||
},
|
||||
"scripts": {
|
||||
"heapdump": "optional-dev-dependency && node heapdump.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.0.0",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"import/no-extraneous-dependencies": "off"
|
||||
}
|
||||
}
|
||||
}
|
50
node_modules/import-fresh/readme.md
generated
vendored
Normal file
50
node_modules/import-fresh/readme.md
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
# import-fresh [](https://travis-ci.org/sindresorhus/import-fresh)
|
||||
|
||||
> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching)
|
||||
|
||||
Useful for testing purposes when you need to freshly import a module.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save import-fresh
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
let i = 0;
|
||||
module.exports = () => ++i;
|
||||
```
|
||||
|
||||
```js
|
||||
const importFresh = require('import-fresh');
|
||||
|
||||
require('./foo')();
|
||||
//=> 1
|
||||
|
||||
require('./foo')();
|
||||
//=> 2
|
||||
|
||||
importFresh('./foo')();
|
||||
//=> 1
|
||||
|
||||
importFresh('./foo')();
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Reference in New Issue
Block a user