MCPcopy Create free account
hub / github.com/Effect-TS/effect / updateLastLink

Function updateLastLink

packages/effect/src/SchemaAST.ts:3409–3414  ·  view source on GitHub ↗
(encoding: Encoding, f: (ast: AST) => AST)

Source from the content-addressed store, hash-verified

3407}
3408
3409function updateLastLink(encoding: Encoding, f: (ast: AST) => AST): Encoding {
3410 const links = encoding
3411 const last = links[links.length - 1]
3412 const out = mapLink(last, f)
3413 return out === last ? encoding : Arr.append(encoding.slice(0, encoding.length - 1), out)
3414}
3415
3416/** @internal */
3417export function applyToLastLink(f: (ast: AST) => AST) {

Callers 2

applyToLastLinkFunction · 0.85
outFunction · 0.85

Calls 1

mapLinkFunction · 0.85

Tested by

no test coverage detected