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

@incanta/config

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@incanta/config - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

1

lib/config.d.ts

@@ -18,2 +18,3 @@ export interface IConfigOptions {

normalizeString(value: string, currentPath: string[]): string;
normalizeArray(arr: any[], currentPath: string[]): any[];
normalizeObject(obj: any, currentPath: string[]): any;

@@ -20,0 +21,0 @@ tryGet<T>(key: string): T | null;

@@ -141,2 +141,21 @@ "use strict";

}
normalizeArray(arr, currentPath) {
return arr.map((value) => {
if (typeof value === "string") {
return this.normalizeString(value, currentPath);
}
else if (typeof value === "object") {
if (value === null) {
return null;
}
else if (Array.isArray(value)) {
return this.normalizeArray(value, currentPath);
}
else {
return this.normalizeObject(value, currentPath);
}
}
return value;
});
}
normalizeObject(obj, currentPath) {

@@ -157,3 +176,3 @@ if (typeof obj !== "object" || obj === null) {

else if (Array.isArray(value)) {
continue;
newObj[property] = this.normalizeArray(value, currentPath);
}

@@ -160,0 +179,0 @@ else {

2

package.json
{
"name": "@incanta/config",
"version": "0.4.1",
"version": "0.4.2",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "exports": {

@@ -204,2 +204,20 @@ import merge from "lodash.merge";

public normalizeArray(arr: any[], currentPath: string[]): any[] {
return arr.map((value) => {
if (typeof value === "string") {
return this.normalizeString(value, currentPath);
} else if (typeof value === "object") {
if (value === null) {
return null;
} else if (Array.isArray(value)) {
return this.normalizeArray(value, currentPath);
} else {
return this.normalizeObject(value, currentPath);
}
}
return value;
});
}
public normalizeObject(obj: any, currentPath: string[]): any {

@@ -220,3 +238,3 @@ if (typeof obj !== "object" || obj === null) {

} else if (Array.isArray(value)) {
continue;
newObj[property] = this.normalizeArray(value, currentPath);
} else {

@@ -223,0 +241,0 @@ newObj[property] = this.normalizeObject(value, [

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