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

h3lp

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h3lp - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

3

manager/object.d.ts

@@ -10,3 +10,4 @@ import { HttpHelper } from './http';

names(value: string): string[];
getValue(name: string, source: any): any;
getValue(source: any, name: string): any;
setValue(source: any, name: string, value: any): void;
sort(source: any): any;

@@ -13,0 +14,0 @@ fromEntries(array: any[]): any;

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

}
getValue(name, source) {
getValue(source, name) {
const names = this.names(name);

@@ -86,2 +86,32 @@ let value = source;

}
setValue(source, name, value) {
const names = name.split('.');
const level = names.length - 1;
let data = source;
for (let i = 0; i < names.length; i++) {
const name = names[i];
// if is an array and name is a positive integer
if (Array.isArray(data) && this.validator.isPositiveInteger(name)) {
const index = Number(name);
// If the index exceeds the length of the array, nothing assigns it.
if (index >= data.length) {
return;
}
if (i === level) {
data[index] = value;
}
else {
data = data[index];
}
}
else {
if (i === level) {
data[name] = value;
}
else {
data = data[name];
}
}
}
}
sort(source) {

@@ -88,0 +118,0 @@ const target = {};

{
"name": "h3lp",
"version": "0.2.4",
"version": "0.2.5",
"description": "Helper for nodeJs",

@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@hotmail.com>",

Sorry, the diff of this file is not supported yet

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