.
This commit is contained in:
6
proto.js
6
proto.js
@@ -1,3 +1,5 @@
|
||||
let warned = false
|
||||
|
||||
Object.defineProperty(Object.prototype, "copyDeep", {
|
||||
value: function() {
|
||||
return JSON.parse(JSON.stringify(this))
|
||||
@@ -83,9 +85,9 @@ Object.defineProperties(Array.prototype, {
|
||||
},
|
||||
pushUniq: {
|
||||
value: function(...vals) {
|
||||
if (!this.warned) {
|
||||
if (!warned) {
|
||||
console.warn("You should probably use a Set")
|
||||
this.warned = true
|
||||
warned = true
|
||||
}
|
||||
|
||||
return this.push(...vals.uniq().sub(this))
|
||||
|
||||
Reference in New Issue
Block a user