fix(decorators): Add Symbol.metadata polyfill and import it at entry to ensure decorator metadata is available
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartdata',
|
||||
version: '7.0.3',
|
||||
version: '7.0.4',
|
||||
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Polyfill must be imported first - ES modules hoist exports before code runs
|
||||
import './shim.js';
|
||||
|
||||
export * from './classes.db.js';
|
||||
export * from './classes.collection.js';
|
||||
export * from './classes.doc.js';
|
||||
|
||||
6
ts/shim.ts
Normal file
6
ts/shim.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Polyfill for Symbol.metadata required by TC39 Stage 3 decorators.
|
||||
* Must be imported before any decorator code loads.
|
||||
* @see https://github.com/tc39/proposal-decorator-metadata
|
||||
*/
|
||||
(Symbol as any).metadata ??= Symbol.for('Symbol.metadata');
|
||||
Reference in New Issue
Block a user