diff --git a/scripts/commands/channels/edit.ts b/scripts/commands/channels/edit.ts index 9e172a65..5d3b2645 100644 --- a/scripts/commands/channels/edit.ts +++ b/scripts/commands/channels/edit.ts @@ -85,8 +85,7 @@ export default async function main(filepath: string) { } async function selectChannel(channel: epgGrabber.Channel): Promise { - const query = escapeRegex(channel.name) - const similarChannels = searchChannels(query) + const similarChannels = searchChannels(channel.name) const choices = getChoicesForChannel(similarChannels).all() const selected: ChoiceValue = await select({ @@ -194,7 +193,3 @@ function save(filepath: string, channelsFromXML: Collection) { console.log() logger.info(`File '${filepath}' successfully saved`) } - -function escapeRegex(string: string) { - return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&') -}