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

Function safeFieldName

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

Source from the content-addressed store, hash-verified

7 * examples: "source.x", "target['x']", "[my.field]"
8 */
9export function safeFieldName(field: string) {
10 return field.replace('.', '\\.').replace('[', '\\[').replace(']', '\\]');
11}
12
13/**
14 * Make sure the field name is usable in a Vega expression

Callers 15

fillFunction · 0.90
binnableFunction · 0.90
linearScaleFunction · 0.90
pointScaleFunction · 0.90
binnableColorScaleFunction · 0.90
ordinalScaleFunction · 0.90
topLookupFunction · 0.90
buildMethod · 0.90
addMarkMethod · 0.90
treemapTransformMethod · 0.90
buildMethod · 0.90
getScalesMethod · 0.90

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected