/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/cases/wasm/two-files-loader/wrapper-loader.js
16 строк
574 B
alexander.akait
test: refactor to new API
20 апр 2023, 15:40
20 апр 2023, 15:40
ff3eedd
Код
Авторство
О чём код?
/** @type {import("../../../../").PitchLoaderDefinitionFunction} */ module.exports.pitch = function (remainingRequest) { return ` import { getString as _getString, memory } from ${ JSON.stringify(`${this.utils.contextify(this.context, this.resourcePath)}.wat!=!${this.utils.contextify(this.context, remainingRequest)}`) }; export function getString() { const strBuf = new Uint8Array(memory.buffer, _getString()); const idx = strBuf.indexOf(0); const strBuf2 = strBuf.slice(0, idx); const str = Buffer.from(strBuf2).toString("utf-8"); return str; }; `; };