MCPcopy Create free account
hub / github.com/microsoft/SandDance / exprSafeFieldName

Function exprSafeFieldName

packages/sanddance-specs/src/expr.ts:16–19  ·  view source on GitHub ↗
(field: string)

Source from the content-addressed store, hash-verified

14 * Make sure the field name is usable in a Vega expression
15 */
16export function exprSafeFieldName(field: string) {
17 //remove whitespace, period, accessors and logical modifiers
18 return field.replace(/[.,:;+=\-/<>{}|~!@#$%^*[\]`'"()?\s\\]/g, '');
19}

Callers 1

binnableFunction · 0.90

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected