From e095f7974358e77535617c56361936e646c8a796 Mon Sep 17 00:00:00 2001 From: Holly Date: Tue, 2 Jul 2024 09:57:50 +0100 Subject: [PATCH] remove build files --- .gitignore | 2 ++ lib/funkyArray.d.ts | 14 --------- lib/funkyArray.js | 74 --------------------------------------------- 3 files changed, 2 insertions(+), 88 deletions(-) delete mode 100644 lib/funkyArray.d.ts delete mode 100644 lib/funkyArray.js diff --git a/.gitignore b/.gitignore index ceaea36..78aba36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +lib/* + # ---> Node # Logs logs diff --git a/lib/funkyArray.d.ts b/lib/funkyArray.d.ts deleted file mode 100644 index 6844694..0000000 --- a/lib/funkyArray.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export default class FunkyArray { - private items; - private itemKeys; - private _getKeys; - set(key: T, item: TT, regenerate?: boolean): TT; - remove(key: T, regenerate?: boolean): boolean; - removeFirst(regenerate?: boolean): boolean; - first(): TT; - get length(): number; - get(key: T): TT | undefined; - has(key: T): boolean; - get keys(): Array; - forEach(callback: (value: TT) => void): Promise; -} diff --git a/lib/funkyArray.js b/lib/funkyArray.js deleted file mode 100644 index 0d7e6af..0000000 --- a/lib/funkyArray.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -// Copyright (c) Catgirl Enterprises - Licensed under MIT -// Check LICENSE in repository root for more information. -Object.defineProperty(exports, "__esModule", { value: true }); -class FunkyArray { - constructor() { - this.items = new Map(); - this.itemKeys = new Array(); - } - _getKeys() { - const keyArray = new Array(); - let result; - const iterator = this.items.keys(); - while (!(result = iterator.next()).done) { - keyArray.push(result.value); - } - return keyArray; - } - set(key, item, regenerate = true) { - this.items.set(key, item); - if (regenerate) { - this.itemKeys = this._getKeys(); - } - return item; - } - remove(key, regenerate = true) { - const success = this.items.delete(key); - if (regenerate) { - this.itemKeys = this._getKeys(); - } - return success; - } - removeFirst(regenerate = true) { - const success = this.items.delete(this.items.keys().next().value); - if (regenerate) { - this.itemKeys = this._getKeys(); - } - return success; - } - first() { - return this.items.values().next().value; - } - get length() { - return this.items.size; - } - get(key) { - return this.items.get(key); - } - has(key) { - return this.itemKeys.includes(key); - } - get keys() { - return this.itemKeys; - } - forEach(callback) { - return new Promise(async (resolve, reject) => { - if (this.items.size === 0) { - return resolve(true); - } - try { - const iterator = this.items.values(); - let result; - while (!(result = iterator.next()).done) { - await callback(result.value); - } - resolve(true); - } - catch (e) { - reject(e); - } - }); - } -} -exports.default = FunkyArray;