mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-20 05:40:17 +08:00
* feat: ship the self-hosted native scriptc CLI - Run the shared compiler and CLI natively, including library builds and compile-time evaluation. - Install native platform packages and ship relocatable standalone distributions. - Preserve program semantics and reuse validated build artifacts for fast rebuilds. * fix: complete native CLI integration and validation - Preserve library diagnostics and run recursive compiler work on the main stack. - Restore packaged helper permissions and exercise native npm and Wasm library builds. - Recover interrupted Sandbox status probes within the original command deadline.
13 lines
492 B
TypeScript
13 lines
492 B
TypeScript
const order = [2, 0, 1];
|
|
const mapped: number[] = new Array<number>(3).fill(-1);
|
|
order.forEach((oldIndex, newIndex) => { mapped[oldIndex] = newIndex; });
|
|
console.log(mapped.join(","));
|
|
|
|
const candidates = new Map<string, number[]>();
|
|
candidates.set("entry", [1, 2]);
|
|
const included = new Array<boolean>(3).fill(false);
|
|
for (const candidate of candidates.get("entry") ?? new Array<number>()) {
|
|
if (included[candidate] !== true) included[candidate] = true;
|
|
}
|
|
console.log(included.join(","));
|