ensureQuotes function is a utility for ensuring that a string is properly enclosed in quotes. This function checks if the input string is already quoted and adds double quotes if needed, making it useful for formatting strings for JSON, CSV files, or other contexts where quoted strings are required.ts
import { ensureQuotes } from "@arkyn/shared";
rawValue (required)stringstringtypescript
import { ensureQuotes } from "@arkyn/shared";const result1 = ensureQuotes("example");const result2 = ensureQuotes('"already quoted"');console.log(result1); // Output: "example"console.log(result2); // Output: "already quoted"
') and double quotes ("), preserving whichever type is already present in the string."), following common conventions for JSON and many programming languages.