Skip to content

[feat] Get rid of namespace XXX {}  #401

@loynoir

Description

@loynoir

This issue is sub issue of #399

TypeRegistry.Entries is not used at all, but bundled.

Because namespace XXX {} is generated to tree-shake unfriendly code.

Related to a long standing issue microsoft/TypeScript#27604

export namespace TypeRegistry {
  const map = new Map<string, TypeRegistryValidationFunction<any>>()
  export function Entries() {
    return new Map(map)
  }
  export function Clear() {
    return map.clear()
  }
  ...
var TypeRegistry;
(function(TypeRegistry2) {
  const map = /* @__PURE__ */ new Map();
  function Entries() {
    return new Map(map);
  }
  TypeRegistry2.Entries = Entries;
  function Clear() {
    return map.clear();
  }
  TypeRegistry2.Clear = Clear;
  ...
})(TypeRegistry || (TypeRegistry = {}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions