feat: validate quotes to be single or double

This commit is contained in:
karishmas6
2024-06-06 01:23:26 +05:30
parent 88e6a53c6e
commit 52d74f9ea4

View File

@@ -468,6 +468,26 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
const regexExcessiveSpaces =
/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
const defaultOptions = {
escapeEverything: false,
isIdentifier: false,
quotes: 'single',
wrap: false,
};
function cssesc(string: string, opt: Partial<typeof defaultOptions> = {}) {
const options = { ...defaultOptions, ...opt };
if (options.quotes != 'single' && options.quotes != 'double') {
options.quotes = 'single';
}
const quote = options.quotes == 'double' ? '"' : "'";
const isIdentifier = options.isIdentifier;
}
};
@@ -477,4 +497,3 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {