ezobjects
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -49,5 +49,3 @@ /** | ||
parent[table.className] = class { | ||
/** | ||
* Constructor for new object. | ||
*/ | ||
/** Constructor for new object. */ | ||
constructor(data = {}) { | ||
@@ -182,7 +180,9 @@ /** Loop through each field in the table */ | ||
*/ | ||
Object.defineProperty(parent[table.className], 'name', {value: table.name}); | ||
Object.defineProperty(parent[table.className], 'name', { value: table.name }); | ||
} | ||
/** Create our table model! */ | ||
createObject(table); | ||
/** Example uses of resulting class on global scope */ | ||
const a = new Person(); | ||
@@ -189,0 +189,0 @@ |
{ | ||
"name": "ezobjects", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Easy dynamic object generation with strict typing and set chaining", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -45,2 +45,3 @@ # EZ Objects | ||
/** Create a class on the global scope using the configuration provided in `table` */ | ||
function createObject(table) { | ||
@@ -57,5 +58,3 @@ let parent; | ||
parent[table.className] = class { | ||
/** | ||
* Constructor for new object. | ||
*/ | ||
/** Constructor for new object. */ | ||
constructor(data = {}) { | ||
@@ -193,4 +192,6 @@ /** Loop through each field in the table */ | ||
/** Create our table model! */ | ||
createObject(table); | ||
/** Example newly initialized object using defaults */ | ||
const a = new Person(); | ||
@@ -200,2 +201,3 @@ | ||
/** Example newly initialized object using data object as parameter to constructor */ | ||
const b = new Person({ | ||
@@ -212,2 +214,3 @@ id: 1, | ||
/** Example newly initialized object using defaults, then assigning properties using setter methods */ | ||
const c = new Person(); | ||
@@ -214,0 +217,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
14498
264