Files
SnowLuma/.pnpm-store/v11/files/63/e17cb65d33cadd386b35d2dbe31496ba87f2950e04f38b5f84b097de894b1b0fea495800ad4b5b2e5a45de043d10822b9b746254ec8fc5960e3d0462ed03b9
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

18 lines
545 B
Plaintext

const extend = (listToExtend, list) =>
// eslint-disable-next-line prefer-spread
listToExtend.push.apply(listToExtend, list);
// sort on i primary, j secondary
const sorted = matches => matches.sort((m1, m2) => m1.i - m2.i || m1.j - m2.j);
const buildRankedDictionary = orderedList => {
const result = {};
let counter = 1; // rank starts at 1, not 0
orderedList.forEach(word => {
result[word] = counter;
counter += 1;
});
return result;
};
export { buildRankedDictionary, extend, sorted };
//# sourceMappingURL=helper.mjs.map