Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix other typo’s #315

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ intelligent defaults, rendering templates, and loading data into controllers.

A `HandlerInfo` is an object that describes the state of a route handler.

For example, the `foo/bar` URL likely breaks down into a hierachy of two
For example, the `foo/bar` URL likely breaks down into a hierarchy of two
handlers: the `foo` handler and the `bar` handler. A "handler" is just an
object that defines hooks that `router.js` will call in the course of a
transition (e.g. `model`, `beforeModel`, `setup`, etc.).
Expand Down Expand Up @@ -132,7 +132,7 @@ Instances of `Router` and `Transition` contain `TransitionState`
properties, which is useful since, depending on whether or not there is
a currently active transition, the "starting point" of a transition
might be the router's current hierarchy of `ResolvedHandlerInfo`s, or it
might be a transition's hierachy of `ResolvedHandlerInfo`s mixed with
might be a transition's hierarchy of `ResolvedHandlerInfo`s mixed with
unresolved HandlerInfos.

### `TransitionIntent`
Expand Down
12 changes: 6 additions & 6 deletions lib/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ export default abstract class Router<T extends Route> {
let initial = transition.isCausedByInitialTransition;

// say you are at / and you click a link to route /foo. In /foo's
// route, the transition is aborted using replacewith('/bar').
// route, the transition is aborted using replaceWith('/bar').
// Because the current url is still /, the history entry for / is
// removed from the history. Clicking back will take you to the page
// you were on before /, which is often not even the app, thus killing
Expand Down Expand Up @@ -978,28 +978,28 @@ export default abstract class Router<T extends Route> {
}

let targetHandler = targetRouteInfos[targetRouteInfos.length - 1].name;
let recogHandlers: ParsedHandler[] = this.recognizer.handlersFor(targetHandler);
let recognizerHandlers: ParsedHandler[] = this.recognizer.handlersFor(targetHandler);

let index = 0;
for (len = recogHandlers.length; index < len; ++index) {
for (len = recognizerHandlers.length; index < len; ++index) {
routeInfo = targetRouteInfos[index];
if (routeInfo.name === routeName) {
break;
}
}

if (index === recogHandlers.length) {
if (index === recognizerHandlers.length) {
// The provided route name isn't even in the route hierarchy.
return false;
}

let testState = new TransitionState<T>();
testState.routeInfos = targetRouteInfos.slice(0, index + 1);
recogHandlers = recogHandlers.slice(0, index + 1);
recognizerHandlers = recognizerHandlers.slice(0, index + 1);

let intent = new NamedTransitionIntent(this, targetHandler, undefined, contexts);

let newState = intent.applyToHandlers(testState, recogHandlers, targetHandler, true, true);
let newState = intent.applyToHandlers(testState, recognizerHandlers, targetHandler, true, true);

let routesEqual = routeInfosEqual(newState.routeInfos, testState.routeInfos);
if (!queryParams || !routesEqual) {
Expand Down
6 changes: 3 additions & 3 deletions lib/router/transition-aborted-error.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export interface TransitionAbortedErrorContructor {
export interface TransitionAbortedErrorConstructor {
new (message?: string): ITransitionAbortedError;
readonly prototype: ITransitionAbortedError;
}

export interface ITransitionAbortedError extends Error {
constructor: TransitionAbortedErrorContructor;
constructor: TransitionAbortedErrorConstructor;
}

const TransitionAbortedError: TransitionAbortedErrorContructor = (function () {
const TransitionAbortedError: TransitionAbortedErrorConstructor = (function () {
TransitionAbortedError.prototype = Object.create(Error.prototype);
TransitionAbortedError.prototype.constructor = TransitionAbortedError;

Expand Down
2 changes: 1 addition & 1 deletion lib/router/transition-intent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export abstract class TransitionIntent<T extends Route> {
this.data = data;
}
preTransitionState?: TransitionState<T>;
abstract applyToState(oldState: TransitionState<T>, isIntermidate: boolean): TransitionState<T>;
abstract applyToState(oldState: TransitionState<T>, isIntermediate: boolean): TransitionState<T>;
}
2 changes: 1 addition & 1 deletion lib/router/transition-intent/url-transition-intent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class URLTransitionIntent<T extends Route> extends TransitionInte
if (route) {
checkHandlerAccessibility(route);
} else {
// If the hanlder is being loaded asynchronously, check if we can
// If the handler is being loaded asynchronously, check if we can
// access it after it has resolved
newRouteInfo.routePromise = newRouteInfo.routePromise.then(checkHandlerAccessibility);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/router/transition-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class TransitionState<T extends Route> {
let currentState = this;
let wasAborted = false;

// The prelude RSVP.resolve() asyncs us into the promise land.
// The prelude RSVP.resolve() async moves us into the promise land.
return Promise.resolve(null, this.promiseLabel('Start transition'))
.then(resolveOneRouteInfo, null, this.promiseLabel('Resolve route'))
.catch(handleError, this.promiseLabel('Handle error'));
Expand Down
6 changes: 3 additions & 3 deletions lib/router/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const PARAMS_SYMBOL = `__PARAMS__-261986232992830203-23323`;
export const QUERY_PARAMS_SYMBOL = `__QPS__-2619863929824844-32323`;

/**
A Transition is a thennable (a promise-like object) that represents
A Transition is a thenable (a promise-like object) that represents
an attempt to transition to another route. It can be aborted, either
explicitly via `abort` or by attempting another transition while a
previous one is still underway. An aborted transition can also
Expand Down Expand Up @@ -216,7 +216,7 @@ export default class Transition<T extends Route> implements Partial<Promise<T>>
succeeds and rejects if it fails/redirects/aborts.

Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
use in situations where you want to pass around a thenable,
but not the Transition itself.

@method then
Expand Down Expand Up @@ -255,7 +255,7 @@ export default class Transition<T extends Route> implements Partial<Promise<T>>
/**

Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
use in situations where you want to pass around a thenable,
but not the Transition itself.

@method finally
Expand Down
6 changes: 3 additions & 3 deletions lib/router/unrecognized-url-error.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export interface UnrecognizedURLContructor {
export interface UnrecognizedURLConstructor {
new (message?: string): UnrecognizedURLError;
readonly prototype: UnrecognizedURLError;
}

export interface UnrecognizedURLError extends Error {
constructor: UnrecognizedURLContructor;
constructor: UnrecognizedURLConstructor;
}

const UnrecognizedURLError: UnrecognizedURLContructor = (function () {
const UnrecognizedURLError: UnrecognizedURLConstructor = (function () {
UnrecognizedURLError.prototype = Object.create(Error.prototype);
UnrecognizedURLError.prototype.constructor = UnrecognizedURLError;

Expand Down
4 changes: 2 additions & 2 deletions lib/rsvp/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module 'rsvp' {
export interface PromiseContructor {
export interface PromiseConstructor {
new <T>(
executor: (
resolve: (value?: T | PromiseLike<T>) => void,
Expand All @@ -14,7 +14,7 @@ declare module 'rsvp' {
export const resolve: (value: any | PromiseLike<any>, label?: string) => Promise<any>;
export const reject: (reason?: any, label?: string) => Promise<any>;
export const configure: (key: string, value?: any) => void;
export const Promise: PromiseContructor;
export const Promise: PromiseConstructor;

export type OnFulfilled<T, TResult1> =
| ((value: T) => TResult1 | PromiseLike<TResult1>)
Expand Down
6 changes: 3 additions & 3 deletions tests/query_params_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,19 @@ scenarios.forEach(function (scenario) {
transition = transitionTo(router, '/parent/child?foo=789');
assert.notOk(
transition.queryParamsOnly,
'Fourth transition with transtionTo intent is not query params only'
'Fourth transition with transitionTo intent is not query params only'
);

transition = transitionTo(router, '/parent/child?foo=901');
assert.ok(
transition.queryParamsOnly,
'Firth transition with transtionTo intent is query params only'
'Firth transition with transitionTo intent is query params only'
);

transition = transitionTo(router, '/index?foo=123');
assert.notOk(
transition.queryParamsOnly,
'Firth transition with transtionTo intent is not query params only'
'Firth transition with transitionTo intent is not query params only'
);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/route_info_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ test('UnresolvedRouteInfoByObject does NOT get its model hook called', function
if (this.__routeHandler) {
return this.__routeHandler;
}
return (this.__routeHandler = createHandler('uresolved', {
return (this.__routeHandler = createHandler('unresolved', {
model: function () {
assert.ok(false, "I shouldn't be called because I already have a context/model");
},
Expand Down