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

@lskjs/utils

Package Overview
Dependencies
Maintainers
11
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lskjs/utils - npm Package Compare versions

Comparing version 2.12.3 to 2.13.0

4

package.json
{
"name": "@lskjs/utils",
"version": "2.12.3",
"version": "2.13.0",
"description": "LSK.js – utils – helpers and functions",

@@ -41,3 +41,3 @@ "keywords": [],

},
"gitHead": "04e53e23ad2d447c1fa7ff8e42722735a7e4addc"
"gitHead": "914dad0e7db49d00f8df85df3894f1dc4465c002"
}

@@ -9,3 +9,3 @@ "use strict";

exports.params = params;
exports["default"] = exports.parse = exports.toDate = exports.toJson = exports.toInt = exports.toNumber = exports.toBoolean = exports.notNan = void 0;
exports["default"] = exports.parse = exports.toArray = exports.toDate = exports.toJson = exports.toInt = exports.toNumber = exports.toBoolean = exports.notNan = void 0;

@@ -26,2 +26,3 @@ var _forEach = _interopRequireDefault(require("lodash/forEach"));

/* eslint-disable import/no-extraneous-dependencies */
var notNan = function notNan(a) {

@@ -36,3 +37,3 @@ var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return Boolean((0, _tryParamParse["default"])(a, def));
return a === null ? def : Boolean((0, _tryParamParse["default"])(a, def));
};

@@ -70,2 +71,15 @@

var toArray = function toArray(a) {
var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
if (a === null) return def;
if (Array.isArray(a)) return a;
if (typeof a !== 'string') return [toJson(a)];
if (a === '') return [];
return a.split(',').map(function (b) {
return toJson(b);
});
};
exports.toArray = toArray;
var parse = function parse(a, type, def) {

@@ -77,2 +91,3 @@ if (type === 'boolean' || type === 'bool') return toBoolean(a, def);

if (type === 'date') return toDate(a, def);
if (type === 'array') return toArray(a, def);
return a;

@@ -79,0 +94,0 @@ };

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