UNPKG

@oazmi/build-tools

Version:

general deno build tool scripts which I practically use in all of my typescript repos

18 lines (17 loc) 533 B
import { createCache } from "../../../../../../cache-dir/0.10.3/mod.js"; const fileFetcher = createCache(); export function fetch_specifier(specifier, cacheSettingVal, checksum) { return fileFetcher.load(new URL(specifier), getCacheSetting(cacheSettingVal), checksum); } function getCacheSetting(val) { // WARNING: ensure this matches wasm/src/lib.rs switch (val) { case 1: return "use"; case 2: return "reload"; case 0: default: return "only"; } }