Function objectKey

  • Wraps given property key with quotes if needed so it can be used as a property name in an object declaration.

    objectKey('foo bar'); // → '"foo bar"'

    objectKey('fooBar'); // → 'fooBar'

    objectKey('0'); // → '0'

    objectKey('0123'); // → '"0123"'

    Parameters

    • name: string | number

    Returns Code

Generated using TypeDoc