How to use webiny-data-extractor - 1 common examples

To help you get started, we’ve selected a few webiny-data-extractor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages-utils / webiny-model / src / model.js View on Github external
async toJSON(fields: string): Promise {
        return await extractor.get(this, fields, {
            onRead: async (data, key) => {
                // Key can accept ":" separated arguments, so we have to make sure those are parsed.
                const received = this.__parseKeyParams(key);

                if (typeof data.getAttribute === "function") {
                    if (!data.getAttribute(received.key)) {
                        return [received.key];
                    return [
                        await data.getAttribute(received.key).getJSONValue(...received.arguments)
                return [received.key, await data[received.key]];


A small library for easy async data extraction, using dot and square brackets notation.

Latest version published 4 years ago

Package Health Score

66 / 100
Full package analysis

Popular webiny-data-extractor functions

Similar packages