@equinor/echo-base
Advanced tools
Comparing version 0.6.10 to 0.6.11
@@ -135,3 +135,3 @@ import { __extends } from "tslib"; | ||
} | ||
else if (typeof value === 'object') { | ||
else if (!!value && typeof value === 'object') { | ||
rec[name] = getAllProperties(value, args); | ||
@@ -138,0 +138,0 @@ } |
@@ -139,3 +139,3 @@ "use strict"; | ||
} | ||
else if (typeof value === 'object') { | ||
else if (!!value && typeof value === 'object') { | ||
rec[name] = getAllProperties(value, args); | ||
@@ -142,0 +142,0 @@ } |
{ | ||
"name": "@equinor/echo-base", | ||
"version": "0.6.10", | ||
"version": "0.6.11", | ||
"module": "esm/index.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -45,7 +45,12 @@ import { BaseError, findPropertyByName, getAllProperties } from './BaseError'; | ||
}); | ||
it(`should generate frontEnd stackTraceId if innerError/backEnd stackTraceId is null`, () => { | ||
const innerError = { errors: { errorTraceId: null } }; | ||
const actualError = new BaseError({ name: 'BaseError', message, innerError }); | ||
expect(actualError.errorTraceId).toBe('frontEnd_mocked-static-id-9999'); | ||
}); | ||
}); | ||
describe('getAllProperties', () => { | ||
const input = { a: 'a', b: 1, c: { nestedProp: 'prop1' } }; | ||
it('should return an empty object if undefined argument', () => { | ||
@@ -57,2 +62,3 @@ const actualError = getAllProperties(undefined); | ||
it('should preserve properties of different types', () => { | ||
const input = { a: 'a', b: 1, c: { nestedProp: 'prop1' } }; | ||
const actualError = getAllProperties(input); | ||
@@ -62,2 +68,8 @@ expect(actualError).toStrictEqual(input); | ||
it('should preserve null & undefined value', () => { | ||
const input = { c: { nestedProp: null, nestedProp2: undefined } }; | ||
const actualError = getAllProperties(input); | ||
expect(actualError).toStrictEqual(input); | ||
}); | ||
it('should preserve properties of an Error', () => { | ||
@@ -64,0 +76,0 @@ const actualError = getAllProperties(new CustomTestError('message')); |
@@ -154,3 +154,3 @@ import { BaseErrorArgs } from '../types/error'; | ||
//ignore | ||
} else if (typeof value === 'object') { | ||
} else if (!!value && typeof value === 'object') { | ||
rec[name] = getAllProperties(value, args); | ||
@@ -157,0 +157,0 @@ } else { |
Sorry, the diff of this file is not supported yet
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
296170
5876