@dofiltra/helpers
Advanced tools
Comparing version 1.0.65 to 1.0.66
@@ -78,3 +78,3 @@ import type { TDodecoratorSettings, TResultError, TTrackMetadata } from '@dofiltra/types'; | ||
static rmNumberingAndPunctuation: (str: string) => string; | ||
static rmWhileChars({ text, search, replace, replacebles }: { | ||
static rmWhileChars({ text, replacebles }: { | ||
text: string; | ||
@@ -81,0 +81,0 @@ search?: string[]; |
@@ -177,14 +177,10 @@ /* tslint:disable:max-classes-per-file */ | ||
}; | ||
static rmWhileChars({ text = '', search = [], replace = ' ', replacebles = [] }) { | ||
static rmWhileChars({ text = '', replacebles = [] }) { | ||
text = text?.trim?.() || ''; | ||
const regex = new RegExp(search.join('|'), 'g'); | ||
while (regex.test(text)) { | ||
text = text.replaceAll(regex, replace); | ||
} | ||
let v = !!replacebles.length; | ||
while (v) { | ||
let hasReplaceble = !!replacebles.length; | ||
while (hasReplaceble) { | ||
replacebles.forEach(({ search, value }) => { | ||
text = text.replaceAll(search, value); | ||
}); | ||
v = replacebles.some(({ search, value }) => text.includes(search)); | ||
hasReplaceble = replacebles.some(({ search }) => text.includes(search)); | ||
} | ||
@@ -191,0 +187,0 @@ return text; |
{ | ||
"name": "@dofiltra/helpers", | ||
"version": "1.0.65", | ||
"version": "1.0.66", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117518
2248