1.1.3 • Published 10 months ago

@tsmetadata/polyfill v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Symbol.metadata Polyfill

@tsmetadata/polyfill provides the necessary polyfill for legacy runtimes to properly use decorator metadata in TypeScript 5.2+.

In addition, the library provides the necessary global type declaration for Symbol.metadata.

🌱 Install

npm install @tsmetadata/polyfill

⚙️ Usage

As early as possible, import the polyfill.

import '@tsmetadata/polyfill';

After doing so, Symbol.metadata will be defined.

You may also need to configure your tsconfig.json to target <= ES2022 and include the esnext.decorators library. The easiest way to do this is to extend our included polyfill-ready configuration.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": ["@tsmetadata/polyfill/lib/tsconfig.polyfill.json"],
}

🙏 Thanks

Special thanks to Oleksandr Tarasiuk for implementing decorator metadata and to Andrew Branch for releasing an early version of this polyfill.

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago