New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

args-to-arr

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

args-to-arr - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

17

dist/index.cjs.js
'use strict';
function toArray(args, start) {
start = start || 0;
if (!(args && "length" in args && typeof args.length === "number")) {
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;
}

@@ -11,0 +26,0 @@

function toArray(args, start) {
start = start || 0;
if (!(args && "length" in args && typeof args.length === "number")) {
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;
}

@@ -9,0 +24,0 @@

13

package.json
{
"name": "args-to-arr",
"version": "0.0.1",
"version": "1.0.0",
"description": "Arguments to array, the easy way",

@@ -8,7 +8,14 @@ "main": "dist/index.cjs.js",

"types": "types/index.d.ts",
"keywords": [],
"keywords": [
"arguments",
"params",
"array",
"convert",
"slice"
],
"scripts": {
"dev": "rollup -cw",
"build": "rollup -c",
"test": "jest"
"clean": "rm -rf dist coverage",
"test": "jest --colors"
},

@@ -15,0 +22,0 @@ "files": [

# args-to-arr
[![CircleCI](https://circleci.com/gh/manferlo81/args-to-arr.svg?style=svg)](https://circleci.com/gh/manferlo81/args-to-arr) [![Greenkeeper badge](https://badges.greenkeeper.io/manferlo81/args-to-arr.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/args-to-arr.svg)](https://www.npmjs.com/package/args-to-arr) [![codecov](https://codecov.io/gh/manferlo81/args-to-arr/branch/master/graph/badge.svg)](https://codecov.io/gh/manferlo81/args-to-arr) [![GitHub](https://img.shields.io/github/license/manferlo81/args-to-arr.svg)](https://github.com/manferlo81/args-to-arr/blob/master/LICENSE)
Arguments to array, the easy way

@@ -16,3 +18,3 @@

```typescript
toArray<T>(arr: ArrayLike<T>, start?: number): T[];
toArray<T>(arr: ArrayLike<T>, start: number = 0): T[];
```

@@ -41,2 +43,2 @@

MIT License
[MIT License](https://github.com/manferlo81/args-to-arr/blob/master/LICENSE)
export default function toArray(args, start) {
start = start || 0;
if (!(args && "length" in args && typeof args.length === "number")) {
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.`);
}
const params = [];
for (let index = start, len = args.length; index < len; index++) {
params[index - start] = args[index];
}
return params;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc