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