UNPKG

@pnp/sp

Version:

pnp - provides a fluent api for working with SharePoint REST

17 lines 580 B
import { stringIsNullOrEmpty } from "@pnp/core"; // deprecated, will be removed in future versions, no longer used internally export function escapeQueryStrValue(value) { if (stringIsNullOrEmpty(value)) { return ""; } // replace all instance of ' with '' if (/!(@.*?)::(.*?)/ig.test(value)) { return value.replace(/!(@.*?)::(.*)$/ig, (match, labelName, v) => { return `!${labelName}::${v.replace(/'/ig, "''")}`; }); } else { return value.replace(/'/ig, "''"); } } //# sourceMappingURL=escape-query-str.js.map