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.19.0 to 0.20.0

index.d.ts

2

es/private/utils.js

@@ -81,3 +81,3 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

return function () {
return handleDescriptor.apply(undefined, Array.prototype.slice.call(arguments).concat([entryArgs]));
return handleDescriptor.apply(undefined, _toConsumableArray(Array.prototype.slice.call(arguments)).concat([entryArgs]));
};

@@ -84,0 +84,0 @@ }

@@ -98,3 +98,3 @@ 'use strict';

return function () {
return handleDescriptor.apply(undefined, Array.prototype.slice.call(arguments).concat([entryArgs]));
return handleDescriptor.apply(undefined, _toConsumableArray(Array.prototype.slice.call(arguments)).concat([entryArgs]));
};

@@ -101,0 +101,0 @@ }

{
"name": "core-decorators",
"version": "0.19.0",
"version": "0.20.0",
"description": "Library of JavaScript stage-0 decorators (aka ES2016/ES7 decorators but that's not accurate!) inspired by languages that come with built-ins like @​override, @​deprecate, @​autobind, @​mixin and more! Works great with React/Angular/more!",

@@ -8,2 +8,3 @@ "main": "lib/core-decorators.js",

"jsnext:main": "es/core-decorators.js",
"typings": "./index.d.ts",
"files": [

@@ -14,8 +15,13 @@ "es",

"README.md",
"LICENSE"
"LICENSE",
"index.d.ts"
],
"scripts": {
"build": "babel --out-dir lib src && BABEL_ENV=es babel --out-dir es src",
"prepublish": "npm run build",
"build": "rimraf lib && babel --out-dir lib src && cross-env BABEL_ENV=es babel --out-dir es src",
"build-bower": "babel-node scripts/build-bower.js",
"test": "npm run build && mocha --compilers js:babel-core/register --require babel-polyfill \"test/**/*.spec.js\""
"prebuild-tsc": "rimraf built",
"build-tsc": "tsc --outDir lib",
"clean": "rimraf lib es built",
"test": "mocha --compilers js:babel-core/register --require babel-polyfill \"test/**/*.spec.js\""
},

@@ -51,2 +57,5 @@ "repository": {

"devDependencies": {
"@types/chai": "^3.5.2",
"@types/mocha": "^2.2.41",
"@types/node": "^6.0.73",
"babel-cli": "^6.24.0",

@@ -63,2 +72,3 @@ "babel-core": "^6.24.0",

"chai": "^3.5.0",
"cross-env": "^5.0.0",
"glob": "^7.1.1",

@@ -69,5 +79,7 @@ "global-wrap": "^2.0.0",

"mocha": "^3.2.0",
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0"
"rimraf": "^2.6.1",
"sinon": "2.1.0",
"sinon-chai": "^2.9.0",
"typescript": "^2.3.3"
}
}
# core-decorators.js [![Build Status](https://travis-ci.org/jayphelps/core-decorators.js.svg?branch=master)](https://travis-ci.org/jayphelps/core-decorators.js)
<a href="https://app.codesponsor.io/link/zs7vWiDv2F99bX6Ay7PJa5WE/jayphelps/core-decorators" rel="nofollow"><img src="https://app.codesponsor.io/embed/zs7vWiDv2F99bX6Ay7PJa5WE/jayphelps/core-decorators.svg" style="width: 888px; height: 68px;" alt="Sponsor" /></a>
Library of [JavaScript stage-0 decorators](https://github.com/wycats/javascript-decorators) (aka ES2016/ES7 decorators [but that's not accurate](https://medium.com/@jayphelps/please-stop-referring-to-proposed-javascript-features-as-es7-cad29f9dcc4b)) inspired by languages that come with built-ins like @​override, @​deprecate, @​autobind, @​mixin and more. Popular with React/Angular, but is framework agnostic. Similar to [Annotations in Java](https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html) but unlike Java annotations, decorators are functions which are applied at runtime.
These are stage-0 decorators because while [the decorators spec has changed](http://tc39.github.io/proposal-decorators/) and is now stage-2, no transpiler has yet to implement these changes and until they do, this library won't either.
These are stage-0 decorators because while [the decorators spec has changed](http://tc39.github.io/proposal-decorators/) and is now stage-2, no transpiler has yet to implement these changes and until they do, this library won't either. Although the [TypeScript documentation](http://www.typescriptlang.org/docs/handbook/decorators.html) uses the phrase "Decorators are a stage 2 proposal for JavaScript" this is misleading because TypeScript still only implements the **stage-0** version of the spec, which is very incompatible with stage-2 (as of this writing). If you concretely find that a compiler (babel, TS, etc) implement stage-2+, please do link me to the appropriate release notes! :balloon:

@@ -95,3 +97,3 @@ _*compiled code is intentionally not checked into this repo_

getPerson() {
return this;
return this;
}

@@ -135,3 +137,3 @@

Works with methods and getters/setters. Will ensure name, parameter count, as well as descriptor type (accessor/data). Provides a suggestion if it finds a method with a similar signature, including slight misspellings.
Works with methods and getters/setters only (**not** property initializers/arrow functions). Will ensure name, parameter count, as well as descriptor type (accessor/data). Provides a suggestion if it finds a method with a similar signature, including slight misspellings.

@@ -138,0 +140,0 @@ ```js

@@ -113,3 +113,3 @@ import { decorate } from './private/utils';

function checkFunctionSignatures(parent: Function, child: Function, reporter) {
function checkFunctionSignatures(parent, child, reporter) {
reporter.assert(parent.length === child.length);

@@ -116,0 +116,0 @@ }

@@ -27,3 +27,3 @@ import lazyInitialize from '../lazy-initialize';

return function () {
return handleDescriptor(...arguments, entryArgs);
return handleDescriptor(...Array.prototype.slice.call(arguments), entryArgs);
};

@@ -121,2 +121,2 @@ }

}
}
}
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