Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
22
Frontend-Learner/node_modules/on-change/source/smart-clone/clone/clone-weakset.js
generated
vendored
Normal file
22
Frontend-Learner/node_modules/on-change/source/smart-clone/clone/clone-weakset.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import CloneObject from './clone-object.js';
|
||||
|
||||
export default class CloneWeakSet extends CloneObject {
|
||||
constructor(value, path, argumentsList, hasOnValidate) {
|
||||
super(undefined, path, argumentsList, hasOnValidate);
|
||||
|
||||
this._argument1 = argumentsList[0];
|
||||
this._weakValue = value.has(this._argument1);
|
||||
}
|
||||
|
||||
isChanged(value, _equals) {
|
||||
return this._weakValue !== value.has(this._argument1);
|
||||
}
|
||||
|
||||
undo(object) {
|
||||
if (this._weakValue && !object.has(this._argument1)) {
|
||||
object.add(this._argument1);
|
||||
} else {
|
||||
object.delete(this._argument1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue