This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+25 -7
View File
@@ -4,22 +4,40 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.declare = declare;
exports.declarePreset = void 0;
function declare(builder) {
return (api, options, dirname) => {
if (!api.assertVersion) {
api = Object.assign(copyApiObject(api), {
assertVersion(range) {
throwVersionError(range, api.version);
}
var _clonedApi2;
});
let clonedApi;
for (const name of Object.keys(apiPolyfills)) {
var _clonedApi;
if (api[name]) continue;
clonedApi = (_clonedApi = clonedApi) != null ? _clonedApi : copyApiObject(api);
clonedApi[name] = apiPolyfills[name](clonedApi);
}
return builder(api, options || {}, dirname);
return builder((_clonedApi2 = clonedApi) != null ? _clonedApi2 : api, options || {}, dirname);
};
}
const declarePreset = declare;
exports.declarePreset = declarePreset;
const apiPolyfills = {
assertVersion: api => range => {
throwVersionError(range, api.version);
},
targets: () => () => {
return {};
},
assumption: () => () => {
return undefined;
}
};
function copyApiObject(api) {
let proto = null;