solvent

0.16.3 • Public • Published

solvent

Simple dependency resolver designed for validating typed dependency contraints.

Build Status codecov

NPM

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');

Package Sidebar

Install

npm i solvent

Weekly Downloads

40

Version

0.16.3

License

MIT

Last publish

Collaborators

  • cchamberlain