From 4e2a27ffeb676d4d063da60ded2bd815e2ec5b01 Mon Sep 17 00:00:00 2001 From: Joakim Carlstein Date: Fri, 10 Nov 2023 14:47:44 +0100 Subject: [PATCH] fix(plugin-tools): trim leading underscores from filenames --- packages/plugin-tools/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-tools/src/index.ts b/packages/plugin-tools/src/index.ts index 652bfbb..f3d7b83 100644 --- a/packages/plugin-tools/src/index.ts +++ b/packages/plugin-tools/src/index.ts @@ -109,7 +109,7 @@ export const getTimestampPrefix = () => new Date().toISOString().replaceAll(/[-: */ export const sanitizeMigrationName = (name: string) => name - .replaceAll(/[\W/\\:|*?'"<>]+/g, '_') + .replaceAll(/[\W/\\:|*?'"<>_]+/g, '_') .trim() - .replace(/_$/, '') + .replace(/^_|_$/, '') .toLocaleLowerCase();