Socket
Socket
Sign inDemoInstall

decko

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.3 to 1.2.0

dist/decko.d.ts

20

package.json
{
"name": "decko",
"version": "1.1.3",
"main": "decko.js",
"version": "1.2.0",
"main": "dist/decko.js",
"types": "dist/decko.d.ts",
"description": "A collection of the most useful property decorators.",
"scripts": {
"build": "babel -f $npm_package_main -s -o $npm_package_main < src/${npm_package_main}",
"test": "eslint {src,tests}/**.js && mocha --compilers js:babel/register tests/**/*.js",
"build": "mkdir -p dist && babel -f src/decko.js -s -o $npm_package_main < src/decko.js && npm run build:ts",
"build:ts": "cp src/decko.d.ts dist/",
"test": "npm run test:ts && eslint {src,tests}/**.js && mocha --compilers js:babel/register tests/**/*.js",
"test:ts": "tsc -p ./",
"style:ts": "tsfmt -r",
"prepublish": "npm run build",
"release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
},
"files": [
"src",
"dist"
],
"repository": {

@@ -21,4 +29,6 @@ "type": "git",

"eslint": "^1.10.3",
"mocha": "^2.3.0"
"mocha": "^2.3.0",
"typescript": "2.1.6",
"typescript-formatter": "4.1.1"
}
}

@@ -1,6 +0,20 @@

# decko [![NPM Version](http://img.shields.io/npm/v/decko.svg?style=flat)](https://npmjs.com/package/decko) [![Build Status](https://travis-ci.org/developit/decko.svg?branch=master)](https://travis-ci.org/developit/decko)
# decko [![NPM Version](https://img.shields.io/npm/v/decko.svg?style=flat)](https://npmjs.com/package/decko) [![Build Status](https://travis-ci.org/developit/decko.svg?branch=master)](https://travis-ci.org/developit/decko)
> A collection of the most useful [decorators](https://github.com/wycats/javascript-decorators).
A concise implementation of the three most useful [decorators](https://github.com/wycats/javascript-decorators):
- `@bind`: make the value of `this` constant within a method
- `@debounce`: throttle calls to a method
- `@memoize`: cache return values based on arguments
Decorators help simplify code by replacing the noise of common patterns with declarative annotations.
Conversely, decorators can also be overused and create obscurity.
Decko establishes 3 standard decorators that are immediately recognizable, so you can avoid creating decorators in your own codebase.
> 💡 **Tip:** decko is particularly well-suited to [**Preact Classful Components**](https://github.com/developit/preact).
>
> 💫 **Note:**
> - For Babel 6+, be sure to install [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy).
> - For Typescript, be sure to enable `{"experimentalDecorators": true}` in your tsconfig.json.
## Installation

@@ -36,3 +50,3 @@

let e = new Example();
assert.equal(e.foo(), e);
assert.equal(e.foo.call(null), e);
```

@@ -39,0 +53,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc