push
339 of 499 branches covered (67.94%)
Branch coverage included in aggregate %.
487 of 516 new or added lines in 6 files covered. (94.38%)
1497 existing lines in 23 files now uncovered.3439 of 4965 relevant lines covered (69.26%)
4.28 hits per line
| 1 |
import DareError from './error.js'; |
|
| 2 |
|
9✔ |
| 3 |
export default function validate_alias(key) { |
|
| 4 |
const [name, label] = key.split('$');
|
1✔ |
| 5 |
|
1✔ |
| 6 |
// Capture errors in the key
|
1✔ |
| 7 |
if (!name.match(/^[_a-z]+$/i) || (label && !label.match(/^\w+$/i))) { |
|
|
UNCOV
8
|
throw new DareError( |
× |
|
UNCOV
9
|
DareError.INVALID_REFERENCE, |
× |
|
UNCOV
10
|
`The table reference '${key}' must match [a-z_]+($[a-z0-9_]+)` |
× |
|
UNCOV
11
|
); |
× |
|
UNCOV
12
|
} |
× |
| 13 |
} |
1✔ |