Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commonly-used-utils

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonly-used-utils - npm Package Compare versions

Comparing version 1.0.0-beat8 to 1.0.0-beat9

2

package.json
{
"name": "commonly-used-utils",
"version": "1.0.0-beat8",
"version": "1.0.0-beat9",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

import { isObject, type } from './utils/basics'
export const oneDimensional = (
export const oneDimensional: (array?: any[], children?: string | 'children') => (any[]) = (
array: any[] = [],
children = 'children'
) => {
if (!array || !array.length) {
return []
}
if (!array || !array.length) { return [] }
return array.reduce(

@@ -11,0 +9,0 @@ (total, item) => total.concat(item, item?.[children]?.length ? oneDimensional(item[children], children): []),

@@ -10,3 +10,3 @@

children?: 'children' | string
): any[] | void
): any[]
export function TreeFindParents (

@@ -30,3 +30,3 @@ array: any[],

export function removeItem(...param)
export function sleep(time?: number)
export function sleep(time?: number): void

@@ -37,2 +37,5 @@ export class NotRepeatedArray {

removeItem(...param)
}
}
export function setTreeAttr(array, callback, children?: 'children' | string)
export function deleteRecursively(array, callback, children?: 'children' | string)
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