mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-06-08 09:54:28 +00:00
v7
This commit is contained in:
parent
033d472283
commit
49df04613e
6774 changed files with 1602535 additions and 1 deletions
6
node_modules/get-caller-file/LICENSE.md
generated
vendored
Normal file
6
node_modules/get-caller-file/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
ISC License (ISC)
|
||||
Copyright 2018 Stefan Penner
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
41
node_modules/get-caller-file/README.md
generated
vendored
Normal file
41
node_modules/get-caller-file/README.md
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# get-caller-file
|
||||
|
||||
[](https://travis-ci.org/stefanpenner/get-caller-file)
|
||||
[](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)
|
||||
|
||||
This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked.
|
||||
|
||||
Inspired by http://stackoverflow.com/questions/13227489
|
||||
|
||||
*note: this relies on Node/V8 specific APIs, as such other runtimes may not work*
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add get-caller-file
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Given:
|
||||
|
||||
```js
|
||||
// ./foo.js
|
||||
const getCallerFile = require('get-caller-file');
|
||||
|
||||
module.exports = function() {
|
||||
return getCallerFile(); // figures out who called it
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
// index.js
|
||||
const foo = require('./foo');
|
||||
|
||||
foo() // => /full/path/to/this/file/index.js
|
||||
```
|
||||
|
||||
|
||||
## Options:
|
||||
|
||||
* `getCallerFile(position = 2)`: where position is stack frame whos fileName we want.
|
2
node_modules/get-caller-file/index.d.ts
generated
vendored
Normal file
2
node_modules/get-caller-file/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
declare const _default: (position?: number) => any;
|
||||
export = _default;
|
22
node_modules/get-caller-file/index.js
generated
vendored
Normal file
22
node_modules/get-caller-file/index.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
// Call this function in a another function to find out the file from
|
||||
// which that function was called from. (Inspects the v8 stack trace)
|
||||
//
|
||||
// Inspired by http://stackoverflow.com/questions/13227489
|
||||
module.exports = function getCallerFile(position) {
|
||||
if (position === void 0) { position = 2; }
|
||||
if (position >= Error.stackTraceLimit) {
|
||||
throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`');
|
||||
}
|
||||
var oldPrepareStackTrace = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = function (_, stack) { return stack; };
|
||||
var stack = new Error().stack;
|
||||
Error.prepareStackTrace = oldPrepareStackTrace;
|
||||
if (stack !== null && typeof stack === 'object') {
|
||||
// stack[0] holds this file
|
||||
// stack[1] holds where this function was called
|
||||
// stack[2] holds the file we're interested in
|
||||
return stack[position] ? stack[position].getFileName() : undefined;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/get-caller-file/index.js.map
generated
vendored
Normal file
1
node_modules/get-caller-file/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAE1D,iBAAS,SAAS,aAAa,CAAC,QAAY;IAAZ,yBAAA,EAAA,YAAY;IAC1C,IAAI,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE;QACrC,MAAM,IAAI,SAAS,CAAC,kGAAkG,GAAG,QAAQ,GAAG,oCAAoC,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC;KACzM;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,KAAK,CAAC,iBAAiB,GAAG,UAAC,CAAC,EAAE,KAAK,IAAM,OAAA,KAAK,EAAL,CAAK,CAAC;IAC/C,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAChC,KAAK,CAAC,iBAAiB,GAAG,oBAAoB,CAAC;IAG/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC/C,2BAA2B;QAC3B,gDAAgD;QAChD,8CAA8C;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,QAAQ,CAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;AACH,CAAC,CAAC"}
|
42
node_modules/get-caller-file/package.json
generated
vendored
Normal file
42
node_modules/get-caller-file/package.json
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"name": "get-caller-file",
|
||||
"version": "2.0.5",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.js.map",
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "tsc",
|
||||
"test": "mocha test",
|
||||
"test:debug": "mocha test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/stefanpenner/get-caller-file.git"
|
||||
},
|
||||
"author": "Stefan Penner",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/stefanpenner/get-caller-file/issues"
|
||||
},
|
||||
"homepage": "https://github.com/stefanpenner/get-caller-file#readme",
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.1.7",
|
||||
"@types/ensure-posix-path": "^1.0.0",
|
||||
"@types/mocha": "^5.2.6",
|
||||
"@types/node": "^11.10.5",
|
||||
"chai": "^4.1.2",
|
||||
"ensure-posix-path": "^1.0.1",
|
||||
"mocha": "^5.2.0",
|
||||
"typescript": "^3.3.3333"
|
||||
},
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue