shuyar-util

0.0.4 • Public • Published

#shuyar-util

Libs

  • random
  • object

random

  • random.number(n)

返回长度为n的整形数字字符串

random.number(16)
//=> '3451764223744659'

  • random.lower(n)

返回长度为n的小写字母随机字符串

random.lower(16)
//=> 'sheygajeuthiwjgy'

  • random.upper(n)

返回长度为n的大写字母随机字符串

random.upper(16)
//=> 'MSHUBYAOEPKGUSYE'

  • random.letter(n)

返回长度为n的大小写字母随机的字符串

random.letters(16)
//=> 'sWeySajeDthNRgyP'

  • random.alpha(n)

返回长度为n的alpha-numeric随机字符串

random.alphaNum(16)
//=> 'whAG45Hsu8g2H9Js'

  • random.any(n)

返回长度为n的任意合法字符组成的字符串

random.any(16)
//=> 'f$TH@5Hag!s*GwlT'

object

  • object.equals(obj1, obj2)

判断两个对象是否相等

object.equals(obj1, obj2)
//=> true || false

  • object.merge(obj1, obj2)

将obj2合并到obj1,如果obj1存在属性,则用obj2的覆盖,否则在obj1增加新属性

object.merge(obj1, obj2)
//=> new Object

/shuyar-util/

    Package Sidebar

    Install

    npm i shuyar-util

    Weekly Downloads

    1

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • shuyar