KScript docs
EN

mime fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

Fields

FieldTypeDescription
.essencestringThe type and subtype without parameters: text/html.
.main_typestringThe part before /: text in text/html. (->type() is mime, as for any value.)
.paramsmapThe parameters as a map: { charset: 'utf-8' }.
.subtypestringThe part after /: html in text/html.

From KScript.Core

#mime->is(pattern: string) → bool

True when it matches text/html, text/* or /.
ParameterTakes
pattern requiredstring
Example
<let name="x" type="mime" value="'text/html; charset=utf-8'" />
<echo>{ $x->is('text/*') }</echo>
$x: mime = 'text/html; charset=utf-8'
echo $x->is('text/*')

Methods from any

Methods from string