@etsoo/shared 1.0.59 → 1.0.60
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/__tests__/Utils.ts +0 -2
- package/lib/cjs/Utils.d.ts +11 -0
- package/lib/cjs/Utils.js +7 -0
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.js +0 -1
- package/lib/mjs/Utils.d.ts +11 -0
- package/lib/mjs/Utils.js +7 -0
- package/lib/mjs/index.d.ts +0 -1
- package/lib/mjs/index.js +0 -1
- package/package.json +1 -1
- package/src/Utils.ts +23 -0
- package/src/index.ts +0 -1
- package/lib/cjs/StringExtensions.d.ts +0 -1
- package/lib/cjs/StringExtensions.js +0 -9
- package/lib/mjs/StringExtensions.d.ts +0 -1
- package/lib/mjs/StringExtensions.js +0 -8
- package/src/String.d.ts +0 -9
- package/src/StringExtensions.ts +0 -12
package/__tests__/Utils.ts
CHANGED
package/lib/cjs/Utils.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { DataTypes } from './DataTypes';
|
|
2
|
+
declare global {
|
|
3
|
+
interface String {
|
|
4
|
+
/**
|
|
5
|
+
* Format string
|
|
6
|
+
* @param this Template
|
|
7
|
+
* @param parameters Parameters to fill the template
|
|
8
|
+
* @returns Result
|
|
9
|
+
*/
|
|
10
|
+
format(this: string, ...parameters: string[]): string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* Utilities
|
|
4
15
|
*/
|
package/lib/cjs/Utils.js
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Utils = void 0;
|
|
4
4
|
const DataTypes_1 = require("./DataTypes");
|
|
5
|
+
String.prototype.format = function (...parameters) {
|
|
6
|
+
let template = this;
|
|
7
|
+
parameters.forEach((value, index) => {
|
|
8
|
+
template = template.replace(new RegExp(`\\{${index}\\}`, 'g'), value);
|
|
9
|
+
});
|
|
10
|
+
return template;
|
|
11
|
+
};
|
|
5
12
|
/**
|
|
6
13
|
* Utilities
|
|
7
14
|
*/
|
package/lib/cjs/index.d.ts
CHANGED
package/lib/cjs/index.js
CHANGED
|
@@ -17,5 +17,4 @@ __exportStar(require("./DomUtils"), exports);
|
|
|
17
17
|
__exportStar(require("./ExtendUtils"), exports);
|
|
18
18
|
__exportStar(require("./NumberUtils"), exports);
|
|
19
19
|
__exportStar(require("./StorageUtils"), exports);
|
|
20
|
-
__exportStar(require("./StringExtensions"), exports);
|
|
21
20
|
__exportStar(require("./Utils"), exports);
|
package/lib/mjs/Utils.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { DataTypes } from './DataTypes';
|
|
2
|
+
declare global {
|
|
3
|
+
interface String {
|
|
4
|
+
/**
|
|
5
|
+
* Format string
|
|
6
|
+
* @param this Template
|
|
7
|
+
* @param parameters Parameters to fill the template
|
|
8
|
+
* @returns Result
|
|
9
|
+
*/
|
|
10
|
+
format(this: string, ...parameters: string[]): string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* Utilities
|
|
4
15
|
*/
|
package/lib/mjs/Utils.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { DataTypes } from './DataTypes';
|
|
2
|
+
String.prototype.format = function (...parameters) {
|
|
3
|
+
let template = this;
|
|
4
|
+
parameters.forEach((value, index) => {
|
|
5
|
+
template = template.replace(new RegExp(`\\{${index}\\}`, 'g'), value);
|
|
6
|
+
});
|
|
7
|
+
return template;
|
|
8
|
+
};
|
|
2
9
|
/**
|
|
3
10
|
* Utilities
|
|
4
11
|
*/
|
package/lib/mjs/index.d.ts
CHANGED
package/lib/mjs/index.js
CHANGED
package/package.json
CHANGED
package/src/Utils.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { DataTypes } from './DataTypes';
|
|
2
2
|
|
|
3
|
+
declare global {
|
|
4
|
+
interface String {
|
|
5
|
+
/**
|
|
6
|
+
* Format string
|
|
7
|
+
* @param this Template
|
|
8
|
+
* @param parameters Parameters to fill the template
|
|
9
|
+
* @returns Result
|
|
10
|
+
*/
|
|
11
|
+
format(this: string, ...parameters: string[]): string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
String.prototype.format = function (
|
|
16
|
+
this: string,
|
|
17
|
+
...parameters: string[]
|
|
18
|
+
): string {
|
|
19
|
+
let template = this;
|
|
20
|
+
parameters.forEach((value, index) => {
|
|
21
|
+
template = template.replace(new RegExp(`\\{${index}\\}`, 'g'), value);
|
|
22
|
+
});
|
|
23
|
+
return template;
|
|
24
|
+
};
|
|
25
|
+
|
|
3
26
|
/**
|
|
4
27
|
* Utilities
|
|
5
28
|
*/
|
package/src/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
String.prototype.format = function (...parameters) {
|
|
4
|
-
let template = this;
|
|
5
|
-
parameters.forEach((value, index) => {
|
|
6
|
-
template = template.replace(new RegExp(`\\{${index}\\}`, 'g'), value);
|
|
7
|
-
});
|
|
8
|
-
return template;
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/String.d.ts
DELETED
package/src/StringExtensions.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
String.prototype.format = function (
|
|
2
|
-
this: string,
|
|
3
|
-
...parameters: string[]
|
|
4
|
-
): string {
|
|
5
|
-
let template = this;
|
|
6
|
-
parameters.forEach((value, index) => {
|
|
7
|
-
template = template.replace(new RegExp(`\\{${index}\\}`, 'g'), value);
|
|
8
|
-
});
|
|
9
|
-
return template;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export {};
|