@contrail/util 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/string-util/{replaceAll → replaceAllWithFunction}/replaceAllWithFunction.js +3 -2
- package/lib/string-util/string-util.d.ts +1 -1
- package/lib/string-util/string-util.js +1 -1
- package/package.json +1 -1
- /package/lib/string-util/{replaceAll → replaceAllWithFunction}/replaceAllWithFunction.d.ts +0 -0
|
@@ -10,9 +10,10 @@ function replaceAllWithFunction(string, regEx, replacerFunction) {
|
|
|
10
10
|
let matchedString = match[0];
|
|
11
11
|
let index = match.index;
|
|
12
12
|
const newValue = replacerFunction(matchedString);
|
|
13
|
-
|
|
13
|
+
const subString = string.substring(startIndex, index);
|
|
14
|
+
newString += subString;
|
|
14
15
|
newString += newValue;
|
|
15
|
-
startIndex
|
|
16
|
+
startIndex = index + matchedString.length;
|
|
16
17
|
hasMatches = true;
|
|
17
18
|
}
|
|
18
19
|
if (!(newString === null || newString === void 0 ? void 0 : newString.length) && !hasMatches) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { replaceAllWithFunction } from "./
|
|
1
|
+
import { replaceAllWithFunction } from "./replaceAllWithFunction/replaceAllWithFunction";
|
|
2
2
|
export declare class StringUtil {
|
|
3
3
|
static convertToHyphenCase(entityName: string, transformToLowerCase?: boolean): string;
|
|
4
4
|
static parseVariables(variableString: string, data: any, quoteStrings?: boolean): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StringUtil = void 0;
|
|
4
|
-
const replaceAllWithFunction_1 = require("./
|
|
4
|
+
const replaceAllWithFunction_1 = require("./replaceAllWithFunction/replaceAllWithFunction");
|
|
5
5
|
class StringUtil {
|
|
6
6
|
static convertToHyphenCase(entityName, transformToLowerCase = true) {
|
|
7
7
|
const slugName = entityName === null || entityName === void 0 ? void 0 : entityName.split(/(?=[A-Z])/).join('-');
|
package/package.json
CHANGED
|
File without changes
|