Comparing version 1.9.7 to 1.9.8
@@ -161,5 +161,24 @@ /** | ||
} | ||
function ObjectGenerate(prototype=null, ...props) { | ||
const object = Object.create(prototype); | ||
for ( const carrier of props ) { | ||
/** | ||
* @param {Object} [prototype] | ||
* @param {Object[]} fields | ||
* @returns {Object} | ||
**/ | ||
function ObjectGenerate(prototype, ...fields) { | ||
let object; | ||
if ( fields.length >= 2 ) { | ||
object = Object.create(fields[0]); | ||
fields = fields.slice(1); | ||
} | ||
else { | ||
object = Object.create(null); | ||
fields.push(prototype); | ||
} | ||
for ( const carrier of fields ) { | ||
if ( carrier === null || carrier === undefined ) | ||
continue; | ||
if ( Object(carrier) === carrier ) { | ||
@@ -166,0 +185,0 @@ Object.assign(object, carrier); |
{ | ||
"name": "extes", | ||
"version": "1.9.7", | ||
"version": "1.9.8", | ||
"description": "A tiny library that extends native js with some handy tools", | ||
@@ -5,0 +5,0 @@ "main": "index.mjs", |
33652
1151