JSPM

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

工具类

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

线上示例

工具类

change

const util = require("@soei/util");

// 或

import util from "@soei/util";

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'}