fix: sort multi keys

This commit is contained in:
thecodrr
2020-03-09 10:47:33 +05:00
parent 319becedea
commit 528903cab7
2 changed files with 3 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import localforage from "localforage";
import { extendPrototype } from "localforage-getitems";
import { encode, decode } from "../utils/base64";
import { hexToBuffer, bufferToHex } from "../utils/hex";
import sort from "fast-sort";
const encoder = new TextEncoder();
const decoder = new TextDecoder();
@@ -18,7 +19,7 @@ function read(key) {
function readMulti(keys) {
if (keys.length <= 0) return {};
return localforage.getItems(keys);
return localforage.getItems(sort(keys).asc());
}
function write(key, data) {

View File

@@ -6883,7 +6883,7 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
"notes-core@https://github.com/thecodrr/notes-core.git":
version "1.2.0"
resolved "https://github.com/thecodrr/notes-core.git#479f290b1b8c929eba45e27b1a8293f1a221de8a"
resolved "https://github.com/thecodrr/notes-core.git#c5f5a15cba00e0d56aa99fac19277b1ce3cd0454"
dependencies:
fast-sort "^2.0.1"
fuzzysearch "^1.0.3"