mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 03:57:08 -04:00
14 lines
307 B
JavaScript
14 lines
307 B
JavaScript
const globals = module.exports = {};
|
|
|
|
const publish = (id, name) => {
|
|
if (!global[id]) {
|
|
throw new Error(`no-global: ${id}`);
|
|
}
|
|
globals[name] = global[id];
|
|
};
|
|
|
|
publish('window', 'win');
|
|
publish('_', 'lo');
|
|
publish('jQuery', 'jq');
|
|
publish('marked', 'marked');
|
|
publish('Prism', 'prism');
|