Files
jsowell-charger-web/jsowell-ui/node_modules/@babel/plugin-transform-modules-commonjs/lib/hooks.js
Lemon f5e6e29f00 Merge branch 'dev-zza' into dev
# Conflicts:
#	jsowell-ui/.env.development
#	jsowell-ui/.env.staging
#	jsowell-ui/bin/build-sit.bat
#	jsowell-ui/bin/build.bat
#	jsowell-ui/src/api/adapayMember/adapayMember.js
#	jsowell-ui/src/api/pile/merchant.js
#	jsowell-ui/src/router/index.js
#	jsowell-ui/src/views/financial/financeDetail.vue
#	jsowell-ui/src/views/financial/merchant.vue
#	jsowell-ui/src/views/homeIndex/homeIndex.vue
#	jsowell-ui/src/views/login.vue
#	jsowell-ui/src/views/pile/basic/detail.vue
#	jsowell-ui/src/views/pile/station/components/SiteInfo.vue
#	jsowell-ui/src/views/pile/station/detail.vue
#	jsowell-ui/src/views/pile/station/orderReport.vue
2025-06-03 14:26:37 +08:00

38 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defineCommonJSHook = defineCommonJSHook;
exports.makeInvokers = makeInvokers;
const commonJSHooksKey = "@babel/plugin-transform-modules-commonjs/customWrapperPlugin";
function defineCommonJSHook(file, hook) {
let hooks = file.get(commonJSHooksKey);
if (!hooks) file.set(commonJSHooksKey, hooks = []);
hooks.push(hook);
}
function findMap(arr, cb) {
if (arr) {
for (const el of arr) {
const res = cb(el);
if (res != null) return res;
}
}
}
function makeInvokers(file) {
const hooks = file.get(commonJSHooksKey);
return {
getWrapperPayload(...args) {
return findMap(hooks, hook => hook.getWrapperPayload == null ? void 0 : hook.getWrapperPayload(...args));
},
wrapReference(...args) {
return findMap(hooks, hook => hook.wrapReference == null ? void 0 : hook.wrapReference(...args));
},
buildRequireWrapper(...args) {
return findMap(hooks, hook => hook.buildRequireWrapper == null ? void 0 : hook.buildRequireWrapper(...args));
}
};
}
//# sourceMappingURL=hooks.js.map