From f7f5a6a91d20b0e74a469296b06e393eac4b03e4 Mon Sep 17 00:00:00 2001 From: USERSATOSHI Date: Mon, 15 Apr 2024 10:23:28 +0530 Subject: [PATCH] fixed sorting to use value instead of key --- dist/cjs/KeyValue/src/FileManager.d.ts | 2 +- dist/cjs/KeyValue/src/FileManager.js | 4 ++-- dist/cjs/KeyValue/src/FileManager.js.map | 2 +- dist/cjs/KeyValue/src/Table.d.ts | 2 +- dist/cjs/KeyValue/src/database.d.ts | 2 +- dist/cjs/KeyValue/src/database.js | 2 +- dist/cjs/KeyValue/src/database.js.map | 2 +- dist/esm/KeyValue/src/FileManager.d.ts | 2 +- dist/esm/KeyValue/src/FileManager.js | 4 ++-- dist/esm/KeyValue/src/FileManager.js.map | 2 +- dist/esm/KeyValue/src/Table.d.ts | 2 +- dist/esm/KeyValue/src/database.d.ts | 2 +- dist/esm/KeyValue/src/database.js | 2 +- dist/esm/KeyValue/src/database.js.map | 2 +- lib/KeyValue/src/FileManager.ts | 4 ++-- lib/KeyValue/src/database.ts | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dist/cjs/KeyValue/src/FileManager.d.ts b/dist/cjs/KeyValue/src/FileManager.d.ts index a2de810..8a1b2b6 100644 --- a/dist/cjs/KeyValue/src/FileManager.d.ts +++ b/dist/cjs/KeyValue/src/FileManager.d.ts @@ -12,7 +12,7 @@ export default class FileManager { clear(): Promise | undefined; has(key: KeyValueData["key"]): Promise; all(query: (d: KeyValueData) => boolean, limit: number, order: "firstN" | "asc" | "desc"): Promise; - findOne(query: (d: KeyValueData) => boolean): Promise; + findOne(query: (d: KeyValueData) => boolean): Promise; findMany(query: (d: KeyValueData) => boolean): Promise; getFirstN(query: (d: KeyValueData) => boolean, limit: number): Promise; removeMany(query: (d: KeyValueData) => boolean): Promise; diff --git a/dist/cjs/KeyValue/src/FileManager.js b/dist/cjs/KeyValue/src/FileManager.js index 69480f9..ca49d29 100644 --- a/dist/cjs/KeyValue/src/FileManager.js +++ b/dist/cjs/KeyValue/src/FileManager.js @@ -226,10 +226,10 @@ class FileManager { } } if (order === "asc") { - data.sort((a, b) => a.key.localeCompare(b.key)); + data.sort((a, b) => this.#table.db.options.cacheConfig.sortFunction(a, b)); } else { - data.sort((a, b) => b.key.localeCompare(a.key)); + data.sort((a, b) => this.#table.db.options.cacheConfig.sortFunction(a, b)).reverse(); } return data.slice(0, limit); } diff --git a/dist/cjs/KeyValue/src/FileManager.js.map b/dist/cjs/KeyValue/src/FileManager.js.map index 7f5c076..2262a6f 100644 --- a/dist/cjs/KeyValue/src/FileManager.js.map +++ b/dist/cjs/KeyValue/src/FileManager.js.map @@ -1 +1 @@ -{"version":3,"file":"FileManager.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/FileManager.ts"],"names":[],"mappings":";;;;;AAGA,wDAA6B;AAC7B,qCAAsC;AAGtC,MAAqB,WAAW;IAC/B,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,MAAM,CAAU;IAChB,MAAM,CAAQ;IACd,UAAU,GAAY,KAAK,CAAC;IAC5B,YAAY,OAAe,EAAE,QAAQ,GAAG,EAAE,EAAE,KAAY;QACvD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,UAAU;QACf,MAAM,UAAU,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE;YACrE,OAAO,IAAI,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,MAAM,EAAE,GAAG,KAAK,IAAI,EAAE;oBACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;wBACrB,YAAY,CAAC,OAAO,CAAC,CAAC;wBACtB,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;qBACvB;yBAAM;wBACN,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;qBAC9B;gBACF,CAAC,CAAC;gBAEF,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QAEH,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,GAAG,IAAI,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,OAAO,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;CACD;AA5XD,8BA4XC"} \ No newline at end of file +{"version":3,"file":"FileManager.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/FileManager.ts"],"names":[],"mappings":";;;;;AAGA,wDAA6B;AAC7B,qCAAsC;AAGtC,MAAqB,WAAW;IAC/B,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,MAAM,CAAU;IAChB,MAAM,CAAQ;IACd,UAAU,GAAY,KAAK,CAAC;IAC5B,YAAY,OAAe,EAAE,QAAQ,GAAG,EAAE,EAAE,KAAY;QACvD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,UAAU;QACf,MAAM,UAAU,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CA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AC/B,CAAC,CAAC,CAAC;QAEH,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SAC7B;IACF,CAAC;IAED,KAAK,CAAC,IAAI;QACT,IAAG,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC9C,IAAI,OAAqD,CAAC;gBAC1D,MAAM,EAAE,GAAG,KAAK,IAAI,EAAE;oBACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;wBACrB,YAAY,CAAC,OAAO,CAAC,CAAC;wBACtB,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;qBACvB;yBAAM;wBACN,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;qBAC9B;gBACF,CAAC,CAAC;gBAEF,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QAEH,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,GAAG,IAAI,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,OAAO,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;CACD;AA5XD,8BA4XC"} \ No newline at end of file diff --git a/dist/cjs/KeyValue/src/Table.d.ts b/dist/cjs/KeyValue/src/Table.d.ts index 75db5c4..2d72b4e 100644 --- a/dist/cjs/KeyValue/src/Table.d.ts +++ b/dist/cjs/KeyValue/src/Table.d.ts @@ -34,7 +34,7 @@ export default class Table extends EventEmitter { clear(): Promise; has(key: string): Promise; all(query: (d: Data) => boolean, limit: number, order: "firstN" | "asc" | "desc"): Promise; - findOne(query: (d: Data) => boolean): Promise; + findOne(query: (d: Data) => boolean): Promise; findMany(query: (d: Data) => boolean): Promise; removeMany(query: (d: Data) => boolean): Promise; ping(): Promise; diff --git a/dist/cjs/KeyValue/src/database.d.ts b/dist/cjs/KeyValue/src/database.d.ts index a2c813f..25c6752 100644 --- a/dist/cjs/KeyValue/src/database.d.ts +++ b/dist/cjs/KeyValue/src/database.d.ts @@ -131,7 +131,7 @@ export default class KeyValue extends EventEmitter { * }) * ``` */ - findOne(table: string, query: (value: Data) => boolean): Promise; + findOne(table: string, query: (value: Data) => boolean): Promise; /** * @description find all data that matches the query * @param table table to find diff --git a/dist/cjs/KeyValue/src/database.js b/dist/cjs/KeyValue/src/database.js index 7f49e0d..2033d97 100644 --- a/dist/cjs/KeyValue/src/database.js +++ b/dist/cjs/KeyValue/src/database.js @@ -66,7 +66,7 @@ class KeyValue extends events_1.EventEmitter { limit: 1000, sorted: false, sortFunction: (a, b) => { - return 0; + return a.value - b.value; }, }, debug: false, diff --git a/dist/cjs/KeyValue/src/database.js.map b/dist/cjs/KeyValue/src/database.js.map index 05fda64..d1d1220 100644 --- a/dist/cjs/KeyValue/src/database.js.map +++ b/dist/cjs/KeyValue/src/database.js.map @@ -1 +1 @@ -{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/database.ts"],"names":[],"mappings":";;;;;AAIA,2BAA6E;AAC7E,mCAAqC;AACrC,mDAI+B;AAE/B,6CAAyC;AACzC,0DAA+B;AAC/B,mCAAsC;AACtC,uBAAuB;AACvB,8CAAsB;AACtB,gDAAwB;AAGxB,MAAqB,QAAS,SAAQ,qBAAY;IAC9C,QAAQ,CAAgC;IACxC,MAAM,GAMF,EAAE,CAAC;IACP,OAAO,CAAU;IAEjB;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,OAAwB;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,cAAc;QACjB,OAAO;YACH,UAA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CAAC,EAAE;YACzC,KAAK,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAW,CAAC;SAC7C;QACD,OAAO,KAAK,GAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;CACJ;AAjiBD,2BAiiBC"} \ No newline at end of file +{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/database.ts"],"names":[],"mappings":";;;;;AAIA,2BAA6E;AAC7E,mCAAqC;AACrC,mDAI+B;AAE/B,6CAAyC;AACzC,0DAA+B;AAC/B,mCAAsC;AACtC,uBAAuB;AACvB,8CAAsB;AACtB,gDAAwB;AAGxB,MAAqB,QAAS,SAAQ,qBAAY;IAC9C,QAAQ,CAAgC;IACxC,MAAM,GAMF,EAAE,CAAC;IACP,OAAO,CAAU;IAEjB;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,OAAwB;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,cAAc;QACjB,OAAO;YACH,UAAU,EAAE;gBACR,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,CAAC,MAAM,CAAC;gBAChB,aAAa,EAAE,cAAc;aAChC;YACD,UAAU,EAAE;gBACR,SAAS,EAAE,MAAM;gBACjB,eAAe,EAAE,KAAK;gBACtB,kBAAkB,EAAE,gBAAgB;gBACpC,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,EAAE;aACnB;YACD,gBAAgB,EAAE;gBACd,WAAW,EAAE,kCAAkC;gBAC/C,WAAW,EAAE,KAAK;aACrB;YACD,WAAW,EAAE;gBACT,KAAK,EAAE,mBAAS,CAAC,GAAG;gBACpB,SAAS,EAAE,uBAAa,CAAC,KAAK;gBAC9B,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,KAAK;gB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MAAM,CAAC,CAAC;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IAEH,oCAAoC;IACpC,oCAAoC;IACpC,gCAAgC;IAEhC,yCAAyC;IACzC,IAAI;IAEJ;;;;;;;;;;;OAWG;IAEH,KAAK,CAAC,UAAU,CACZ,KAAa,EACb,KAAiC;QAEjC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;QAEzB,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,IAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAY;QACnB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QAEjB,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAI,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACzC,KAAK,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAW,CAAC;SAC7C;QACD,OAAO,KAAK,GAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;CACJ;AAjiBD,2BAiiBC"} \ No newline at end of file diff --git a/dist/esm/KeyValue/src/FileManager.d.ts b/dist/esm/KeyValue/src/FileManager.d.ts index a2de810..8a1b2b6 100644 --- a/dist/esm/KeyValue/src/FileManager.d.ts +++ b/dist/esm/KeyValue/src/FileManager.d.ts @@ -12,7 +12,7 @@ export default class FileManager { clear(): Promise | undefined; has(key: KeyValueData["key"]): Promise; all(query: (d: KeyValueData) => boolean, limit: number, order: "firstN" | "asc" | "desc"): Promise; - findOne(query: (d: KeyValueData) => boolean): Promise; + findOne(query: (d: KeyValueData) => boolean): Promise; findMany(query: (d: KeyValueData) => boolean): Promise; getFirstN(query: (d: KeyValueData) => boolean, limit: number): Promise; removeMany(query: (d: KeyValueData) => boolean): Promise; diff --git a/dist/esm/KeyValue/src/FileManager.js b/dist/esm/KeyValue/src/FileManager.js index df33e32..54aff3c 100644 --- a/dist/esm/KeyValue/src/FileManager.js +++ b/dist/esm/KeyValue/src/FileManager.js @@ -221,10 +221,10 @@ export default class FileManager { } } if (order === "asc") { - data.sort((a, b) => a.key.localeCompare(b.key)); + data.sort((a, b) => this.#table.db.options.cacheConfig.sortFunction(a, b)); } else { - data.sort((a, b) => b.key.localeCompare(a.key)); + data.sort((a, b) => this.#table.db.options.cacheConfig.sortFunction(a, b)).reverse(); } return data.slice(0, limit); } diff --git a/dist/esm/KeyValue/src/FileManager.js.map b/dist/esm/KeyValue/src/FileManager.js.map index dc9d297..64a11ff 100644 --- a/dist/esm/KeyValue/src/FileManager.js.map +++ b/dist/esm/KeyValue/src/FileManager.js.map @@ -1 +1 @@ -{"version":3,"file":"FileManager.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/FileManager.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC/B,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,MAAM,CAAU;IAChB,MAAM,CAAQ;IACd,UAAU,GAAY,KAAK,CAAC;IAC5B,YAAY,OAAe,EAAE,QAAQ,GAAG,EAAE,EAAE,KAAY;QACvD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IAC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AC;qBAC9B;gBACF,CAAC,CAAC;gBAEF,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QAEH,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SAC7B;IACF,CAAC;IAED,KAAK,CAAC,IAAI;QACT,IAAG,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC9C,IAAI,OAAqD,CAAC;gBAC1D,MAAM,EAAE,GAAG,KAAK,IAAI,EAAE;oBACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;wBACrB,YAAY,CAAC,OAAO,CAAC,CAAC;wBACtB,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;qBACvB;yBAAM;wBACN,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;qBAC9B;gBACF,CAAC,CAAC;gBAEF,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QAEH,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,GAAG,IAAI,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,OAAO,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;CACD"} \ No newline at end of file +{"version":3,"file":"FileManager.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/FileManager.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC/B,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,MAAM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SACzB;QACD,OAAO,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;CACD"} \ No newline at end of file diff --git a/dist/esm/KeyValue/src/Table.d.ts b/dist/esm/KeyValue/src/Table.d.ts index 75db5c4..2d72b4e 100644 --- a/dist/esm/KeyValue/src/Table.d.ts +++ b/dist/esm/KeyValue/src/Table.d.ts @@ -34,7 +34,7 @@ export default class Table extends EventEmitter { clear(): Promise; has(key: string): Promise; all(query: (d: Data) => boolean, limit: number, order: "firstN" | "asc" | "desc"): Promise; - findOne(query: (d: Data) => boolean): Promise; + findOne(query: (d: Data) => boolean): Promise; findMany(query: (d: Data) => boolean): Promise; removeMany(query: (d: Data) => boolean): Promise; ping(): Promise; diff --git a/dist/esm/KeyValue/src/database.d.ts b/dist/esm/KeyValue/src/database.d.ts index a2c813f..25c6752 100644 --- a/dist/esm/KeyValue/src/database.d.ts +++ b/dist/esm/KeyValue/src/database.d.ts @@ -131,7 +131,7 @@ export default class KeyValue extends EventEmitter { * }) * ``` */ - findOne(table: string, query: (value: Data) => boolean): Promise; + findOne(table: string, query: (value: Data) => boolean): Promise; /** * @description find all data that matches the query * @param table table to find diff --git a/dist/esm/KeyValue/src/database.js b/dist/esm/KeyValue/src/database.js index a901af7..0e03757 100644 --- a/dist/esm/KeyValue/src/database.js +++ b/dist/esm/KeyValue/src/database.js @@ -61,7 +61,7 @@ export default class KeyValue extends EventEmitter { limit: 1000, sorted: false, sortFunction: (a, b) => { - return 0; + return a.value - b.value; }, }, debug: false, diff --git a/dist/esm/KeyValue/src/database.js.map b/dist/esm/KeyValue/src/database.js.map index 9f260db..c7f163f 100644 --- a/dist/esm/KeyValue/src/database.js.map +++ b/dist/esm/KeyValue/src/database.js.map @@ -1 +1 @@ -{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/database.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,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M,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;QAEzB,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,IAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAY;QACnB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QAEjB,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAI,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACzC,KAAK,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAW,CAAC;SAC7C;QACD,OAAO,KAAK,GAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../lib/KeyValue/src/database.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EACH,SAAS,EACT,aAAa,EACb,cAAc,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,uBAAuB;AACvB,O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I,CAAC,KAAY;QACnB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QAEjB,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAI,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACzC,KAAK,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAW,CAAC;SAC7C;QACD,OAAO,KAAK,GAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;CACJ"} \ No newline at end of file diff --git a/lib/KeyValue/src/FileManager.ts b/lib/KeyValue/src/FileManager.ts index 60f864b..1e810c3 100644 --- a/lib/KeyValue/src/FileManager.ts +++ b/lib/KeyValue/src/FileManager.ts @@ -264,9 +264,9 @@ export default class FileManager { } } if (order === "asc") { - data.sort((a, b) => a.key.localeCompare(b.key)); + data.sort((a,b) => this.#table.db.options.cacheConfig.sortFunction(a,b)); } else { - data.sort((a, b) => b.key.localeCompare(a.key)); + data.sort((a,b) => this.#table.db.options.cacheConfig.sortFunction(a,b)).reverse(); } return data.slice(0, limit); } diff --git a/lib/KeyValue/src/database.ts b/lib/KeyValue/src/database.ts index d9569f1..c1a724b 100755 --- a/lib/KeyValue/src/database.ts +++ b/lib/KeyValue/src/database.ts @@ -80,7 +80,7 @@ export default class KeyValue extends EventEmitter { limit: 1000, sorted: false, sortFunction: (a, b) => { - return 0; + return a.value - b.value; }, }, debug: false,