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

Function fromRecord

packages/sql/src/Migrator.ts:338–351  ·  view source on GitHub ↗
(migrations: Record<string, Effect.Effect<void, unknown, Client.SqlClient>>)

Source from the content-addressed store, hash-verified

336 * @category loaders
337 */
338export const fromRecord = (migrations: Record<string, Effect.Effect<void, unknown, Client.SqlClient>>): Loader =>
339 pipe(
340 Object.keys(migrations),
341 Arr.filterMap((_) => Option.fromNullable(_.match(/^(\d+)_(.+)$/))),
342 Arr.map(
343 ([key, id, name]): ResolvedMigration => [
344 Number(id),
345 name,
346 Effect.succeed(migrations[key])
347 ]
348 ),
349 Arr.sort(migrationOrder),
350 Effect.succeed
351 )

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…