@rjgf/utils
Advanced tools
Comparing version 0.1.26 to 0.1.27
@@ -1,14 +0,2 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./tree"), exports); | ||
export * from './tree'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.remake = exports.walk = exports.cherryPick = void 0; | ||
import { cloneDeep } from 'lodash-es'; | ||
/** | ||
@@ -9,3 +7,3 @@ * 在一个树状结构中,摘取其中的几个字段 | ||
*/ | ||
function cherryPick(list, ...keys) { | ||
export function cherryPick(list, ...keys) { | ||
var _a; | ||
@@ -28,3 +26,2 @@ const result = []; | ||
} | ||
exports.cherryPick = cherryPick; | ||
/** | ||
@@ -35,3 +32,3 @@ * 遍历一个树节点 | ||
*/ | ||
function walk(list, cb, parent) { | ||
export function walk(list, cb, parent) { | ||
var _a; | ||
@@ -45,3 +42,2 @@ for (const item of list) { | ||
} | ||
exports.walk = walk; | ||
/** | ||
@@ -52,7 +48,7 @@ * 重新制作一颗树节点,既 A 树转换成 B 树 | ||
*/ | ||
function remake(list, cb, parent) { | ||
export function remake(list, cb, parent) { | ||
var _a; | ||
let index = 0; | ||
for (const item of list) { | ||
const newItem = cb(item, parent); | ||
const newItem = cb(cloneDeep(item), parent); | ||
// @ts-expect-error ignore | ||
@@ -68,3 +64,2 @@ list[index] = newItem; | ||
} | ||
exports.remake = remake; | ||
//# sourceMappingURL=tree.js.map |
@@ -13,5 +13,6 @@ { | ||
], | ||
"gitHead": "8f1d9efd4ed39ee1f567d594e2436c068eab6ef6", | ||
"gitHead": "004c797edae6962ec916bd1271b184defb05162b", | ||
"license": "Apache-2.0", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"name": "@rjgf/utils", | ||
@@ -28,3 +29,9 @@ "publishConfig": { | ||
}, | ||
"version": "0.1.26" | ||
"version": "0.1.27", | ||
"dependencies": { | ||
"lodash-es": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash-es": "^4.17.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16298
1
1
82
+ Addedlodash-es@^4.17.21
+ Addedlodash-es@4.17.21(transitive)