Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@equinor/echo-base

Package Overview
Dependencies
Maintainers
12
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/echo-base - npm Package Compare versions

Comparing version 0.6.11 to 0.6.12

6

esm/errors/BaseError.js

@@ -131,6 +131,8 @@ import { __extends } from "tslib";

var value = object[name];
var valueType = typeof value;
if (valueType === 'function' || isPropertyIgnored(name, args)) {
if (typeof value === 'function' || isPropertyIgnored(name, args)) {
//ignore
}
else if (Array.isArray(value)) {
rec[name] = value;
}
else if (!!value && typeof value === 'object') {

@@ -137,0 +139,0 @@ rec[name] = getAllProperties(value, args);

@@ -135,6 +135,8 @@ "use strict";

var value = object[name];
var valueType = typeof value;
if (valueType === 'function' || isPropertyIgnored(name, args)) {
if (typeof value === 'function' || isPropertyIgnored(name, args)) {
//ignore
}
else if (Array.isArray(value)) {
rec[name] = value;
}
else if (!!value && typeof value === 'object') {

@@ -141,0 +143,0 @@ rec[name] = getAllProperties(value, args);

{
"name": "@equinor/echo-base",
"version": "0.6.11",
"version": "0.6.12",
"module": "esm/index.js",

@@ -34,5 +34,5 @@ "main": "lib/index.js",

"devDependencies": {
"@types/node": "^17.0.42",
"typedoc": "^0.22.17",
"typescript": "^4.7.3"
"@types/node": "^18.0.3",
"typedoc": "^0.23.5",
"typescript": "^4.7.4"
},

@@ -39,0 +39,0 @@ "files": [

@@ -180,2 +180,21 @@ import { BaseError, findPropertyByName, getAllProperties } from './BaseError';

});
it('should find and return properties of different types: string, number, array ', () => {
const record = {
aString: 'name',
aNumber: 0,
anEmptyString: '',
nested: { anArray: ['a', 'b'] },
aNullValue: null,
anUndefined: undefined
};
expect(findPropertyByName(record, 'aString')).toBe('name');
expect(findPropertyByName(record, 'aNumber')).toBe(0);
expect(findPropertyByName(record, 'anEmptyString')).toBe('');
expect(findPropertyByName(record, 'nested')).toStrictEqual({ anArray: ['a', 'b'] });
expect(findPropertyByName(record, 'anArray')).toStrictEqual(['a', 'b']);
expect(findPropertyByName(record, 'aNullValue')).toBe(null);
expect(findPropertyByName(record, 'anUndefined')).toBe(undefined);
});
});

@@ -182,0 +201,0 @@

@@ -151,5 +151,6 @@ import { BaseErrorArgs } from '../types/error';

const value = object[name];
const valueType = typeof value;
if (valueType === 'function' || isPropertyIgnored(name, args)) {
if (typeof value === 'function' || isPropertyIgnored(name, args)) {
//ignore
} else if (Array.isArray(value)) {
rec[name] = value;
} else if (!!value && typeof value === 'object') {

@@ -156,0 +157,0 @@ rec[name] = getAllProperties(value, args);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc