JSPM

depth-assign

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q23959F
  • License ISC

无从左到右,还是数组函数,都可以深度遍历

Package Exports

  • depth-assign

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (depth-assign) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

depth-assign

特征

  • 深度拷贝,包括Object、Array、函数类型
  • 设置递归方向,由左到右,由右到左,后者覆盖前者
  • 默认底数参数

使用方法

/**
 * 深度拷贝
 * arr:Object | Array,克隆拷贝
 * b :Boolean,设置递归方向,由左到右,由右到左,后者覆盖前者
 * def:Object({}), 传递给函数的初始值
 * 返回一个创建好的值(引用===def)
 */
depthAssign(arr, b, def = {})