@anzaui/engine - v0.6.0
    Preparing search index...

    Function stringify

    • A value as slot text, the same in all engines (see the Engine Contract): strings as-is, true/false, numbers via String() (integral floats have no .0), null/undefined as nothing, plain objects and arrays as compact JSON, anything else via String().

      Parameters

      • val: unknown

        The value to convert.

      Returns string | undefined

      The text, or undefined for null / undefined.

      stringify(3.0);        // '3'
      stringify(true); // 'true'
      stringify({ a: 1 }); // '{"a":1}'
      stringify(null); // undefined