rake-db 2.8.20 → 2.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -198,23 +198,25 @@ const getMigrationFiles = async (config, up) => {
198
198
  return [];
199
199
  }
200
200
  const sort = up ? sortAsc : sortDesc;
201
- return sort(files).map((file) => {
202
- if (!file.endsWith(".ts")) {
203
- throw new Error(
204
- `Only .ts files are supported for migration, received: ${file}`
205
- );
206
- }
207
- const timestampMatch = file.match(/^(\d{14})\D/);
208
- if (!timestampMatch) {
209
- throw new Error(
210
- `Migration file name should start with 14 digit version, received ${file}`
211
- );
201
+ return sort(files.filter((file) => path.basename(file).includes("."))).map(
202
+ (file) => {
203
+ if (!file.endsWith(".ts")) {
204
+ throw new Error(
205
+ `Only .ts files are supported for migration, received: ${file}`
206
+ );
207
+ }
208
+ const timestampMatch = file.match(/^(\d{14})\D/);
209
+ if (!timestampMatch) {
210
+ throw new Error(
211
+ `Migration file name should start with 14 digit version, received ${file}`
212
+ );
213
+ }
214
+ return {
215
+ path: path.resolve(migrationsPath, file),
216
+ version: timestampMatch[1]
217
+ };
212
218
  }
213
- return {
214
- path: path.resolve(migrationsPath, file),
215
- version: timestampMatch[1]
216
- };
217
- });
219
+ );
218
220
  };
219
221
  const sortAsc = (arr) => arr.sort();
220
222
  const sortDesc = (arr) => arr.sort((a, b) => a > b ? -1 : 1);