MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / validateValue

Function validateValue

packages/cli/lib/utils.js:525–536  ·  view source on GitHub ↗
(name, unallowedCharacters)

Source from the content-addressed store, hash-verified

523};
524
525function validateValue(name, unallowedCharacters) {
526 if (!unallowedCharacters) {
527 unallowedCharacters = /[\/@\s+%:.]/;
528 }
529 if (name.match(unallowedCharacters)) {
530 return `Name cannot contain special characters ${unallowedCharacters}: ${name}`;
531 }
532 if (name !== encodeURIComponent(name)) {
533 return `Name cannot contain special characters escaped by encodeURIComponent: ${name}`;
534 }
535 return true;
536}
537/**
538 * Returns the modelName in the directory file format for the model
539 * @param {string} modelName

Callers 1

utils.jsFile · 0.85

Calls 1

matchMethod · 0.65

Tested by

no test coverage detected