Skip to content

Commit

Permalink
avoid type import
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Mar 28, 2024
1 parent ebc5787 commit 754b225
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/umzug.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import emittery from 'emittery'
import * as fs from 'fs'
import {glob, type GlobOptionsWithFileTypesUnset as GlobOptions} from 'glob'
import {glob} from 'glob'
import * as path from 'path'
import * as errorCause from 'pony-cause'
import type {CommandLineParserOptions} from './cli'
Expand Down Expand Up @@ -486,12 +486,12 @@ export class Umzug<Ctx extends object = object> extends emittery<UmzugEvents<Ctx
}

const fileGlob = inputMigrations.glob
const [globString, globOptions]: [string, GlobOptions] = Array.isArray(fileGlob) ? fileGlob : [fileGlob, {}]
const [globString, globOptions] = Array.isArray(fileGlob) ? fileGlob : [fileGlob]

const resolver: Resolver<Ctx> = inputMigrations.resolve ?? Umzug.defaultResolver

return async context => {
const paths = await glob(globString, {...globOptions, absolute: true})
const paths = await glob(globString, {...globOptions, withFileTypes: false, absolute: true})
paths.sort() // glob returns results in reverse alphabetical order these days, but it has never guaranteed not to do that https://github.com/isaacs/node-glob/issues/570
return paths.map(unresolvedPath => {
const filepath = path.resolve(unresolvedPath)
Expand Down

0 comments on commit 754b225

Please sign in to comment.