README
String
- randomString [get random n length string from str pool]
Params:
- length wanna random string length
- format your str pool
usage : randomString(length,format)
Array
- isArray [check input is array type]
usage : isArray(array)
- shuffle [shuffle array element]
usage : shuffle(array)
Number
- isNumber [check input is number type]
usage : isNumber(number)
- random [get a random number between min,max]
Params:
- min random number minium
- max random number maximum
usage : random(min,max)
- isRandomIn [check input percentage is pass]
Params:
usage : isRandomIn(number)
Object
- isObject [check input is object type]
usage : isObject(obj)
- deepCloneObject [deep clone obj]
usage : deepCloneObject(obj)
- faltten [faltten the nest object]
Params:
- obj your nest object
- parseObjOnly is parse object only
enum:[true,false]if true ignore parse your nest object array field
usage : faltten({obj,parseObjOnly})
Time
- convertTimestampToDateString [convert timestamp to your server time zone date format] (YYYY-MM-DD HH:mm:ss)
usage : convertTimestampToDateString(timestamp)
- convertTimestampToUTCDateString [convert timestamp to UTC+0 date format] (YYYY-MM-DD HH:mm:ss)
usage : convertTimestampToUTCDateString(timestamp)
- convertDateStringToTimestamp [convert date to timestamp(s)]
usage : convertDateStringToTimestamp(date)
- returnNextYear [get next year timestamp(s)]
usage : returnNextYear(timestamp)
- returnPreviousYear [get previous year timestamp(s)]
usage : returnPreviousYear(timestamp)
- returnNextDay [get next day timestamp(s)]
usage : returnNextDay(timestamp)
- returnPreviousDay [get previous day timestamp(s)]
usage : returnPreviousDay(timestamp)
- returnNowTime [get now UTC+0 timestamp(s)]
usage : returnNowTime()
- returnStartOfToday [get start of day UTC+0 timestamp(s)]
usage : returnStartOfToday()
- returnStartOfWeek [get start of week UTC+0 timestamp(s) ]
Params:
- time wanna idx date timestamp
- weekIdx set start day of week enum:["mon","tue","wed","thur","fri","sat","sun"]
usage : returnStartOfWeek(time,weekIdx)
- returnEndOfWeek [get end of week UTC+0 timestamp(s) ]
Params:
- time wanna idx date timestamp
- weekIdx set start day of week enum:["mon","tue","wed","thur","fri","sat","sun"]
usage : returnEndOfWeek(time,weekIdx)
- wait [wait milliseconds]
usage : wait(milliseconds)