just-safe-set
Advanced tools
Comparing version 2.2.3 to 3.0.0
// 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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93
4650