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

just-safe-get

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-safe-get - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

20

index.js

@@ -24,13 +24,19 @@ module.exports = get;

function get(obj, props) {
function get(obj, propsArg) {
if (!obj) {
return obj;
}
if (typeof props == 'string') {
props = props.split('.');
var props, prop;
if (Array.isArray(propsArg)) {
props = propsArg.slice(0);
}
if (typeof props == 'symbol') {
props = [props];
if (typeof propsArg == 'string') {
props = propsArg.split('.');
}
var prop;
if (typeof propsArg == 'symbol') {
props = [propsArg];
}
if (!Array.isArray(props)) {
throw new Error('props arg must be an array, a string or a symbol');
}
while (props.length) {

@@ -40,3 +46,3 @@ prop = props.shift();

if (!obj) {
return obj;
return void 0;
}

@@ -43,0 +49,0 @@ }

{
"name": "just-safe-get",
"version": "1.3.0",
"version": "1.3.1",
"description": "get value at property, don't throw if parent is undefined",

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

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