| 523 | }; |
| 524 | |
| 525 | function 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 |