Package Exports
- @soei/util
- @soei/util/index.js
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 (@soei/util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
工具类
const util = require("@soei/util");
// 或
import util from "@soei/util";change
let change = util.change;
let a = change({
source: [new Date(), new Date()],
pick: {},
name: "0=>name,1=>value",
m: "YYYY/MM-DD hh:mm:ss",
});
console.log(a);
// { name: '2016/10-22 14:54:27', value: '2016/10-22 14:54:27' }
let a = change({
source: new Date(),
pick: {},
name: "0=>name,1=>value",
m: "YYYY",
});
// 或
let a = {};
change({
source: new Date(),
pick: a,
name: "0=>name,1=>value",
m: "YYYY",
});
console.log(a);
// { name: '2016'}reset
let reset = util.reset;
let data = {
name: "balabal",
age: 1,
};
reset(
data,
/* ignore 忽略的属性 */
{
age: null,
}
);
/*
{
name: "",
age: 1,
}
*/