devowl-wp
    Preparing search index...
    • Get the anonymous localized script from the document as object and write it to the window object.

      Use it in combination with Assets.php#anonymous_localize_script.

      Parameters

      • slug: string
      • OptionalhelperScriptOptions: {
            lazyParse?: (
                obj: any,
                parseLazy: (
                    obj: any,
                    topLevelKeyOfObject: string,
                    property: string,
                ) => any,
            ) => void;
            makeBase64Encoded: string[];
        }

        The options for the helper script. This are the same options required as for Assets.php#anonymous_localize_script. This is used to parse the JSON strings lazily when the helper script is not executed.

      Returns any

      const options = getAnonymousLocalizedScript(process.env.slug, {
      makeBase64Encoded: ["codeOptIn", "codeOptOut", "codeOnPageLoad", "contactEmail"],
      lazyParse: (obj, parseLazy) => {
      parseLazy(obj.others, "frontend", "groups");
      parseLazy(obj.others, "frontend", "tcf");
      parseLazy(obj, "others", "customizeValuesBanner");
      },
      });