yeet
This commit is contained in:
18
node_modules/caller-callsite/index.js
generated
vendored
Normal file
18
node_modules/caller-callsite/index.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
const callsites = require('callsites');
|
||||
|
||||
module.exports = () => {
|
||||
const c = callsites();
|
||||
let caller;
|
||||
|
||||
for (let i = 0; i < c.length; i++) {
|
||||
const hasReceiver = c[i].getTypeName() !== null;
|
||||
|
||||
if (hasReceiver) {
|
||||
caller = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return c[caller];
|
||||
};
|
21
node_modules/caller-callsite/license
generated
vendored
Normal file
21
node_modules/caller-callsite/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.
|
8
node_modules/caller-callsite/node_modules/callsites/index.js
generated
vendored
Normal file
8
node_modules/caller-callsite/node_modules/callsites/index.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
module.exports = () => {
|
||||
const _ = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = (_, stack) => stack;
|
||||
const stack = new Error().stack.slice(1);
|
||||
Error.prepareStackTrace = _;
|
||||
return stack;
|
||||
};
|
21
node_modules/caller-callsite/node_modules/callsites/license
generated
vendored
Normal file
21
node_modules/caller-callsite/node_modules/callsites/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.
|
40
node_modules/caller-callsite/node_modules/callsites/package.json
generated
vendored
Normal file
40
node_modules/caller-callsite/node_modules/callsites/package.json
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "callsites",
|
||||
"version": "2.0.0",
|
||||
"description": "Get callsites from the V8 stack trace API",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/callsites",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"stacktrace",
|
||||
"v8",
|
||||
"callsite",
|
||||
"callsites",
|
||||
"stack",
|
||||
"trace",
|
||||
"function",
|
||||
"file",
|
||||
"line",
|
||||
"debug"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
46
node_modules/caller-callsite/node_modules/callsites/readme.md
generated
vendored
Normal file
46
node_modules/caller-callsite/node_modules/callsites/readme.md
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# callsites [](https://travis-ci.org/sindresorhus/callsites)
|
||||
|
||||
> Get callsites from the [V8 stack trace API](https://github.com/v8/v8/wiki/Stack-Trace-API)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save callsites
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const callsites = require('callsites');
|
||||
|
||||
function unicorn() {
|
||||
console.log(callsites()[0].getFileName());
|
||||
//=> '/Users/sindresorhus/dev/callsites/test.js'
|
||||
}
|
||||
|
||||
unicorn();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Returns an array of callsite objects with the following methods:
|
||||
|
||||
- `getTypeName`: returns the type of this as a string. This is the name of the function stored in the constructor field of this, if available, otherwise the object's [[Class]] internal property.
|
||||
- `getFunctionName`: returns the name of the current function, typically its name property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
|
||||
- `getMethodName`: returns the name of the property of this or one of its prototypes that holds the current function
|
||||
- `getFileName`: if this function was defined in a script returns the name of the script
|
||||
- `getLineNumber`: if this function was defined in a script returns the current line number
|
||||
- `getColumnNumber`: if this function was defined in a script returns the current column number
|
||||
- `getEvalOrigin`: if this function was created using a call to eval returns a CallSite object representing the location where eval was called
|
||||
- `isToplevel`: is this a top-level invocation, that is, is this the global object?
|
||||
- `isEval`: does this call take place in code defined by a call to eval?
|
||||
- `isNative`: is this call in native V8 code?
|
||||
- `isConstructor`: is this a constructor call?
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
44
node_modules/caller-callsite/package.json
generated
vendored
Normal file
44
node_modules/caller-callsite/package.json
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "caller-callsite",
|
||||
"version": "2.0.0",
|
||||
"description": "Get the callsite of the caller function",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/caller-callsite",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"caller",
|
||||
"calling",
|
||||
"module",
|
||||
"parent",
|
||||
"callsites",
|
||||
"callsite",
|
||||
"stacktrace",
|
||||
"stack",
|
||||
"trace",
|
||||
"function",
|
||||
"file"
|
||||
],
|
||||
"dependencies": {
|
||||
"callsites": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
41
node_modules/caller-callsite/readme.md
generated
vendored
Normal file
41
node_modules/caller-callsite/readme.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# caller-callsite [](https://travis-ci.org/sindresorhus/caller-callsite)
|
||||
|
||||
> Get the [callsite](https://github.com/sindresorhus/callsites#api) of the caller function
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save caller-callsite
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const callerCallsite = require('caller-callsite');
|
||||
|
||||
module.exports = () => {
|
||||
console.log(callerCallsite().getFileName());
|
||||
//=> '/Users/sindresorhus/dev/unicorn/bar.js'
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
// bar.js
|
||||
const foo = require('./foo');
|
||||
foo();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### callerCallsite()
|
||||
|
||||
Returns a [`callsite`](https://github.com/sindresorhus/callsites#api) object.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Reference in New Issue
Block a user