Comparing version 1.0.4 to 1.0.5
@@ -0,1 +1,7 @@ | ||
## 1.0.5 (2018-07-03) | ||
* Remove dead code | ||
* Add `findClass` to the exported functions | ||
* Enable registering classes with a `namespace` property | ||
## 1.0.4 (2018-06-18) | ||
@@ -2,0 +8,0 @@ |
@@ -586,3 +586,3 @@ "use strict"; | ||
* @since 1.0.0 | ||
* @version 1.0.0 | ||
* @version 1.0.5 | ||
* | ||
@@ -594,2 +594,4 @@ * @param {String} name The optional name of the class | ||
var context = exports.Classes; | ||
if (typeof name == 'function') { | ||
@@ -600,3 +602,12 @@ constructor = name; | ||
exports.Classes[name] = constructor; | ||
if (constructor.namespace) { | ||
context = fromPath(exports.Classes, constructor.namespace); | ||
if (!context) { | ||
context = {}; | ||
setPath(exports.Classes, constructor.namespace.split('.'), context); | ||
} | ||
} | ||
context[name] = constructor; | ||
} | ||
@@ -609,3 +620,3 @@ | ||
* @since 1.0.0 | ||
* @version 1.0.0 | ||
* @version 1.0.5 | ||
* | ||
@@ -644,2 +655,4 @@ * @param {String} value The name of the class | ||
constructor = fromPath(constructor, value.dry_class); | ||
} else if (value.name) { | ||
constructor = constructor[value.name]; | ||
} | ||
@@ -705,3 +718,3 @@ } | ||
* @since 0.1.4 | ||
* @version 1.0.4 | ||
* @version 1.0.5 | ||
* | ||
@@ -739,4 +752,2 @@ * @return {Mixed} | ||
return temp; | ||
return undry_paths.get(current).undried; | ||
} | ||
@@ -1097,2 +1108,3 @@ | ||
exports.registerUndrier = registerUndrier; | ||
exports.registerDrier = registerDrier; | ||
exports.registerDrier = registerDrier; | ||
exports.findClass = findClass; |
{ | ||
"name": "json-dry", | ||
"description": "Don't repeat yourself, JSON: Add support for (circular) references, class instances, ...", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"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
36241
906