Fix name.
This commit is contained in:
parent
3fe297b8f1
commit
e55c791386
|
@ -4,7 +4,7 @@ export const redirectTypes = ['hostname', 'simple'] as const;
|
||||||
export type MatcherType = typeof matcherTypes[number];
|
export type MatcherType = typeof matcherTypes[number];
|
||||||
export type RedirectType = typeof redirectTypes[number];
|
export type RedirectType = typeof redirectTypes[number];
|
||||||
|
|
||||||
export function narrowMatchType(value: string): value is MatcherType {
|
export function narrowMatcherType(value: string): value is MatcherType {
|
||||||
return matcherTypes.includes(value as MatcherType);
|
return matcherTypes.includes(value as MatcherType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import test from 'ava';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
matcherTypes,
|
matcherTypes,
|
||||||
narrowMatchType,
|
narrowMatcherType,
|
||||||
narrowRedirectType,
|
narrowRedirectType,
|
||||||
parseRedirect,
|
parseRedirect,
|
||||||
redirectTypes,
|
redirectTypes,
|
||||||
|
@ -99,9 +99,9 @@ test('Redirect.isMatch', (t) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Narrow match & redirect types', (t) => {
|
test('Narrow match & redirect types', (t) => {
|
||||||
t.false(narrowMatchType('invalid'));
|
t.false(narrowMatcherType('invalid'));
|
||||||
t.false(narrowRedirectType('invalid'));
|
t.false(narrowRedirectType('invalid'));
|
||||||
t.true(matcherTypes.every((value) => narrowMatchType(value)));
|
t.true(matcherTypes.every((value) => narrowMatcherType(value)));
|
||||||
t.true(redirectTypes.every((value) => narrowRedirectType(value)));
|
t.true(redirectTypes.every((value) => narrowRedirectType(value)));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue