fix(new): keep upper cased letters in migration file names by default
This commit is contained in:
parent
59a013b0d8
commit
acb0b4f195
3 changed files with 8 additions and 4 deletions
5
.changeset/slimy-jars-know.md
Normal file
5
.changeset/slimy-jars-know.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@emigrate/plugin-tools': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Keep upper cased letters in migration file names by default
|
||||||
|
|
@ -32,7 +32,7 @@ describe('sanitizeMigrationName', () => {
|
||||||
assert.strictEqual(sanitizeMigrationName('foo_? :*<>'), 'foo');
|
assert.strictEqual(sanitizeMigrationName('foo_? :*<>'), 'foo');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should lower case the filename', () => {
|
it('should keep upper cased letters in the filename', () => {
|
||||||
assert.strictEqual(sanitizeMigrationName('Are you, Foo?'), 'are_you_foo');
|
assert.strictEqual(sanitizeMigrationName('Are you, Foo?'), 'Are_you_Foo');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -215,5 +215,4 @@ export const sanitizeMigrationName = (name: string) =>
|
||||||
name
|
name
|
||||||
.replaceAll(/[\W/\\:|*?'"<>_]+/g, '_')
|
.replaceAll(/[\W/\\:|*?'"<>_]+/g, '_')
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^_|_$/, '')
|
.replace(/^_|_$/, '');
|
||||||
.toLocaleLowerCase();
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue