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

helpful-functions

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

helpful-functions - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

9

dist/index.d.ts

@@ -6,3 +6,12 @@ /**

* @returns true or false answering the question -> isEmpty?
*
*/
export declare const isEmpty: (array: any[]) => boolean;
/**
* Creates a deep copy of an array
*
* @param array given any type of array
* @returns new copy of the array with value semantics
*
*/
export declare const copyArray: (array: any[]) => any;

12

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEmpty = void 0;
exports.copyArray = exports.isEmpty = void 0;
/**

@@ -9,5 +9,15 @@ * Function that returns if the array is empty or not

* @returns true or false answering the question -> isEmpty?
*
*/
const isEmpty = (array) => !(array.length > 0);
exports.isEmpty = isEmpty;
/**
* Creates a deep copy of an array
*
* @param array given any type of array
* @returns new copy of the array with value semantics
*
*/
const copyArray = (array) => JSON.parse(JSON.stringify(array));
exports.copyArray = copyArray;
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "helpful-functions",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/",

@@ -6,3 +6,18 @@ /**

* @returns true or false answering the question -> isEmpty?
*
*/
export const isEmpty = (array: any[]): boolean => !(array.length > 0);
export const isEmpty = <T>(array: T[]): boolean => !(array.length > 0);
/**
* Creates a deep copy of an array
*
* @param array given any type of array
* @returns new copy of the array with value semantics
*
*/
export const copyArray = <T>(array: T[]): T[] =>
JSON.parse(JSON.stringify(array));
// const main = () => {
// };
// main();

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