Comparing version 1.0.76 to 1.0.77
@@ -27,3 +27,6 @@ "use strict"; | ||
for (const prop in item) { | ||
inherit_operations_macro_recursive(item[prop], operation); | ||
// we dont want to propagate operations into nested objects, such as $guid objects | ||
if (Array.isArray(item[prop])) { | ||
inherit_operations_macro_recursive(item[prop], operation); | ||
} | ||
} | ||
@@ -30,0 +33,0 @@ } |
@@ -94,3 +94,14 @@ "use strict"; | ||
}); | ||
(0, mocha_1.test)('skips nested objects', () => { | ||
const mutation = { | ||
$operation: 'create', | ||
products: {} | ||
}; | ||
(0, inherit_operations_macro_1.apply_inherit_operations_macro)(mutation); | ||
(0, chai_1.expect)(mutation).to.deep.equal({ | ||
$operation: 'create', | ||
products: {} | ||
}); | ||
}); | ||
}); | ||
}); |
{ | ||
"name": "orma", | ||
"version": "1.0.76", | ||
"version": "1.0.77", | ||
"description": "A declarative relational syncronous orm", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -32,3 +32,6 @@ import { deep_for_each, is_simple_object } from '../../helpers/helpers' | ||
for (const prop in item) { | ||
inherit_operations_macro_recursive(item[prop], operation) | ||
// we dont want to propagate operations into nested objects, such as $guid objects | ||
if (Array.isArray(item[prop])) { | ||
inherit_operations_macro_recursive(item[prop], operation) | ||
} | ||
} | ||
@@ -35,0 +38,0 @@ } |
@@ -99,3 +99,16 @@ import { describe, test } from 'mocha' | ||
}) | ||
test('skips nested objects', () => { | ||
const mutation = { | ||
$operation: 'create', | ||
products: {} | ||
} | ||
apply_inherit_operations_macro(mutation) | ||
expect(mutation).to.deep.equal({ | ||
$operation: 'create', | ||
products: {} | ||
}) | ||
}) | ||
}) | ||
}) |
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
1019377
24677