diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/validators.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/validators.js b/src/validators.js index 59df80d4..63268ded 100644 --- a/src/validators.js +++ b/src/validators.js @@ -842,9 +842,11 @@ export function validateReference(type) { type.map(type => `"${type}:"`).join(', ') + `, got "${typePart}:"`); } - } else if (typePart !== type) { - throw new TypeError( - `Expected ref to begin with "${type}:", got "${typePart}:"`); + } else if (type) { + if (typePart !== type) { + throw new TypeError( + `Expected ref to begin with "${type}:", got "${typePart}:"`); + } } isDirectory(directoryPart); |