@karmaniverous/string-utilities
    Preparing search index...

    Function n2d

    • Non-stringifiable to Default: returns tagged template function that replaces any expression that has no toString property with a default value.

      Parameters

      Returns (strings: TemplateStringsArray, ...exp: unknown[]) => string

      Tagged template function that replaces any expression that has no toString property with default.

      const value = n2d('default')`string: ${'foo'} number: ${42} boolean: ${true} null: ${null} undefined: ${undefined}`;
      // value === 'string: foo number: 42 boolean: true null: default undefined: default'