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

Function readTag

packages/effect/src/encoding/Yaml.ts:275–282  ·  view source on GitHub ↗
(text: string, fail: (message: string) => never)

Source from the content-addressed store, hash-verified

273
274// The tag token at the start of `text`, which must be a core tag.
275const readTag = (text: string, fail: (message: string) => never): string => {
276 // A verbatim tag (`!<...>`) may contain `,`, so it is read whole.
277 const tag = /^!(?:<[^>]*>?|[^ \t\n,[\]{}]*)/.exec(text)![0]
278 if (!coreTags.has(tag)) {
279 fail(`Unsupported YAML tag '${tag}', only the core tags ${[...coreTags].join(", ")} are supported`)
280 }
281 return tag
282}
283
284// YAML 1.2.2 §10.3: the core schema's scalar spellings, matched against source text.
285// Shared by tag resolution and by the printer, which quotes any string spelled this way.

Callers 2

readFlowTagMethod · 0.85
nodePropertiesFunction · 0.85

Calls 4

failFunction · 0.70
hasMethod · 0.65
execMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected