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 to 1.0.1-beat1

.idea/jsLibraryMappings.xml

22

package.json
{
"name": "commonly-used-utils",
"version": "1.0.0",
"version": "1.0.1-beat1",
"description": "",
"main": "src/index.ts",
"scripts": {},
"main": "dist/index.js",
"types": "type/index.d.ts",
"scripts": {
"serve": "webpack-dev-server --config webpack.dev.js",
"build": "webpack --config webpack.config.js"
},
"keywords": [],
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {},
"devDependencies": {
"clean-webpack-plugin": "^4.0.0",
"html-webpack-plugin": "^5.5.0",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
}

21

src/index.ts

@@ -1,13 +0,8 @@

export const oneDimensional = (array = [], children = 'children') => {
if (!array || !array.length) {
return []
}
return array.reduce((total, item) => {
return total.concat(
item,
item[children] && item[children].length
? oneDimensional(item[children], children)
: []
)
}, [])
}
// 常用工具
export { isPlainObject, isNil, isArray} from './utils/basics'
// 递归
export { oneDimensional, treeFindParents } from './recursion'
// 数组
export { findArrayAttr } from './array'
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