UNPKG

every-plugin

Version:
24 lines (22 loc) 810 B
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); //#region src/runtime/services/normalize.ts /** * Normalizes a package name into the module federation remote name. * This function must produce identical results in both runtime and build contexts. * * Normalization rules: * - Convert to lowercase * - Strip a single leading '@' symbol * - Replace '/' with '_' * - Preserve hyphens and other characters * * Examples: * - "@scope/my-plugin""scope_my-plugin" * - "@SCOPE/Foo/Bar""scope_foo_bar" * - "foo/bar""foo_bar" * - "simple-plugin""simple-plugin" */ const getNormalizedRemoteName = (name) => name.toLowerCase().replace(/^@/, "").replace(/\//g, "_"); //#endregion exports.getNormalizedRemoteName = getNormalizedRemoteName; //# sourceMappingURL=normalize.cjs.map