Conditionally quotes JavaScript key.
If the given key is valid JavaScript identifier, then leaves it as is. Otherwise, encloses it into quotes and properly escapes if necessary.
key
A key to quote.
Optional
Quote symbol to use.
Conditionally quoted string.
Generated using TypeDoc
Conditionally quotes JavaScript key.
If the given
key
is valid JavaScript identifier, then leaves it as is. Otherwise, encloses it into quotes and properly escapes if necessary.