mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 05:01:42 +03:00
204a71ca94
swc_ecma_trasnsforms_base: - `fixer`: Don't de-optimize `++foo || bar`. swc_ecma_trasnsforms_typescript: - Allow using properties from a decorated class. (#1869) swc_ecma_transforms_optimization: - Fix infinite loop. (#1901, #1946)
25 lines
588 B
JavaScript
25 lines
588 B
JavaScript
import "reflect-metadata";
|
|
const Test = (target)=>{
|
|
const metadata = Reflect.getMetadataKeys(target).reduce((metadata, key)=>{
|
|
const { [key]: values = [] } = metadata;
|
|
const all = Reflect.getMetadata(key, target);
|
|
const own = Reflect.getOwnMetadata(key, target);
|
|
return {
|
|
...metadata,
|
|
[key]: [
|
|
{
|
|
all,
|
|
own
|
|
},
|
|
...values
|
|
]
|
|
};
|
|
}, {
|
|
});
|
|
console.dir(metadata, {
|
|
depth: 5
|
|
});
|
|
};
|
|
export class Foo {
|
|
}
|