idiosyncrasies
v0.1.13
Published
Define rules by which a collection of parameters can be validated and revised to contain the desired values.
Maintainers
Readme
idiosyncrasies
Intended to make passing complex option lists into functions easier to maintain.
Define rules by which a collection of parameters can be validated and revised to contain the desired values. Once an instance is defined the created properties will automatically validate and revise input values as they are set.
Can also apply a list of options together and each will be revised as it's set.
constructor
new Idiosyncrasies (expectation1,expectation2,..expectationN) => idiosyncrasiesCreate a idiosyncrasies instance from one or more expectations. Not as forgiving as Idiosyncrasies.create() but can be used by a subtype.
static members
Idiosyncrasies.create(expectation1,expectation2,..expectationN) => idiosyncrasiesCreate a idiosyncrasies instance from one or more expectations. Arguments that aren't expectations will be converted if possible.
Idiosyncrasies.fromIterable(expectations) => idiosyncrasiesCreate a idiosyncrasies instance from an iterable (array, set, map, etc) of expectations.
Idiosyncrasies.fromObject(expectations) => idiosyncrasiesCreate a idiosyncrasies instance from an object's properties. Will be treated as an iterable of key-value pairs.
Idiosyncrasies.defineValues(idiosyncrasies, expectations) => idiosyncrasiesDefine expectation-baked properties on a idiosyncrasies instance. If value passed as instance isn't a valid instance but can be converted into one then will do so. Returns instance.
Idiosyncrasies.applyValues(idiosyncrasies, values) => idiosyncrasiesApply a set of values to a idiosyncrasies instance. If value passed as instance isn't a valid instance but can be converted into one then will do so. Values can be a map, an object, or an iterable of key-value pairs. Should produce the same result as manually setting the values one at a time. Returns instance.
instance members
idiosyncrasies.defineValues(expectations) => idiosyncrasiesDefine expectation-baked properties on a idiosyncrasies instance.
idiosyncrasies.applyValues(values) => idiosyncrasiesApply a set of values to a idiosyncrasies instance. Values can be a map, an object, or an iterable of key-value pairs. Should produce the same result as manually setting the values one at a time. Returns itself.
Dependencies
- [expectation]
Requires Node 4 with harmony features or Traceur.
License
ISC
