LarpixClient/electron/node_modules/@electron-internal/extract-zip/index.js
olcxja fb6c8b6ee9
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s
update electron to v43
2026-07-09 22:38:33 +02:00

23 lines
633 B
JavaScript

import path from 'node:path';
import { extract as nativeExtract } from './binding.js';
/**
* Extract a zip archive to a directory.
*
* await extract(source, { dir: '/abs/path' })
*
* @param {string} zipPath
* @param {import('./index.js').ExtractOptions} opts
* @returns {Promise<void>}
*/
export async function extract(zipPath, opts) {
if (!opts || typeof opts.dir !== 'string') {
throw new TypeError('extract: opts.dir is required');
}
if (!path.isAbsolute(opts.dir)) {
throw new TypeError('extract: opts.dir must be an absolute path');
}
return nativeExtract(zipPath, opts);
}
export default extract;