Comparing version 1.2.1 to 1.3.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/dmbch/mixinable/compare/v1.2.1...v1.3.0) (2018-01-30) | ||
### Features | ||
* add isMixinable() utility function ([313803a](https://github.com/dmbch/mixinable/commit/313803a)) | ||
<a name="1.2.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.2.1](https://github.com/dmbch/mixinable/compare/v1.2.0...v1.2.1) (2017-11-30) |
@@ -72,2 +72,6 @@ 'use strict'; | ||
exports.isMixinable = function isMixinable (obj) { | ||
return obj && '__implementations__' in obj && '__arguments__' in obj; | ||
}; | ||
exports.replicate = function replicate (handleArgs) { | ||
@@ -74,0 +78,0 @@ return function (instance) { |
{ | ||
"name": "mixinable", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Functional JavaScript Mixin Utility", | ||
@@ -8,2 +8,3 @@ "main": "index.js", | ||
"test": "node test.js | tap-spec", | ||
"lint": "semistandard", | ||
"release": "standard-version", | ||
@@ -10,0 +11,0 @@ "postrelease": "git push --follow-tags; npm publish --registry https://registry.npmjs.org/" |
@@ -38,3 +38,3 @@ # Mixinable | ||
And that `create()` function accepts whatever arguments your `constructor()`s accept. | ||
And that `create()` function accepts whatever arguments your `constructor()`s accept. | ||
@@ -164,3 +164,5 @@ ##### Example | ||
`override` returns a `Promise` if one of its implementations does. If you want it to always return a `Promise`, i.e. if you can not be sure whether one of your implementations might return one, please use `define.async.override`. | ||
#### ```define.parallel``` | ||
@@ -200,3 +202,5 @@ | ||
`parallel` returns a `Promise` if one of its implementations does. If you want it to always return a `Promise`, i.e. if you can not be sure whether one of your implementations might return one, please use `define.async.parallel`. | ||
#### ```define.pipe``` | ||
@@ -236,2 +240,5 @@ | ||
`pipe` returns a `Promise` if one of its implementations does. If you want it to always return a `Promise`, i.e. if you can not be sure whether one of your implementations might return one, please use `define.async.pipe`. | ||
#### ```define.compose``` | ||
@@ -254,3 +261,5 @@ | ||
`compose` returns a `Promise` if one of its implementations does. If you want it to always return a `Promise`, i.e. if you can not be sure whether one of your implementations might return one, please use `define.async.compose`. | ||
#### Custom Strategies | ||
@@ -285,3 +294,13 @@ | ||
#### Utilities | ||
##### `define.async` | ||
All of the strategies described above return a `Promise` if one of their implementations does. If you want them to always return a `Promise` please use `define.async.{override,parallel,pipe,compose}`. | ||
##### `define.isMixinable(object)` | ||
If you need to check whether an object actually is an instance of a `mixinable`, you can simply test it using this function that returns `true` or `false`. | ||
### Contributing | ||
@@ -288,0 +307,0 @@ |
@@ -469,2 +469,11 @@ 'use strict'; | ||
test('isMixinable function test', function (t) { | ||
t.notOk(mixinable.isMixinable(), 'non-mixinable is detected'); | ||
t.notOk(mixinable.isMixinable({}), 'non-mixinable is detected'); | ||
t.notOk(mixinable.isMixinable(null), 'non-mixinable is detected'); | ||
t.notOk(mixinable.isMixinable(undefined), 'non-mixinable is detected'); | ||
t.ok(mixinable.isMixinable(mixinable()()()), 'mixinable is detected'); | ||
t.end(); | ||
}); | ||
test('replicate function test', function (t) { | ||
@@ -471,0 +480,0 @@ t.plan(3); |
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
104126
676
312