Comparing version 0.2.2 to 0.2.3
@@ -127,3 +127,3 @@ var util = require("util"); | ||
if (properties.parent.throwOnInvalid && (!_validValue || !_validType)){ | ||
if (self.throwOnInvalid && (!_validValue || !_validType)){ | ||
console.log("Property: " + self.name); | ||
@@ -204,2 +204,4 @@ console.log(_validationMessages.join("\n")); | ||
this.value = properties.value || properties.default; | ||
this.throwOnInvalid = properties.throwOnInvalid; | ||
@@ -206,0 +208,0 @@ validate(); |
@@ -117,4 +117,4 @@ "use strict"; | ||
*/ | ||
function Thing(){ | ||
initInstanceVars.call(this); | ||
function Thing(options){ | ||
initInstanceVars.call(this, options); | ||
} | ||
@@ -183,2 +183,4 @@ util.inherits(Thing, EventEmitter); | ||
definition.parent = this; | ||
definition.throwOnInvalid = this.throwOnInvalid; | ||
@@ -613,3 +615,3 @@ if (!(definition instanceof PropertyDefinition)){ | ||
function initInstanceVars(){ | ||
function initInstanceVars(options){ | ||
if (!this._definitions){ | ||
@@ -621,4 +623,5 @@ Object.defineProperty(this, "_definitions", { enumerable: false, configurable: false, value: {} }); | ||
} | ||
this.throwOnInvalid = options && options.throwOnInvalid; | ||
} | ||
module.exports = Thing; |
{ | ||
"name": "nature", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Classify the things in your world and how they interact.", | ||
@@ -5,0 +5,0 @@ "main": "lib/nature.js", |
[![NPM version](https://badge.fury.io/js/nature.png)](http://badge.fury.io/js/nature) | ||
[![Build Status](https://travis-ci.org/75lb/nature.png)](https://travis-ci.org/75lb/nature) | ||
[![Dependency Status](https://david-dm.org/75lb/nature.png)](https://david-dm.org/75lb/nature) | ||
![Analytics](https://ga-beacon.appspot.com/UA-27725889-9/nature/README.md?pixel) | ||
***library under construction*** | ||
@@ -5,0 +7,0 @@ |
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
89985
12
1641
490