args-to-arr
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -0,1 +1,5 @@ | ||
#v1.3.x | ||
* CDN / browser support | ||
#v1.2.x | ||
@@ -2,0 +6,0 @@ |
@@ -1,2 +0,28 @@ | ||
"use strict";var r=require("is-array-like");module.exports=function(e,t){if(!r(e))throw new TypeError(e+" can't be converted to array.");if(null==t&&(t=0),"number"!=typeof t)throw new TypeError(t+" is not a number.");for(var n=[],o=t,a=e.length;o<a;o++)n[o-t]=e[o];return n}; | ||
'use strict'; | ||
var isArrayLike = require('is-array-like'); | ||
function toArray(args, start) { | ||
if (!isArrayLike(args)) { | ||
throw new TypeError((args + " can't be converted to array.")); | ||
} | ||
if (start == null) { | ||
start = 0; | ||
} | ||
if (typeof start !== "number") { | ||
throw new TypeError((start + " is not a number.")); | ||
} | ||
var params = []; | ||
for (var index = start, len = args.length; index < len; index++) { | ||
params[index - start] = args[index]; | ||
} | ||
return params; | ||
} | ||
module.exports = toArray; | ||
//# sourceMappingURL=args-to-arr.js.map |
{ | ||
"name": "args-to-arr", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "Arguments to array, the easy way", | ||
"main": "dist/args-to-arr.js", | ||
"module": "dist/args-to-arr.mjs", | ||
"browser": "dist/args-to-arr.umd.js", | ||
"bundlib": { | ||
"name": "toArray", | ||
"umd": "dist/args-to-arr.umd.js", | ||
"equals": true | ||
@@ -22,3 +25,3 @@ }, | ||
"dev": "bundlib -dw", | ||
"build": "npm run lint && bundlib", | ||
"build": "npm run lint && bundlib -d", | ||
"test": "jest --colors", | ||
@@ -36,6 +39,7 @@ "preversion": "npm run clean && npm run build && npm test" | ||
"devDependencies": { | ||
"@types/jest": "^24.0.11", | ||
"bundlib": "^0.2.1", | ||
"@types/jest": "^24.0.12", | ||
"@types/node": "^12.0.0", | ||
"bundlib": "^0.2.4", | ||
"eslint": "^5.16.0", | ||
"jest": "^24.7.1", | ||
"jest": "^24.8.0", | ||
"tslint": "^5.16.0", | ||
@@ -42,0 +46,0 @@ "typescript": "^3.4.5" |
# args-to-arr | ||
[](https://circleci.com/gh/manferlo81/args-to-arr) [](https://greenkeeper.io/) [](https://www.npmjs.com/package/args-to-arr) [](https://codecov.io/gh/manferlo81/args-to-arr) [](https://github.com/manferlo81/args-to-arr/blob/master/LICENSE) | ||
[](https://circleci.com/gh/manferlo81/args-to-arr) [](https://greenkeeper.io/) [](https://www.npmjs.com/package/args-to-arr) [](https://david-dm.org/manferlo81/args-to-arr) [](https://david-dm.org/manferlo81/args-to-arr?type=dev) [](https://codecov.io/gh/manferlo81/args-to-arr) [](https://snyk.io/test/github/manferlo81/args-to-arr?targetFile=package.json) [](LICENSE) | ||
@@ -9,2 +9,4 @@ Arguments to array, the easy way | ||
#### npm | ||
```sh | ||
@@ -14,2 +16,8 @@ npm install args-to-arr | ||
#### jsDelivr | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/args-to-arr@1/dist/args-to-arr.umd.js"></script> | ||
``` | ||
## Usage | ||
@@ -44,2 +52,2 @@ | ||
[MIT License](https://github.com/manferlo81/args-to-arr/blob/master/LICENSE) | ||
[MIT License](LICENSE) |
declare function toArray<T>(args: ArrayLike<T>, start?: number): T[]; | ||
export = toArray; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13590
12
148
51
7