gukbap
v1.1.0
Published
JavaScript built-in extensions
Downloads
5
Readme
gukbap - JavaScript built-in extensions
It is an extension library that fills in the shortcomings of built-in objects.
It's like GUKBAP.
install
npm i --save gukbap
use
require("gukbap"); //Extension initialization
console.log([1, 2, 3, 4, 5].sum()); // 15
console.log("foo".reversed()); // "oof"
Object Extension
- Object.isObject(value)
- Object.fromJSONString(jsonStrng)
- Object.prototype.toJSONString()
- Object.prototype.clone()
Function Extension
Number Extension
Boolean Extension
String Extension
- String.isString(value)
- String.fromArray(array)
- String.prototype.toArray()
- String.prototype.reversed()
- String.prototype.sorted([compare])
- String.prototype.forEach(callback)
- String.prototype.map(callback)
- String.prototype.reduce(callback, acc)
- String.prototype.leftPad(length, character)
- String.prototype.rightPad(length, character)
- String.prototype.count(callback)
Encoding Extension
- String.fromUTF8Array(array)
- String.fromUTF16Array(array)
- String.fromUTF32Array(array)
- String.prototype.toUTF8Array()
- String.prototype.toUTF16Array()
- String.prototype.toUTF32Array()
Array Extension
- Array.range(begin, end)
- Array.prototype.first()
- Array.prototype.last()
- Array.prototype.empty()
- Array.prototype.clone()
- Array.prototype.reversed()
- Array.prototype.sorted([compare])
- Array.prototype.shuffle()
- Array.prototype.shuffled()
- Array.prototype.min()
- Array.prototype.max()
- Array.prototype.sum()
- Array.prototype.average()
- Array.prototype.flat()
- Array.prototype.count(callback)
Date Extension
- Date.isDate(value)
- Date.fromUnixTimestamp(unixTimestamp)
- Date.prototype.toUnixTimestamp()
- Date.prototype.getRealMonth()
- Date.prototype.setRealMonth()
- Date.prototype.addMilliSeconds(millisecond)
- Date.prototype.addSeconds(second)
- Date.prototype.addMinutes(minute)
- Date.prototype.addHours(hour)
- Date.prototype.addDate(date)
- Date.prototype.addWeek(week)
- Date.prototype.addMonth(month)
- Date.prototype.addYear(year)