EndoJS
    Preparing search index...

    Variable qConst

    q: (value: any, space?: string | number) => Stringable = quote

    Type Declaration

      • (value: any, space?: string | number): Stringable
      • Wrap a value such that its use as a substitution value in a template literal tagged with details or Fail will result in it appearing quoted (in a way similar to but more general than JSON.stringify) rather than redacted in the message of errors based on the resulting DetailsToken.

        This does not affect representation in output of an associated console, which still logs the value as it would without quote, but does reveal it to functions in the propagation path of such errors.

        For example, the following will reveal the expected value in the thrown error's message, but only the type of the actual incorrect value (using the normal convention to locally rename properties like const { quote: q, Fail } = assert;):

        actual === expected || Fail`${actual} should be ${q(expected)}`;
        

        The optional space parameter matches that of JSON.stringify, and is used to request insertion of non-semantic line feeds, indentation, and separating spaces in the output for improving readability of objects and arrays.

        Parameters

        • value: any
        • Optionalspace: string | number

        Returns Stringable