Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/aether/deps.ts>YAML.CST.setScalarValue

A Deno library to interface with the Discord API
Latest
function YAML.CST.setScalarValue
import { YAML } from "https://deno.land/x/aether@v0.0.3/deps.ts";
const { setScalarValue } = YAML.CST;

Set the value of token to the given string value, overwriting any previous contents and type that it may have.

Best efforts are made to retain any comments previously associated with the token, though all contents within a collection's items will be overwritten.

Values that represent an actual string but may be parsed as a different type should use a type other than 'PLAIN', as this function does not support any schema operations and won't check for such conflicts.

Parameters

token: Token

Any token. If it does not include an indent value, the value will be stringified as if it were an implicit key.

value: string

The string representation of the value, which will have its content properly indented.

optional
context: { afterKey?: boolean; implicitKey?: boolean; inFlow?: boolean; type?: Scalar.Type; }

In most cases, values after a key should have an additional level of indentation.