Comparing version 1.1.1 to 1.2.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.2.0"></a> | ||
# [1.2.0](https://github.com/dmbch/mixinable/compare/v1.1.1...v1.2.0) (2017-11-27) | ||
### Features | ||
* add purely async strategy exports ([487f62d](https://github.com/dmbch/mixinable/commit/487f62d)) | ||
<a name="1.1.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.1.1](https://github.com/dmbch/mixinable/compare/v1.1.0...v1.1.1) (2017-11-26) |
15
index.js
@@ -70,2 +70,17 @@ 'use strict'; | ||
exports.async = { | ||
override: function () { | ||
return Promise.resolve(exports.override.apply(null, arguments)); | ||
}, | ||
parallel: function () { | ||
return Promise.resolve(exports.parallel.apply(null, arguments)); | ||
}, | ||
pipe: function () { | ||
return Promise.resolve(exports.pipe.apply(null, arguments)); | ||
}, | ||
compose: function () { | ||
return Promise.resolve(exports.compose.apply(null, arguments)); | ||
} | ||
}; | ||
exports.clone = function clone (instance) { | ||
@@ -72,0 +87,0 @@ var args = argsToArray(arguments).slice(1); |
{ | ||
"name": "mixinable", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Functional JavaScript Mixin Utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
26
test.js
@@ -6,2 +6,4 @@ 'use strict'; | ||
var async = mixinable.async; | ||
test('exports test', function (t) { | ||
@@ -13,2 +15,7 @@ t.equal(typeof mixinable, 'function', 'main export is a function'); | ||
t.equal(typeof mixinable.pipe, 'function', 'pipe is a function'); | ||
t.equal(typeof mixinable.compose, 'function', 'compose is a function'); | ||
t.equal(typeof async.override, 'function', 'async.override is a function'); | ||
t.equal(typeof async.parallel, 'function', 'async.parallel is a function'); | ||
t.equal(typeof async.pipe, 'function', 'async.pipe is a function'); | ||
t.equal(typeof async.compose, 'function', 'async.compose is a function'); | ||
t.end(); | ||
@@ -461,1 +468,20 @@ }); | ||
}); | ||
test('async helper test', function (t) { | ||
var instance = mixinable({ | ||
foo: async.override, | ||
bar: async.parallel, | ||
baz: async.pipe, | ||
qux: async.compose | ||
})({ | ||
foo: function () {}, | ||
bar: function () {}, | ||
baz: function () {}, | ||
qux: function () {} | ||
})(); | ||
t.ok(instance.foo() instanceof Promise, 'override result is a promise'); | ||
t.ok(instance.bar() instanceof Promise, 'parallel result is a promise'); | ||
t.ok(instance.baz() instanceof Promise, 'pipe result is a promise'); | ||
t.ok(instance.qux() instanceof Promise, 'compose result is a promise'); | ||
t.end(); | ||
}); |
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
100964
631