1.0.1 • Published 3 years ago

as-deepjson v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

as-deepjson

AssemblyScript module for getting values deep in JSON easily

Usage

import { DeepJsonParse } from "as-deepjson";

const json = `
{
    "animals": {
        "cats": [
            {
                "name": "Mittens",
                "age": 3
            }
        ]
    }
}

`.trim()

const parsed = new DeepJsonParse(json)
const value = parsed.get("animals.cats[0].name")

if(value != null){
    const name = value.toString()
    // name == "Mittens"
}
1.0.1

3 years ago

1.0.0

3 years ago