
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
babel-plugin-angular2-annotations
Advanced tools
An experimental babel transformer plugin for Angular 2 annotations
A babel transformer plugin for Angular 2 decorators and type annotations.
Use babel-plugin-transform-decorators-legacy to support decorators.
Make sure to load reflect-metadata for browser in order to polyfill Metadata Reflection API in your app.
Class decorators
@Component({ selector: 'hello' })
class HelloComponent {}
Class property decorators with initializers
@Component({ /* ... */ })
class HelloComponent {
@Output() foo = new EventEmitter();`
}
Type annotations for constructor parameters
class Hello {
constructor(foo: Foo, bar: Bar) {
this.foo = foo;
this.bar = bar;
}
}
QueryList<RouterLink>
is treated as QueryList
Class property decorators with no initializer
@Component({ /* ... */ })
class HelloComponent {
@Input() bar;
}
Decorators for constructor parameters
@Component({ /* ... */ })
class HelloComponent {
constructor(@Attribute('name') name, @Optional() optional) {
this.name = name;
this.optional = optional;
}
}
npm install --save-dev babel-plugin-angular2-annotations
npm install --save-dev babel-plugin-transform-decorators-legacy babel-plugin-transform-class-properties babel-plugin-transform-flow-strip-types babel-preset-es2015
.babelrc
{
"plugins": [
"angular2-annotations",
"transform-decorators-legacy",
"transform-class-properties",
"transform-flow-strip-types"
],
"presets": [
"es2015"
]
}
Before:
class HelloComponent {
@Input() baz;
constructor(foo: Foo, @Optional() bar: Bar) {
}
}
After:
class HelloComponent {
@Input() baz = this.baz;
}
Optional()(HelloComponent, null, 1);
Reflect.defineMetadata('design:paramtypes', [Foo, Bar]);
See babel-angular2-app or angular2-esnext-starter for more complete example.
FAQs
An experimental babel transformer plugin for Angular 2 annotations
The npm package babel-plugin-angular2-annotations receives a total of 195 weekly downloads. As such, babel-plugin-angular2-annotations popularity was classified as not popular.
We found that babel-plugin-angular2-annotations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.