Socket
Socket
Sign inDemoInstall

electron-log

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-log - npm Package Compare versions

Comparing version 4.4.3 to 4.4.4

2

package.json
{
"name": "electron-log",
"version": "4.4.3",
"version": "4.4.4",
"description": "Just a very simple logging module for your Electron application",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -34,2 +34,10 @@ 'use strict';

});
it('should serialize set', function () {
expect(object.serialize(null, new Set([1]))).toEqual([1]);
});
it('should serialize map', function () {
expect(object.serialize(null, new Map([['a', 1]]))).toEqual({ a: 1 });
});
});

@@ -54,3 +62,8 @@

});
it('should convert a set to a string representation', function () {
var set = new Set([1]);
expect(object.toStringFactory()([set])).toEqual('[ 1 ]');
});
});
});

@@ -12,3 +12,8 @@ 'use strict';

function createSerializer() {
/**
* @param {object} options?
* @param {boolean} options.serializeMapAndSet?
* @return {function}
*/
function createSerializer(options) {
var seen = createWeakSet();

@@ -25,3 +30,3 @@

return serialize(key, value);
return serialize(key, value, options);
};

@@ -97,3 +102,11 @@ }

function serialize(key, value) {
/**
* @param {string} key
* @param {any} value
* @param {object} options?
* @return {any}
*/
function serialize(key, value, options) {
var serializeMapAndSet = !options || options.serializeMapAndSet !== false;
if (value instanceof Error) {

@@ -115,2 +128,10 @@ return value.stack;

if (serializeMapAndSet && value instanceof Map && Object.fromEntries) {
return Object.fromEntries(value);
}
if (serializeMapAndSet && value instanceof Set && Array.from) {
return Array.from(value);
}
return value;

@@ -117,0 +138,0 @@ }

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