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

@contrail/util

Package Overview
Dependencies
Maintainers
6
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/util - npm Package Compare versions

Comparing version 1.0.13 to 1.0.14

0

lib/index.d.ts
export * from './object-util/object-util';
export * from './string-util/string-util';

@@ -0,0 +0,0 @@ "use strict";

export declare function cloneDeep(obj: any): any;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export interface ObjectDiff {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare const item1Assortment1: {

@@ -0,0 +0,0 @@ "use strict";

export declare function isObject(item: any): boolean;

@@ -0,0 +0,0 @@ "use strict";

export declare function mergeDeep(target: any, ...sources: any[]): any;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { cloneDeep } from './cloneDeep/cloneDeep';

@@ -0,0 +0,0 @@ "use strict";

2

lib/string-util/string-util.d.ts
export declare class StringUtil {
static convertToHyphenCase(entityName: string, transformToLowerCase?: boolean): string;
static parseVariables(variableString: string, data: any, quoteStrings?: boolean): string;
static isString(value: any): boolean;
}

@@ -12,3 +12,28 @@ "use strict";

}
static parseVariables(variableString, data, quoteStrings = false) {
const regExp = /\{([^}]+)\}/;
let done = false;
let currentVariableString = variableString;
while (!done) {
const match = regExp.exec(currentVariableString);
if (!match) {
done = true;
break;
}
const variableLevels = match[1].split('.');
let replacementValue = data;
for (let i = 0; i < variableLevels.length; i++) {
replacementValue = replacementValue[variableLevels[i]];
}
if (quoteStrings && StringUtil.isString(replacementValue)) {
replacementValue = JSON.stringify(replacementValue);
}
currentVariableString = currentVariableString.replace(match[0], replacementValue);
}
return currentVariableString;
}
static isString(value) {
return typeof value === 'string' || value instanceof String;
}
}
exports.StringUtil = StringUtil;

2

package.json
{
"name": "@contrail/util",
"version": "1.0.13",
"version": "1.0.14",
"description": "General javascript utilities",

@@ -5,0 +5,0 @@ "main": "lib/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