Socket
Socket
Sign inDemoInstall

bind-decorator

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bind-decorator - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

index.d.ts

@@ -1,2 +0,2 @@

export declare function bind<T extends Function>(target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
export declare function bind<T>(target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
export default bind;
"use strict";
function bind(target, propertyKey, descriptor) {
if (!descriptor || (typeof descriptor.value !== 'function'))
if (!descriptor || (typeof descriptor.value !== 'function')) {
throw new TypeError("Only functions can be decorated with @bind. <" + propertyKey + "> is not a function!");
}
return {

@@ -6,0 +7,0 @@ configurable: true,

{
"name": "bind-decorator",
"version": "1.0.7",
"version": "1.0.8",
"description": "The fastest automatic method.bind(this) decorator",

@@ -8,10 +8,9 @@ "main": "index.js",

"scripts": {
"test": "tsc && jest --verbose",
"jest-cov": "tsc --sourceMap -p . && jest --verbose --coverage --collectCoverageFrom src/index.js",
"test": "tsc -p __tests__ && jest --verbose",
"jest-cov": "tsc --sourceMap -p __tests__ && jest --verbose --coverage --collectCoverageFrom src/index.js",
"map-cov": "remap-istanbul -i ./coverage/coverage-final.json -t lcovonly -o ./lcov.info",
"report-cov": "codeclimate-test-reporter < ./lcov.info",
"coverage": "npm run jest-cov && npm run map-cov && npm run report-cov",
"typings": "typings install",
"npm": "npm run clean && tsc -d -p . && mv ./src/index.js . && mv ./src/index.d.ts .",
"clean": "rm -f ./src/index.js* ./__tests__/*.d.ts ./__tests__/*.js* ./lcov.info && rm -f -R ./coverage"
"clean": "rm -f ./src/index.js* ./__tests__/*.d.ts ./__tests__/*.js ./lcov.info && rm -f -R ./coverage"
},

@@ -37,8 +36,8 @@ "repository": {

"devDependencies": {
"codeclimate-test-reporter": "^0.3.3",
"jest": "^15.1.1",
"remap-istanbul": "^0.6.4",
"typescript": "^1.8.10",
"typings": "^1.3.3"
"codeclimate-test-reporter": "^0.4.0",
"jest": "^16.0.0",
"remap-istanbul": "^0.7.0",
"typescript": "^2.0.3",
"@types/jest": "^15.1.32"
}
}

@@ -11,2 +11,4 @@ # bind-decorator

[![Issue Count](https://codeclimate.com/github/NoHomey/bind-decorator/badges/issue_count.svg)](https://codeclimate.com/github/NoHomey/bind-decorator)
![TypeScript](https://img.shields.io/badge/%3C%20%2F%3E-TypeScript-blue.svg)
![Typings](https://img.shields.io/badge/typings-%E2%9C%93-brightgreen.svg)

@@ -13,0 +15,0 @@ `@bind` is just a little faster version of [`@autobind`](https://github.com/andreypopp/autobind-decorator/blob/master/src/index.js) for decorating methods only, by binding them to the current context. It is written in TypeScript and follows the latest `decorator`s [purposal](http://tc39.github.io/proposal-decorators/).

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