solvent
v0.16.3
Published
Simple dependency resolver designed for validating typed dependency contraints.
Downloads
641
Readme
solvent
Simple dependency resolver designed for validating typed dependency contraints.
Install
npm i -S solvent
Usage
import solvent from 'solvent'
export default function (dependencies) {
const { React, connect } = solvent( { React: 'object'
, connect: 'function'
} )(dependencies)
/** DO SOMETHING */
}
TEST
Unit tests output for current release:
TOC
lib
#default
should have default export.
return should.exist(lib.default);
solvent
should be a function.
return solvent.should.be.a('function');
should not throw.
return function () {
return solvent();
}.should.not.throw();
should return a function.
return solvent().should.be.a('function');
should validate object.
var resolver = solvent({ React: 'object' });
resolver({ React: { prop: 'Some property' } }).should.be.an('object').that.has.property('React').that.is.an('object');