UNPKG

zephyr-agent

Version:
17 lines (16 loc) • 610 B
import "node:module"; import { createHash } from "node:crypto"; import { extname } from "node:path"; function zeBuildAssets({ filepath, content }) { const buffer = 'string' == typeof content ? Buffer.from(content, 'utf8') : content; const hash = createHash('sha256').update(buffer.length ? buffer : Buffer.from(filepath, 'utf8')).update(Buffer.from(filepath, 'utf8')).digest('hex'); return { path: filepath, extname: extname(filepath), hash, size: buffer.length, buffer: buffer }; } export { zeBuildAssets }; //# sourceMappingURL=ze-build-assets.mjs.map