Skip to content

collecting some useful function in order to rising up efficiency in developing.

Notifications You must be signed in to change notification settings

shudery/toolKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

daguo的工具库

toolkit license

这个仓库收集存放了一些我平时开发常用的方法函数,慢慢积累,不断提高开发效率!

  • injection
  • extend
  • getPath
  • tryBlock
  • log
  • clone
  • queryStr
  • queryPrase

injection(module, ...or [module,alias])

模块注入器

var fs = require('fs');
var http = require('http');
var exp = require('express');
// 简写为
var inject = require('daguo').injection;
inject('fs','http',['express','exp'])

extend(base, ext, isUpdate, isPoint)

传入的参数分别为基本对象,扩展对象,是否更新,是否传递指针,不更新将只添加扩展对象中基本对象没有的属性,传递指针则修改后的对象将影响原对象。

var base = {name:'daguo',age:22};
var ext = {age:21,sex:'boy'};
// 不更新原对象的属性
var obj = extend(base,ext);
//{name:'daguo',age:22,sex:'boy'};
// 更新属性
var obj = extend(base,ext,true);
//{name:'daguo',age:21,sex:'boy'};

About

collecting some useful function in order to rising up efficiency in developing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published