Comparing version 1.0.0-alpha.11 to 1.0.0-alpha.12
@@ -0,1 +1,5 @@ | ||
# 1.0.0-alpha.12 | ||
* [FEATURE] interpret de/serialisation depth of null as infinite depth | ||
# 1.0.0-alpha.11 | ||
@@ -2,0 +6,0 @@ |
@@ -122,3 +122,3 @@ "use strict"; | ||
options = __assign({ validate: true, associations: true, depth: 1 }, options); | ||
assocOptions = __assign({}, options, { depth: options.depth - 1 }); | ||
assocOptions = __assign({}, options, { depth: options.depth !== null ? options.depth - 1 : null }); | ||
// Force it to be a plain object in case it isn't already. | ||
@@ -162,3 +162,3 @@ // This allows weird behaviour like passing in an existing model | ||
} | ||
if (!(assocOptions.depth >= 0)) return [3 /*break*/, 4]; | ||
if (!(assocOptions.depth === null || assocOptions.depth >= 0)) return [3 /*break*/, 4]; | ||
if (!(assoc.type === association_1.HAS_MANY || assoc.type === association_1.BELONGS_TO_MANY)) return [3 /*break*/, 2]; | ||
@@ -165,0 +165,0 @@ // Only deserialize these types if the value is array-like. |
{ | ||
"name": "modelsafe", | ||
"version": "1.0.0-alpha.11", | ||
"version": "1.0.0-alpha.12", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/creativecuriositystudio/modelsafe/issues", |
@@ -122,3 +122,3 @@ /** Contains the model classes and decorators. */ | ||
depth: options.depth - 1 | ||
depth: options.depth !== null ? options.depth - 1 : null, | ||
}; | ||
@@ -168,3 +168,3 @@ | ||
if (assocOptions.depth >= 0) { | ||
if (assocOptions.depth === null || assocOptions.depth >= 0) { | ||
// If it's an array like relationship and the value is an array, deserialize each element | ||
@@ -171,0 +171,0 @@ if (assoc.type === HAS_MANY || assoc.type === BELONGS_TO_MANY) { |
Sorry, the diff of this file is not supported yet
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
343772