1.0.6 • Published 2 years ago

@licq/string v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@licq/string

封装一些字符串的操作方法

NPM version NPM downloads

安装

npm i --save-dev @licq/string

API

randomString

生成指定长度的随机字符串

Returns: String
Since: v1.0.0

ParamTypeDescription
lengthNumber长度

Example

const str = require('@licq/string')
const res = str.randomString(10);
//==> eg: dUbkGTBgKN

uuid

生成uuid (v4)

Returns: uuid String
Since: v1.0.5
Example

const str = require('@licq/string')
const uuid = str.uuid()
// ==> 51001e12-509b-4f4a-ad73-8d7de4cef6bf

uuidValidate

校验是否是uuid

Returns: boolean
Since: v1.0.5

ParamType
uuidString

Example

const str = require('@licq/string')
const isUUID = str.uuidValidate('51001e12-509b-4f4a-ad73-8d7de4cef6bf');
// ==> true
const isUUID1 = str.uuidValidate('eH2dTHAoYOAaxegIeFq7bcGrGhPcfv83');
// ==> false
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago