outsystems-ui - v3.0.0
    Preparing search index...

    Function ParseConfigs

    • Normalizes the configs argument every public Create function receives.

      The OutSystems platform passes the pattern configuration as a JSON string. TypeScript callers, Storybook stories and generated code may pass a plain object instead, so both are accepted and a JSON string keeps exactly the JSON.parse behavior it always had.

      Only plain objects are accepted (prototype Object.prototype or null): the Config classes read the configs with for...in, so a class instance or an Object.create(...) value would leak its inherited enumerable properties into the configuration. The prototype is checked by shape, not by identity, so an object created in another realm (an iframe) still counts as plain: it must be null, or a root prototype (itself without a prototype) that exposes no enumerable keys.

      Parameters

      • configs: string | Record<string, unknown>

        JSON string or plain object with the pattern configuration

      Returns JSON

      The configuration object handed to the pattern's Config class