# ligle-util

> ligle's utilities

Latest version **0.4.0** (published 2015-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install ligle-util
pnpm add ligle-util
yarn add ligle-util
bun add ligle-util
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2015-10-10 |
| First published | 2015-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+17 in 4 direct dependencies) |
| Install scripts | no |
| Author | crackhopper |
| Maintainers | crackhopper |
| Keywords | ligle, util |

## Links

- npm: https://www.npmjs.com/package/ligle-util
- Repository: https://github.com/a-oak/ligle-util
- Issues: https://github.com/a-oak/ligle-util/issues
- npm.io page: https://npm.io/package/ligle-util

## Dependencies (9)

- [ejs](https://npm.io/package/ejs.md) ^2.3.3
- [log4js](https://npm.io/package/log4js.md) ^0.6.26
- [moment](https://npm.io/package/moment.md) ^2.10.6
- [semver](https://npm.io/package/semver.md) ^5.0.3
- [request](https://npm.io/package/request.md) ^2.61.0
- [deepcopy](https://npm.io/package/deepcopy.md) ^0.5.0
- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^1.4.0
- [nodemailer-smtp-transport](https://npm.io/package/nodemailer-smtp-transport.md) ^1.0.3

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2015-10-10
- 0.3.2 — 2015-10-09

## README

ligle-util
====================

[![Build Status](https://travis-ci.org/a-oak/ligle-util.svg?branch=master)](https://travis-ci.org/a-oak/ligle-util)
[![Build Status](https://travis-ci.org/a-oak/ligle-util.svg?branch=develop)](https://travis-ci.org/a-oak/ligle-util)
Copyright (c) 2015 [A-Oak](http://a-oak.com/) Co. Ltd.


## 安装
`npm install ligle-util`

https://www.npmjs.com/package/ligle-util

## 简介
ligle-engine使用的通用功能函数库

## 部分文档
* [`logger`](#logger)
* [`Class`](#Class)
* [`isEmpty`](#isEmpty)
* [`configure`](#configure)

---------------------------------------

<a name="logger" />
### logger(name, level)
name:指定名字
level:指定输出等级

---------------------------------------

<a name="Class" />
### Class
这个对象用来生成类。用法：

```js
var Person = Class.extend({
  init: function(isDancing){
    this.dancing = isDancing;
  },
  dance: function(){
    return this.dancing;
  }
});
 
var Ninja = Person.extend({
  init: function(){
    this._super( false );
  },
  dance: function(){
    // Call the inherited version of dance()
    return this._super();
  },
  swingSword: function(){
    return true;
  }
});
 
var p = new Person(true);
p.dance(); // => true
 
var n = new Ninja();
n.dance(); // => false
n.swingSword(); // => true
 
// Should all be true
p instanceof Person && p instanceof Class &&
n instanceof Ninja && n instanceof Person && n instanceof Class
```
---------------------------------------

<a name="isEmpty" />
### isEmpty(obj)
判断对象是否为空

---------------------------------------

<a name="configure" />
### configure(config, name, defaultCfg)
- config:全局的配置

- name:  对config[name]项进行配置。（注意：config[name]必须是object,否则defaultCfg会覆盖它）。如果name是空字符串。那么会对整个config进行配置。

- defaultCfg: 对config[name]项的内容进行赋值，如果config[name]中相应的项已经有了，那么就不使用默认值了。

- 返回：配置好的config。

```js
var config = {a:{xx:11,yy:22},b:{}};
var defaultCfg = {xx:12,zz:23};
// 对全局config中的a项进行配置
var cfg = configure(config,'a',defaultCfg);
// 结果：{ a: { xx: 11, yy: 22, zz: 23 }, b: {} }


config = {a:11,b:22};
defaultCfg = {a:1,b:2,c:3};
cfg = configure(config,'',defaultCfg);
// 结果：{ a: 11, b: 22, c: 3 }
```

---
_Source: https://npm.io/package/ligle-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
