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

@contrail/util

Package Overview
Dependencies
Maintainers
9
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.27 to 1.0.28

0

lib/date-util/date-util.d.ts

@@ -0,0 +0,0 @@ import { getIsoDatePart } from "./getIsoDatePart/getIsoDatePart";

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

export declare function getIsoDatePart(date: Date): string;

@@ -0,0 +0,0 @@ export * from './object-util/object-util';

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

export declare class MapUtil {
static keyBy(array: any[], variableString: any): {};
}

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

export declare function applyChangesIfEqual(target: any, priorSourceValues: any, newSourceValues: any, propertyKeys: any): void;
export declare function determineChangesIfEqual(target: any, priorSourceValues: any, newSourceValues: any, propertyKeys: any): any;
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";

@@ -0,0 +0,0 @@ export declare class StringUtil {

29

lib/string-util/string-util.js

@@ -13,15 +13,13 @@ "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('.');
const regExp = /\{([^}]+)\}/g;
const replacedString = variableString.replace(regExp, (match, group) => {
const variableLevels = group.split('.');
let replacementValue = data;
for (let i = 0; i < variableLevels.length; i++) {
replacementValue = replacementValue[variableLevels[i]];
if (replacementValue) {
replacementValue = replacementValue[variableLevels[i]];
}
else {
replacementValue = undefined;
}
}

@@ -41,5 +39,8 @@ if (quoteStrings && StringUtil.isString(replacementValue)) {

}
currentVariableString = currentVariableString.replace(match[0], replacementValue);
}
return currentVariableString;
if (Object.prototype.toString.call(replacementValue) === '[object Object]') {
replacementValue = JSON.stringify(replacementValue);
}
return replacementValue;
});
return replacedString;
}

@@ -46,0 +47,0 @@ static convertToCamelCase(str) {

{
"name": "@contrail/util",
"version": "1.0.27",
"version": "1.0.28",
"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