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

just-safe-set

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-safe-set - npm Package Compare versions

Comparing version 2.2.3 to 3.0.0

2

index.d.ts
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
declare function set(item: any[] | {}, target: string | symbol | Array<string | symbol>, value: any): boolean;
export = set;
export default set;

@@ -1,2 +0,2 @@

import set = require("./index");
import set from './index'

@@ -7,10 +7,10 @@ const arr = ['one', 'two'];

// OK
set(arr, '0', {});
set(arr, ['0'], '');
set(obj, 'foo.bar', 0);
set(obj, 'foo.bar.0', 1);
set(obj, 'foo.bar', {});
set(obj, 'foo.bar.0', {});
set(obj, 'foo.bar', function(){});
set(obj, 'foo.bar.0', function(){});
set(arr, '0', {});
set(arr, ['0'], '');
set(obj, 'foo.bar', 0);
set(obj, 'foo.bar.0', 1);
set(obj, 'foo.bar', {});
set(obj, 'foo.bar.0', {});
set(obj, 'foo.bar', function(){});
set(obj, 'foo.bar.0', function(){});

@@ -20,20 +20,20 @@

// @ts-expect-error
set();
set();
// @ts-expect-error
set(obj);
set(obj);
// @ts-expect-error
set([]);
set([]);
// @ts-expect-error
set({});
set({});
// @ts-expect-error
set(obj, 3);
set(obj, 3);
// @ts-expect-error
set(obj, [3]);
set(obj, [3]);
// @ts-expect-error
set(false);
set(false);
// @ts-expect-error
set(null);
set(null);
// @ts-expect-error
set(undefined);
set(undefined);
// @ts-expect-error
set(obj, 'foo.bar');
set(obj, 'foo.bar');
{
"name": "just-safe-set",
"version": "2.2.3",
"version": "3.0.0",
"description": "set value at property, create intermediate properties if necessary",

@@ -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