amis-rpc-design/node_modules/@react-native-community/cli-doctor/build/tools/unzip.js
2023-10-07 19:42:30 +08:00

37 lines
770 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unzip = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
const StreamZip = require('node-stream-zip');
const unzip = async (source, destination) => {
return new Promise((resolve, reject) => {
const zip = new StreamZip({
file: source,
storeEntries: true
});
(0, _fs().mkdirSync)(destination, {
recursive: true
});
zip.on('ready', () => {
zip.extract(null, destination, err => {
zip.close();
if (err) {
return reject(err);
}
resolve(undefined);
});
});
});
};
exports.unzip = unzip;
//# sourceMappingURL=unzip.ts.map