createScalarToken
createScalarToken(
value,context):FlowScalar|BlockScalar
Defined in: src/source/cst-scalar.ts:97
Create a new scalar token with value
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
Section titled “Parameters”string
The string representation of the value, which will have its content properly indented.
context
Section titled “context”Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.
implicitKey?
Section titled “implicitKey?”boolean
Being within an implicit key may affect the resolved type of the token’s value.
indent
Section titled “indent”number
The indent level of the token.
inFlow?
Section titled “inFlow?”boolean
Is this scalar within a flow collection? This may affect the resolved type of the token’s value.
offset?
Section titled “offset?”number
The offset position of the token.
ScalarType
The preferred type of the scalar token, defaulting to 'PLAIN'.