数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.2 KiB

2 years ago
'use strict';
2 years ago
const context = require('./shared/unimport.a4d7e437.cjs');
const addons = require('./shared/unimport.c4345198.cjs');
2 years ago
require('mlly');
require('fs');
require('local-pkg');
require('os');
require('pkg-types');
require('pathe');
require('fs/promises');
require('fast-glob');
require('scule');
require('magic-string');
require('strip-literal');
async function installGlobalAutoImports(imports, options = {}) {
const {
globalObject = globalThis,
overrides = false
} = options;
imports = Array.isArray(imports) ? imports : await imports.getImports();
await Promise.all(
imports.map(async (i) => {
if (i.disabled || i.type) {
return;
}
const as = i.as || i.name;
if (overrides || !(as in globalObject)) {
const module = await import(i.from);
globalObject[as] = module[i.name];
}
})
);
return globalObject;
}
exports.builtinPresets = context.builtinPresets;
exports.createUnimport = context.createUnimport;
2 years ago
exports.dedupeDtsExports = context.dedupeDtsExports;
2 years ago
exports.resolveBuiltinPresets = context.resolveBuiltinPresets;
exports.resolvePreset = context.resolvePreset;
exports.scanDirExports = context.scanDirExports;
exports.scanExports = context.scanExports;
exports.scanFilesFromDir = context.scanFilesFromDir;
2 years ago
exports.version = context.version;
exports.addImportToCode = addons.addImportToCode;
exports.dedupeImports = addons.dedupeImports;
exports.defineUnimportPreset = addons.defineUnimportPreset;
exports.excludeRE = addons.excludeRE;
exports.getMagicString = addons.getMagicString;
exports.getString = addons.getString;
exports.importAsRE = addons.importAsRE;
exports.matchRE = addons.matchRE;
exports.normalizeImports = addons.normalizeImports;
exports.resolveIdAbsolute = addons.resolveIdAbsolute;
exports.separatorRE = addons.separatorRE;
exports.stripCommentsAndStrings = addons.stripCommentsAndStrings;
exports.toExports = addons.toExports;
exports.toImports = addons.toImports;
exports.toTypeDeclarationFile = addons.toTypeDeclarationFile;
exports.toTypeDeclarationItems = addons.toTypeDeclarationItems;
exports.toTypeReExports = addons.toTypeReExports;
exports.vueTemplateAddon = addons.vueTemplateAddon;
2 years ago
exports.installGlobalAutoImports = installGlobalAutoImports;