Config

Specifying component options in HTML attributes with JSON can be tough to read and write. That's why Oblik uses its own single line configuration format to alleviate that. This format is used by the Watcher and the config utility provides a parser for it.

import { Parser } from 'oblik/utils/config'

let parser = new Parser()
let result = parser.parse('foo: bar, !baz')
console.log(result) // { foo: "bar", baz: false }

# Syntax

It's a lot like JSON:

Except:

# Example

text: Hello, data { type: string, !isActive, numbers [5, 6] }

...results in:

{
    "text": "Hello",
    "data": {
        "type": "string",
        "isActive": false,
        "numbers": [5, 6]
    }
}
← Browser DOM →