@cellaware/utils 3.0.6 → 3.0.7
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/dist/util.d.ts +1 -0
- package/dist/util.js +9 -0
- package/package.json +1 -1
package/dist/util.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function sleep(ms: number): Promise<any>;
|
|
2
2
|
export declare function removeMarkdownIndicators(input: string): string;
|
|
3
|
+
export declare function removePrefixIndicators(input: string, prefixes: string[]): string;
|
|
3
4
|
export declare function isLeapYear(): boolean;
|
|
4
5
|
export declare function getDaysInMonth(): number;
|
|
5
6
|
export declare function getCurrentDayInMonth(): number;
|
package/dist/util.js
CHANGED
|
@@ -13,6 +13,15 @@ export function removeMarkdownIndicators(input) {
|
|
|
13
13
|
}
|
|
14
14
|
return output;
|
|
15
15
|
}
|
|
16
|
+
export function removePrefixIndicators(input, prefixes) {
|
|
17
|
+
let output = input;
|
|
18
|
+
for (const prefix of prefixes) {
|
|
19
|
+
if (output.includes(prefix)) {
|
|
20
|
+
output = output.substring(output.indexOf(prefix) + prefix.length);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return output;
|
|
24
|
+
}
|
|
16
25
|
export function isLeapYear() {
|
|
17
26
|
let year = new Date().getFullYear();
|
|
18
27
|
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
|