refactor(Cypress): add nodemodules
This commit is contained in:
21
node_modules/util-arity/LICENSE
generated
vendored
Normal file
21
node_modules/util-arity/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.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.
|
52
node_modules/util-arity/README.md
generated
vendored
Normal file
52
node_modules/util-arity/README.md
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
# Arity
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![NPM downloads][downloads-image]][downloads-url]
|
||||
[![Build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
> Set a functions arity (the argument count) by proxying function calls.
|
||||
|
||||
**P.S.** If you need need to enforce arity and don't care about argument length or `this`, use [`nary`](https://github.com/blakeembrey/nary). It's magnitudes faster than using `.apply` to proxy arguments.
|
||||
|
||||
## When would I use this?
|
||||
|
||||
It's unlikely you'll need to use this utility in everyday development. The reason I wrote it was for functional utilities and backward compatibility with user expectations. For example, many modules use function arity to decide how the function behaves (e.g. error middleware in `express`, callbacks in `mocha`).
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install util-arity --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var fn = function () {};
|
||||
var arity = require('util-arity');
|
||||
|
||||
var oneArg = arity(1, fn);
|
||||
var twoArgs = arity(2, fn);
|
||||
var threeArgs = arity(3, fn);
|
||||
|
||||
oneArgs.length; //=> 1
|
||||
twoArgs.length; //=> 2
|
||||
threeArgs.length; //=> 3
|
||||
```
|
||||
|
||||
## TypeScript
|
||||
|
||||
The typings for this project are available for node module resolution with TypeScript.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/util-arity.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/util-arity
|
||||
[downloads-image]: https://img.shields.io/npm/dm/util-arity.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/util-arity
|
||||
[travis-image]: https://img.shields.io/travis/blakeembrey/arity.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/blakeembrey/arity
|
||||
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/arity.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/blakeembrey/arity?branch=master
|
3
node_modules/util-arity/arity.d.ts
generated
vendored
Normal file
3
node_modules/util-arity/arity.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare function arity (arity: number, fn: (...args: any[]) => any): (...args: any[]) => any;
|
||||
|
||||
export = arity;
|
29
node_modules/util-arity/arity.js
generated
vendored
Normal file
29
node_modules/util-arity/arity.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
var FUNCTIONS = {};
|
||||
|
||||
/**
|
||||
* Create a function wrapper that specifies the argument length.
|
||||
*
|
||||
* @param {number} arity
|
||||
* @param {Function} fn
|
||||
* @return {Function}
|
||||
*/
|
||||
module.exports = function (arity, fn) {
|
||||
if (!FUNCTIONS[arity]) {
|
||||
var params = [];
|
||||
|
||||
if (typeof arity !== 'number') {
|
||||
throw new TypeError('Expected arity to be a number, got ' + arity);
|
||||
}
|
||||
|
||||
for (var i = 0; i < arity; i++) {
|
||||
params.push('_' + i);
|
||||
}
|
||||
|
||||
FUNCTIONS[arity] = new Function(
|
||||
'fn',
|
||||
'return function arity' + arity + ' (' + params.join(', ') + ') { return fn.apply(this, arguments); }'
|
||||
);
|
||||
}
|
||||
|
||||
return FUNCTIONS[arity](fn);
|
||||
};
|
64
node_modules/util-arity/package.json
generated
vendored
Normal file
64
node_modules/util-arity/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"_from": "util-arity@^1.0.2",
|
||||
"_id": "util-arity@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-WdAa8f2z/t4KxOYysKtfbOl8kzA=",
|
||||
"_location": "/util-arity",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "util-arity@^1.0.2",
|
||||
"name": "util-arity",
|
||||
"escapedName": "util-arity",
|
||||
"rawSpec": "^1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cucumber"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz",
|
||||
"_shasum": "59d01af1fdb3fede0ac4e632b0ab5f6ce97c9330",
|
||||
"_spec": "util-arity@^1.0.2",
|
||||
"_where": "/home/simon/Documents/lifen-autotest/node_modules/cucumber",
|
||||
"author": {
|
||||
"name": "Blake Embrey",
|
||||
"email": "hello@blakeembrey.com",
|
||||
"url": "http://blakeembrey.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/blakeembrey/arity/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Set the length of a function.",
|
||||
"devDependencies": {
|
||||
"istanbul": "~0.4.5",
|
||||
"mocha": "~3.2.0"
|
||||
},
|
||||
"files": [
|
||||
"arity.d.ts",
|
||||
"arity.js"
|
||||
],
|
||||
"homepage": "https://github.com/blakeembrey/arity",
|
||||
"keywords": [
|
||||
"arity",
|
||||
"function",
|
||||
"length",
|
||||
"arguments",
|
||||
"count"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "arity.js",
|
||||
"name": "util-arity",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/blakeembrey/arity.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "istanbul cover _mocha -- -R spec"
|
||||
},
|
||||
"typings": "arity.d.ts",
|
||||
"version": "1.1.0"
|
||||
}
|
Reference in New Issue
Block a user