binding compiler
This commit is contained in:
parent
bb9b300d6f
commit
4d5f81f7e5
8 changed files with 188 additions and 15 deletions
|
|
@ -2,6 +2,10 @@ declare global {
|
|||
interface Map<K, V> {
|
||||
toJSON(): Record<string, V>
|
||||
}
|
||||
|
||||
interface Array<T> {
|
||||
lastItem(): T
|
||||
}
|
||||
}
|
||||
|
||||
Map.prototype.toJSON = function () {
|
||||
|
|
@ -9,3 +13,7 @@ Map.prototype.toJSON = function () {
|
|||
this.forEach((value, key) => (obj[key] = value))
|
||||
return obj
|
||||
}
|
||||
|
||||
Array.prototype.lastItem = function () {
|
||||
return this[this.length - 1]
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue