How to use the warp10.stringify function in warp10

To help you get started, we’ve selected a few warp10 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 marko-js / marko / src / core-tags / components / component-globals-tag.js View on Github external
var outGlobal = out.global;
    var serializedGlobals = getSerializedGlobals(outGlobal);
    if (serializedGlobals === undefined) {
        return;
    }
    var cspNonce = outGlobal.cspNonce;
    var runtimeId = outGlobal.runtimeId;
    var nonceAttr = cspNonce ? " nonce=" + JSON.stringify(cspNonce) : "";

    out.write(
        "$" +
            runtimeId +
            "G=" +
            warp10
                .stringify(serializedGlobals)
                .replace(escapeEndingScriptTagRegExp, "\\u003C/") +
            ""
    );
};
github marko-js / marko / src / runtime / components / index.js View on Github external
var renderedComponents = getRenderedComponents(fromOut, shouldIncludeAll);
    if (renderedComponents === undefined) {
        return "";
    }

    var outGlobal = targetOut.global;
    var runtimeId = outGlobal.runtimeId;
    var componentGlobalKey =
        "$" + (runtimeId === "M" ? "components" : runtimeId + "_components");

    return (
        componentGlobalKey +
        "=(window." +
        componentGlobalKey +
        "||[]).concat(" +
        safeJSON(warp10.stringify(renderedComponents)) +
        ")||" +
        componentGlobalKey
    );
};

warp10

Transport complex JavaScript objects from the server to the web browser at lightning fast speeds

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis