JSPM

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

Extend nodejs util api, and it is light weight and simple

Package Exports

  • utils-extend

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 (utils-extend) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

utils-extend

Strengthen the ability of util. utils extend node util origin module

var util = require('utils-extend');

install

npm install utils-extend --save

API

util.extend

Deep clone soure object to target

var target = {};
var source = {
  k: 'v',
  k2: []
};
var source2 = {
  k3: { }  
};

util.extend(target, source, source2);

util.isObject

Check target is object, array and function return false.

util.isArray

Chck target is array

uitl.isArray = Array.isArray

util.isFunction

util.isString

util.isUndefined

util.noop

util.unique

Make array unique.

var arr = [4, 5, 5, 6];
var result = uitl.unique(arr);

util.path.isAbsolute

Return true is path isabsolute, otherwise return false.

util.path.isAbsolute('C:\\file\\path');          // windows
util.path.isAbsolute('/file/path');              // unix

util.path.unixifyPath

Normalize \ paths to / paths.