Skip to content

@usine/config/yaml/writer

One replacement in authored YAML, preserving the surrounding file.

  • Schema.Class

new YamlEdit(…args): YamlEdit

Parameter Type
…args [props: object, options?: MakeOptions]

YamlEdit

readonly path: readonly string[]

Path in file-key spelling, for example ["settings", "max_children"].

readonly value: Json

const updateFrontmatter: (file, source, edit) => Effect.Effect<string, ConfigFileError, never>

Sets one YAML path in the frontmatter of a Markdown config file and returns the whole file.

Parameter Type
file string & Brand
source string
edit YamlEdit

Effect.Effect<string, ConfigFileError, never>


const updateYaml: (file, source, edit) => Effect.Effect<string, ConfigFileError, never>

Sets one YAML path and returns the file with its comments, key order, and newline style intact.

Parameter Type
file string & Brand
source string
edit YamlEdit

Effect.Effect<string, ConfigFileError, never>