Comparing version 1.0.8 to 1.0.9
@@ -0,1 +1,6 @@ | ||
## 1.0.9 (2018-12-06) | ||
* Also export the `walk` function | ||
* Use `Namespace.getClassForUndry()` methods if available | ||
## 1.0.8 (2018-11-09) | ||
@@ -2,0 +7,0 @@ |
@@ -623,3 +623,3 @@ "use strict"; | ||
* @since 1.0.0 | ||
* @version 1.0.5 | ||
* @version 1.0.9 | ||
* | ||
@@ -630,3 +630,4 @@ * @param {String} value The name of the class | ||
var constructor; | ||
var constructor, | ||
ns; | ||
@@ -652,12 +653,22 @@ // Return nothing for falsy values | ||
if (value.namespace) { | ||
constructor = fromPath(exports.Classes, value.namespace); | ||
ns = fromPath(exports.Classes, value.namespace); | ||
} else { | ||
constructor = exports.Classes; | ||
ns = exports.Classes; | ||
} | ||
if (value.dry_class) { | ||
constructor = fromPath(constructor, value.dry_class); | ||
constructor = fromPath(ns, value.dry_class); | ||
} else if (value.name) { | ||
constructor = constructor[value.name]; | ||
constructor = ns[value.name]; | ||
} | ||
if (!constructor && ns) { | ||
if (ns.main_class) { | ||
ns = ns.main_class; | ||
} | ||
if (ns && typeof ns.getClassForUndry == 'function') { | ||
constructor = ns.getClassForUndry(value.dry_class || value.name); | ||
} | ||
} | ||
} | ||
@@ -975,2 +986,3 @@ | ||
* @param {Function} fnc The function to perform on every entry | ||
* @param {Object} result The object to add to | ||
* | ||
@@ -1146,2 +1158,3 @@ * @return {Object} | ||
exports.registerDrier = registerDrier; | ||
exports.findClass = findClass; | ||
exports.findClass = findClass; | ||
exports.walk = walk; |
{ | ||
"name": "json-dry", | ||
"description": "Don't repeat yourself, JSON: Add support for (circular) references, class instances, ...", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"author": "Jelle De Loecker <jelle@develry.be>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
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
38000
947