(className: string)
| 444 | const joinClassRegex = /^_Join:[A-Za-z0-9_]+:[A-Za-z0-9_]+/; |
| 445 | const classAndFieldRegex = /^[A-Za-z][A-Za-z0-9_]*$/; |
| 446 | function classNameIsValid(className: string): boolean { |
| 447 | // Valid classes must: |
| 448 | return ( |
| 449 | // Be one of _User, _Installation, _Role, _Session OR |
| 450 | systemClasses.indexOf(className) > -1 || |
| 451 | // Be a join table OR |
| 452 | joinClassRegex.test(className) || |
| 453 | // Include only alpha-numeric and underscores, and not start with an underscore or number |
| 454 | fieldNameIsValid(className, className) |
| 455 | ); |
| 456 | } |
| 457 | |
| 458 | // Valid fields must be alpha-numeric, and not start with an underscore or number |
| 459 | // must not be a reserved key |
no test coverage detected
searching dependent graphs…