MCPcopy Index your code
hub / github.com/Effect-TS/effect / fromBabelGlob

Function fromBabelGlob

packages/sql/src/Migrator.ts:319–332  ·  view source on GitHub ↗
(migrations: Record<string, any>)

Source from the content-addressed store, hash-verified

317 * @category loaders
318 */
319export const fromBabelGlob = (migrations: Record<string, any>): Loader =>
320 pipe(
321 Object.keys(migrations),
322 Arr.filterMap((_) => Option.fromNullable(_.match(/^_(\d+)_([^.]+?)(Js|Ts)?$/))),
323 Arr.map(
324 ([key, id, name]): ResolvedMigration => [
325 Number(id),
326 name,
327 Effect.succeed(migrations[key])
328 ]
329 ),
330 Arr.sort(migrationOrder),
331 Effect.succeed
332 )
333
334/**
335 * @since 1.0.0

Callers

nothing calls this directly

Calls 4

NumberInterface · 0.85
keysMethod · 0.80
mapMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…