@x12/common
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@x12/common

github npm npm

安装

npm install @x12/common --save

使用

ES7:

const { md5 } = require('@x12/common');
// or
import { md5 } from '@x12/common';

console.log(md5('1'));

具体参数

Methods

getTimestamp() → {int}

获取UNIX标准时间戳

Source:
Returns:

UNIX标准时间戳

Type
int

isBoolean(arg) → {boolean}

判断是否为布尔值

Parameters:
Name Type Description
`arg` *

任意

Source:
Returns:

是否为布尔值

Type
boolean

isEmpty(obj) → {boolean}

判断是否为空

Parameters:
Name Type Description
`obj` *

任意

Source:
Returns:

真为空,假为非空

Type
boolean

isNumber(arg) → {boolean}

判断是否为数字

Parameters:
Name Type Description
`arg` *

任意

Source:
Returns:

是否为数字

Type
boolean

isNumberString(obj) → {boolean}

判断是否为数字字符串

Parameters:
Name Type Description
`obj` *

任意

Source:
Returns:

是否为数字字符串

Type
boolean

isObject(arg) → {boolean}

判断是否为对象

Parameters:
Name Type Description
`arg` *

任意

Source:
Returns:

是否为对象

Type
boolean

isString(arg) → {boolean}

判断是否为字符串

Parameters:
Name Type Description
`arg` *

任意

Source:
Returns:

是否为字符串

Type
boolean

JSONparse(str, default) → {object}

安全处理 JSON

Parameters:
Name Type Description
`str` string

JSON字符串

`default` object

默认值 {}

Source:
Returns:

JSON对象

Type
object

License

Apache 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i @x12/common

Weekly Downloads

1

Version

0.0.1

License

Apache-2.0

Unpacked Size

21.6 kB

Total Files

25

Last publish

Collaborators

  • willin