Comparing version 0.4.0 to 0.4.1
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## 0.5.0 - 2015-04-29 | ||
### Changed | ||
- update `.travis`. | ||
### Changed | ||
- fixpack. | ||
### Removed | ||
- removed `.zuul`. | ||
## 0.4.0 - 2015-04-12 | ||
@@ -5,0 +15,0 @@ ### Changed |
{ | ||
"name": "apply-or", | ||
"version": "0.4.0", | ||
"description": "Invoke .apply if value is a function, otherwise, return default value.", | ||
"main": "index.js", | ||
"scripts": { | ||
"dev": "nodemon -x 'npm run test' -e 'js json'", | ||
"standard": "standard", | ||
"test": "npm run standard && node test.js | tap-spec", | ||
"cover": "istanbul cover test.js" | ||
"version": "0.4.1", | ||
"author": "Wil Moore III <wil.moore@wilmoore.com>", | ||
"bugs": { | ||
"url": "https://github.com/wilmoore/apply-or.js/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wilmoore/apply-or.js" | ||
"dependencies": { | ||
"to-array.js": "^0.10.0" | ||
}, | ||
"devDependencies": { | ||
"istanbul": "^0.3.13", | ||
"nodemon": "^1.3.7", | ||
"standard": "^3.3.0", | ||
"tap-spec": "^2.2.2", | ||
"tape": "^4.0.0", | ||
"tape-catch": "^1.0.4" | ||
}, | ||
"files": [ | ||
@@ -22,23 +26,23 @@ "index.js", | ||
], | ||
"homepage": "https://github.com/wilmoore/apply-or.js", | ||
"keywords": [ | ||
"module", | ||
"apply", | ||
"apply-or", | ||
"default", | ||
"if-function", | ||
"is-function", | ||
"apply-or", | ||
"apply" | ||
"module" | ||
], | ||
"author": "Wil Moore III <wil.moore@wilmoore.com>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"istanbul": "^0.3.13", | ||
"nodemon": "^1.3.7", | ||
"standard": "^3.3.0", | ||
"tap-spec": "^3.0.0", | ||
"tape": "^3.5.0", | ||
"tape-catch": "^1.0.4" | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wilmoore/apply-or.js" | ||
}, | ||
"dependencies": { | ||
"to-array.js": "^0.10.0" | ||
"scripts": { | ||
"cover": "istanbul cover test.js", | ||
"dev": "nodemon -x 'npm run test --silent' -e 'js json'", | ||
"standard": "standard", | ||
"test": "npm run standard --silent && node test.js | tap-spec" | ||
} | ||
} |
@@ -1,12 +0,13 @@ | ||
# apply-or [![Build Status](http://img.shields.io/travis/wilmoore/apply-or.js.svg)](https://travis-ci.org/wilmoore/apply-or.js) [![Code Climate](https://codeclimate.com/github/wilmoore/apply-or.js/badges/gpa.svg)](https://codeclimate.com/github/wilmoore/apply-or.js) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
# apply-or | ||
> Invoke .apply if value is a function, otherwise, return default value. | ||
###### npm install | ||
[![Build Status](http://img.shields.io/travis/wilmoore/apply-or.js.svg)](https://travis-ci.org/wilmoore/apply-or.js) [![Code Climate](https://codeclimate.com/github/wilmoore/apply-or.js/badges/gpa.svg)](https://codeclimate.com/github/wilmoore/apply-or.js) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
npm install apply-or --save | ||
```shell | ||
npm install apply-or --save | ||
``` | ||
###### npm stats | ||
[![npm](https://img.shields.io/npm/v/apply-or.svg)](https://www.npmjs.org/package/apply-or) [![NPM downloads](http://img.shields.io/npm/dm/apply-or.svg)](https://www.npmjs.org/package/apply-or) [![Dependency Status](https://gemnasium.com/wilmoore/apply-or.js.svg)](https://gemnasium.com/wilmoore/apply-or.js) | ||
[![npm](https://img.shields.io/npm/v/apply-or.svg)](https://www.npmjs.org/package/apply-or) [![NPM downloads](http://img.shields.io/npm/dm/apply-or.svg)](https://www.npmjs.org/package/apply-or) [![Dependency Status](https://gemnasium.com/wilmoore/apply-or.js.svg)](https://gemnasium.com/wilmoore/apply-or.js) | ||
@@ -19,28 +20,35 @@ ## Why? | ||
var apply = require('apply-or'); | ||
```js | ||
var apply = require('apply-or'); | ||
function divmax (divisor) { | ||
return Math.max.apply(null, this.val) / divisor | ||
} | ||
function divmax (divisor) { | ||
return Math.max.apply(null, this.val) / divisor | ||
} | ||
var data = { | ||
val: [9, 7, 15, 12] | ||
} | ||
var data = { | ||
val: [9, 7, 15, 12] | ||
} | ||
apply(divmax, 5, data) | ||
//=> divmax.apply({ val: [9, 7, 15, 12] }, [5]) | ||
//=> 15 / 5 | ||
//=> 3 | ||
apply(divmax, 5, data) | ||
//=> divmax.apply({ val: [9, 7, 15, 12] }, [5]) | ||
//=> 15 / 5 | ||
//=> 3 | ||
``` | ||
## API | ||
###### `apply(func, args, self)` | ||
### `apply(func, args, self)` | ||
* `func` Function to be invoked. | ||
* `args` Arguments to apply to function. | ||
* `self` `this` value. | ||
###### arguments | ||
* `func: (Function)` Function to be invoked. | ||
* `args: (Array|*)` Arguments to apply to function. | ||
* `self: (Object)` `this` value. | ||
###### returns | ||
* `(*)` Result of applying function or default value. | ||
## Licenses | ||
[![LICENSE](http://img.shields.io/npm/l/apply-or.svg)](license) | ||
[![GitHub license](https://img.shields.io/github/license/wilmoore/apply-or.js.svg)](https://github.com/wilmoore/apply-or.js/blob/master/index.js) |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5698
1
1
54