Urara-Blog/node_modules/.pnpm-store/v3/files/fe/ec0d291c6309c698b13d66b49d20c0acd712fa27e1cda647cd823bda07df60590038fc6b6375fd615970deda8c5be29e3e9f3f271f4453a9cd72c70f566109
2022-08-14 01:14:53 +08:00

22 lines
489 B
Text

/**
* @typedef {import('../types.js').Context} Context
* @typedef {import('../types.js').Options} Options
*/
/**
* @param {Context} context
* @returns {Exclude<Options['quote'], undefined>}
*/
export function checkQuote(context) {
const marker = context.options.quote || '"'
if (marker !== '"' && marker !== "'") {
throw new Error(
'Cannot serialize title with `' +
marker +
'` for `options.quote`, expected `"`, or `\'`'
)
}
return marker
}