UNPKG

580 BJavaScriptView Raw
1import { stringIsNullOrEmpty } from "@pnp/core";
2// deprecated, will be removed in future versions, no longer used internally
3export function escapeQueryStrValue(value) {
4 if (stringIsNullOrEmpty(value)) {
5 return "";
6 }
7 // replace all instance of ' with ''
8 if (/!(@.*?)::(.*?)/ig.test(value)) {
9 return value.replace(/!(@.*?)::(.*)$/ig, (match, labelName, v) => {
10 return `!${labelName}::${v.replace(/'/ig, "''")}`;
11 });
12 }
13 else {
14 return value.replace(/'/ig, "''");
15 }
16}
17//# sourceMappingURL=escape-query-str.js.map
\No newline at end of file