core-decorators
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -17,4 +17,2 @@ 'use strict'; | ||
// =================================================================== | ||
var Foo = (function () { | ||
@@ -36,4 +34,2 @@ function Foo() { | ||
// =================================================================== | ||
describe('autobind', function () { | ||
@@ -40,0 +36,0 @@ it('returns a bound instance for a method', function () { |
@@ -13,4 +13,2 @@ 'use strict'; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
var _privateUtils = require('./private/utils'); | ||
@@ -46,6 +44,10 @@ | ||
function deprecate(args) { | ||
return _privateUtils.decorate.apply(undefined, [handleDescriptor].concat(_toConsumableArray(args))); | ||
function deprecate() { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return (0, _privateUtils.decorate)(handleDescriptor, args); | ||
} | ||
module.exports = exports['default']; |
{ | ||
"name": "core-decorators", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Library of ES7 decorators inspired by languages that come with built-ins like @override, @deprecated, etc", | ||
"main": "lib/core-decorators.js", | ||
"files": ["lib", "src", "README.md", "LICENSE"], | ||
"files": [ | ||
"lib", | ||
"src", | ||
"README.md", | ||
"LICENSE" | ||
], | ||
"scripts": { | ||
@@ -35,5 +40,6 @@ "build": "babel --stage 0 --out-dir lib src", | ||
"babel": "^5.4.7", | ||
"chai": "^3.2.0", | ||
"mocha": "^2.2.5", | ||
"must": "^0.12.0" | ||
"sinon": "^1.15.4" | ||
} | ||
} |
import expect from 'must'; | ||
import autobind from './autobind'; | ||
// =================================================================== | ||
class Foo { | ||
@@ -14,11 +11,9 @@ @autobind | ||
// =================================================================== | ||
describe('autobind', function () { | ||
it('returns a bound instance for a method', function () { | ||
const foo = new Foo(); | ||
const {getFoo} = foo; | ||
const { getFoo } = foo; | ||
expect(getFoo()).to.equal(foo); | ||
}) | ||
}); | ||
@@ -29,8 +24,8 @@ it('works with multiple instances of the same class', function () { | ||
const {getFoo: getFoo1} = foo1; | ||
const {getFoo: getFoo2} = foo2; | ||
const getFoo1 = foo1.getFoo; | ||
const getFoo2 = foo2.getFoo; | ||
expect(getFoo1()).to.equal(foo1); | ||
expect(getFoo2()).to.equal(foo2); | ||
}) | ||
}) | ||
}); | ||
}); |
@@ -25,4 +25,4 @@ import { decorate } from './private/utils'; | ||
export default function deprecate(args) { | ||
return decorate(handleDescriptor, ...args); | ||
export default function deprecate(...args) { | ||
return decorate(handleDescriptor, args); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48897
28
1104
4