1
0

run npm install to generate a package lock

This commit is contained in:
sashinexists
2024-12-07 13:18:31 +11:00
parent e7d08a91b5
commit 23437d228e
2501 changed files with 290663 additions and 0 deletions

81
node_modules/watcher/dist/lazy_map_set.js generated vendored Normal file
View File

@@ -0,0 +1,81 @@
/* IMPORT */
import Utils from './utils.js';
/* MAIN */
//TODO: Maybe publish this as a standalone module
class LazyMapSet {
constructor() {
/* VARIABLES */
this.map = new Map();
}
/* API */
clear() {
this.map.clear();
}
delete(key, value) {
if (Utils.lang.isUndefined(value)) {
return this.map.delete(key);
}
else if (this.map.has(key)) {
const values = this.map.get(key);
if (Utils.lang.isSet(values)) {
const deleted = values.delete(value);
if (!values.size) {
this.map.delete(key);
}
return deleted;
}
else if (values === value) {
this.map.delete(key);
return true;
}
}
return false;
}
find(key, iterator) {
if (this.map.has(key)) {
const values = this.map.get(key);
if (Utils.lang.isSet(values)) {
return Array.from(values).find(iterator);
}
else if (iterator(values)) { //TSC
return values;
}
}
return undefined;
}
get(key) {
return this.map.get(key);
}
has(key, value) {
if (Utils.lang.isUndefined(value)) {
return this.map.has(key);
}
else if (this.map.has(key)) {
const values = this.map.get(key);
if (Utils.lang.isSet(values)) {
return values.has(value);
}
else {
return (values === value);
}
}
return false;
}
set(key, value) {
if (this.map.has(key)) {
const values = this.map.get(key);
if (Utils.lang.isSet(values)) {
values.add(value);
}
else if (values !== value) {
this.map.set(key, new Set([values, value])); //TSC
}
}
else {
this.map.set(key, value);
}
return this;
}
}
/* EXPORT */
export default LazyMapSet;