fix(new): keep upper cased letters in migration file names by default

This commit is contained in:
Joakim Carlstein 2023-11-24 15:55:32 +01:00
parent 59a013b0d8
commit acb0b4f195
3 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
'@emigrate/plugin-tools': patch
---
Keep upper cased letters in migration file names by default

View file

@ -32,7 +32,7 @@ describe('sanitizeMigrationName', () => {
assert.strictEqual(sanitizeMigrationName('foo_? :*<>'), 'foo');
});
it('should lower case the filename', () => {
assert.strictEqual(sanitizeMigrationName('Are you, Foo?'), 'are_you_foo');
it('should keep upper cased letters in the filename', () => {
assert.strictEqual(sanitizeMigrationName('Are you, Foo?'), 'Are_you_Foo');
});
});

View file

@ -215,5 +215,4 @@ export const sanitizeMigrationName = (name: string) =>
name
.replaceAll(/[\W/\\:|*?'"<>_]+/g, '_')
.trim()
.replace(/^_|_$/, '')
.toLocaleLowerCase();
.replace(/^_|_$/, '');