Comments (1)
I don't plan to make any further API changes to this project as the official proposal for decorators is undergoing changes as part of the standardization process that will ultimately affect this project. As a workaround, you can modify your ComplexField
decorator to record the property names itself as follows:
function ComplexField(type: any) : PropertyDecorator {
return function (target: any, property: string) : void {
Reflect.defineMetadata("complexField", type, target, property);
// get own fields from the target
let complexFields = Reflect.getOwnMetadata("complexFields", target);
if (!complexFields) {
// merge with inherited fields, if available.
complexFields = Reflect.hasMetadata("complexFields", target)
? Reflect.getMetadata("complexFields", target).slice(0)
: [];
// define own fields on the target
Reflect.defineMetadata("complexFields", complexFields, target);
}
// record complex field
complexFields.push(property);
};
}
function getComplexFields(target: any): string[] {
return Reflect.getMetadata("complexFields", target) || [];
}
from reflect-metadata.
Related Issues (20)
- TypeError: Cannot read property 'Reflect' of undefined HOT 1
- Tag new version in upstream HOT 4
- How to get the parameter type of ParameterDecorator
- "design:type" return undefined if types are defined out of order. HOT 2
- Importable version of `reflect-metadata` that does not shim globals. HOT 6
- index.d.ts file, what is the type of function metadata HOT 1
- The use of "indexOf" is not rigorous enough
- Since language specification published, this repo should be archived HOT 4
- Reflect metadata circular dependency HOT 2
- CJS / ES Module? HOT 12
- Throw type error when TS class decorator returns an object. HOT 7
- How to import (using absolute paths import feature of typescript) an module which use reflect-metadata?
- process.env check outputs complete dump of environment settings HOT 4
- Remove dynamic evaluation to access globalThis in "lite" mode HOT 1
- Infinite loop in v0.2.0 HOT 2
- Package subpath './Reflect' is not defined by "exports" HOT 3
- Stage 3 decorators additional implementation HOT 1
- Reflect-Metadata update breaks Nest+TypeORM HOT 1
- Wrong cached provider returned
- Version conflicts occur in micro front-end projects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reflect-metadata.