MCPcopy Create free account
hub / github.com/mapbox/pbf / fieldShouldUseStringAsNumber

Function fieldShouldUseStringAsNumber

compile.js:149–153  ·  view source on GitHub ↗
(field)

Source from the content-addressed store, hash-verified

147
148// JS_STRING serializes numeric scalars as strings — applies to every TYPES entry except the non-numeric ones.
149function fieldShouldUseStringAsNumber(field) {
150 if (field.options.jstype !== 'JS_STRING') return false;
151 const t = TYPES[field.type];
152 return !!t && t.m !== 'String' && t.m !== 'Boolean' && t.m !== 'Bytes';
153}
154
155function compileScalarFieldRead(ctx, field) {
156 const sub = getSubMessage(ctx, field);

Callers 3

compileScalarFieldReadFunction · 0.85
compileFieldWriteFunction · 0.85
getDefaultValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…