Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

core-decorators

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-decorators - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

src/readonly.js

2

package.json
{
"name": "core-decorators",
"version": "0.0.10",
"version": "0.0.11",
"description": "Library of ES7 decorators inspired by languages that come with built-ins like @override, @deprecated, etc",

@@ -5,0 +5,0 @@ "main": "src/core-decorators.js",

# core-decorators.js
Library of ES7 decorators inspired by languages that come with built-ins like @​override, @​deprecated, etc, similar to [pre-defined Annotations in Java](https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html).
Library of ES7 decorators inspired by languages that come with built-ins like @​override, @​deprecate, etc, similar to [pre-defined Annotations in Java](https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html).
The idea is these decorators would be used to ensure code sanity, but would be removed in production builds via a Babel plugin.
### @readonly
Marks a property or method as not being writable.
```js
import { readonly } from 'core-decorators';
class Woman {
@readonly
gender = 'female';
}
var lady = new Woman();
lady.gender = 'male';
// Cannot assign to read only property 'gender' of [object Object]
```
### @override

@@ -8,0 +25,0 @@

export { default as override } from './override';
export { default as deprecate } from './deprecate';
export { default as deprecated } from './deprecate';
export { default as deprecate, default as deprecated } from './deprecate';
export { default as suppressWarnings } from './suppress-warnings';
export { default as memoize } from './memoize';
export { default as readonly } from './readonly';
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc