Skip to content

Commit c0aa9c6

Browse files
authored
refactor(createRouter): deprecate misspelled preemptive option (#256)
1 parent 9ea0da6 commit c0aa9c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/router.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ interface RouteNode {
2020
}
2121

2222
export interface CreateRouterOptions {
23+
/** @deprecated Please use `preemptive` instead. **/
2324
preemtive?: boolean
25+
preemptive?: boolean
2426
}
2527

2628
export function createRouter (opts: CreateRouterOptions = {}): Router {
@@ -61,7 +63,7 @@ export function createRouter (opts: CreateRouterOptions = {}): Router {
6163
// Match route
6264
const matched = _router.lookup(path);
6365
if (!matched || !matched.handlers) {
64-
if (opts.preemtive) {
66+
if (opts.preemptive || opts.preemtive) {
6567
throw createError({
6668
statusCode: 404,
6769
name: "Not Found",

0 commit comments

Comments
 (0)