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

Function validateIdentifier

compile.js:210–214  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

208const identifierRegex = /^[A-Za-z_][A-Za-z0-9_]*$/;
209
210function validateIdentifier(name) {
211 if (typeof name !== 'string' || !identifierRegex.test(name)) {
212 throw new Error(`Invalid protobuf identifier: ${JSON.stringify(name)}`);
213 }
214}
215
216function buildContext(proto, parent, mapEntryField) {
217 const obj = Object.create(parent);

Callers 1

buildContextFunction · 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…