Wrap a string in double quotes.
This method wraps a string in double quotes and replaces control characters with safe escape sequences.
Kind: Exported function
Returns: string
- The wrapped string.
Param | Type | Description |
---|---|---|
string | string |
The string to safely wrap in double quotes. |
Example
import quote from 'string-quote-x';
console.log(quote('hello')); // '"hello"'