Contentful Personalization & Analytics
    Preparing search index...
    • Type guard for EntryReplacementComponent.

      Parameters

      • component:
            | {
                baseline: { hidden: boolean; id: string };
                type?: "EntryReplacement";
                variants: { hidden: boolean; id: string }[];
            }
            | {
                baseline: {
                    value: null
                    | string
                    | number
                    | boolean
                    | Record<string, JSONType>;
                };
                key: string;
                type: "InlineVariable";
                valueType: "Boolean"
                | "Number"
                | "Object"
                | "String";
                variants: {
                    value: null | string | number | boolean | Record<string, JSONType>;
                }[];
            }

        Personalization component to test.

        • {
              baseline: { hidden: boolean; id: string };
              type?: "EntryReplacement";
              variants: { hidden: boolean; id: string }[];
          }
          • baseline: { hidden: boolean; id: string }

            Baseline variant used when no targeting or allocation selects another variant.

            • hidden: boolean

              Indicates whether this variant is hidden from allocation/traffic.

              false
              
            • id: string

              Unique identifier for the variant.

          • Optionaltype?: "EntryReplacement"

            Discriminator for the component type.

            May be omitted, in which case the component is treated as an EntryReplacement.

          • variants: { hidden: boolean; id: string }[]

            Additional variants that may be served.

        • {
              baseline: {
                  value: null | string | number | boolean | Record<string, JSONType>;
              };
              key: string;
              type: "InlineVariable";
              valueType: "Boolean"
              | "Number"
              | "Object"
              | "String";
              variants: {
                  value: null | string | number | boolean | Record<string, JSONType>;
              }[];
          }
          • baseline: { value: null | string | number | boolean | Record<string, JSONType> }

            Baseline value used when no targeting or allocation selects another variant.

            • value: null | string | number | boolean | Record<string, JSONType>

              Variant value for the inline variable.

          • key: string

            Key under which this variable is exposed to the template.

          • type: "InlineVariable"

            Discriminator for the inline variable component.

          • valueType: "Boolean" | "Number" | "Object" | "String"

            Describes the runtime type of the values for this variable.

          • variants: { value: null | string | number | boolean | Record<string, JSONType> }[]

            Additional variable variants for experimentation or personalization.

      Returns component is {
          baseline: { hidden: boolean; id: string };
          type?: "EntryReplacement";
          variants: { hidden: boolean; id: string }[];
      }

      true if the component is an EntryReplacement component, otherwise false.