Skip to content

Commit

Permalink
make roll-vendored-twsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Feb 27, 2025
1 parent c9e776b commit 3129fc0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
// Generated from `twsearch` [object Promise]
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// Generated from `twsearch` v0.7.0-14-g42d41c34

var __toBinary = /* @__PURE__ */ (() => {
var table = new Uint8Array(128);
for (var i = 0; i < 64; i++)
table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
return (base64) => {
var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0);
for (var i2 = 0, j = 0; i2 < n; ) {
Expand All @@ -22,6 +17,5 @@ var __toBinary = /* @__PURE__ */ (() => {
})();

export {
__export,
__toBinary
};
20 changes: 9 additions & 11 deletions src/cubing/vendor/mpl/twsearch/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Generated from `twsearch` [object Promise]
import "./chunk-FTOVDLBG.js";
// Generated from `twsearch` v0.7.0-14-g42d41c34

import "./chunk-ET6O54B6.js";

// src/wasm-package/index.ts
import { Alg } from "../../../alg";
Expand All @@ -13,8 +14,7 @@ function getObject(idx) {
}
var heap_next = heap.length;
function addHeapObject(obj) {
if (heap_next === heap.length)
heap.push(heap.length + 1);
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
Expand Down Expand Up @@ -45,8 +45,7 @@ function getStringFromWasm0(ptr, len) {
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}
function dropObject(idx) {
if (idx < 132)
return;
if (idx < 132) return;
heap[idx] = heap_next;
heap_next = idx;
}
Expand Down Expand Up @@ -83,8 +82,7 @@ function passStringToWasm0(arg, malloc, realloc) {
let offset = 0;
for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 127)
break;
if (code > 127) break;
mem[ptr + offset] = code;
}
if (offset !== len) {
Expand Down Expand Up @@ -428,8 +426,7 @@ function __wbg_finalize_init(instance, module2) {
return wasm;
}
async function __wbg_init(module_or_path) {
if (wasm !== void 0)
return wasm;
if (wasm !== void 0) return wasm;
if (typeof module_or_path !== "undefined") {
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
({ module_or_path } = module_or_path);
Expand All @@ -454,7 +451,7 @@ var twsearch_wasm_default = __wbg_init;
var cachedInitWrapper;
async function initWrapper() {
await (cachedInitWrapper ??= (async () => {
const wasmUint8Array = (await import("./twsearch_wasm_bg-MM4ZLJE4.js")).default;
const wasmUint8Array = (await import("./twsearch_wasm_bg-RQZYZCRF.js")).default;
await twsearch_wasm_default({ module_or_path: wasmUint8Array.buffer });
})());
}
Expand All @@ -467,6 +464,7 @@ async function wasmTwsearch2(kpuzzleDefinition, searchPattern, options) {
return new Alg(
wasmTwsearch(
JSON.stringify(kpuzzleDefinition),
// biome-ignore lint/complexity/useLiteralKeys: JSON field access
JSON.stringify(searchPattern.toJSON()["patternData"]),
JSON.stringify(options)
)
Expand Down
3 changes: 0 additions & 3 deletions src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-MM4ZLJE4.js

This file was deleted.

3 changes: 3 additions & 0 deletions src/cubing/vendor/mpl/twsearch/twsearch_wasm_bg-RQZYZCRF.js
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/cubing/twsearch/tree/16e9f659db21de4ad6248a9c62975ec892c7468b
https://github.com/cubing/twsearch/tree/42d41c3480e79dc50005346f0ca7c4727530237f

0 comments on commit 3129fc0

Please sign in to comment.