10000 fix typo · e3d/vue-function-api@bb7f2ac · GitHub
[go: up one dir, main page]

Skip to content

Commit bb7f2ac

Browse files
committed
fix typo
1 parent 7aa921a commit bb7f2ac

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/functions/inject.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { VueConstructor } from 'vue';
22
import { getCurrentVue } from '../runtimeContext';
3-
import { ensuerCurrentVMInFn } from '../helper';
3+
import { ensureCurrentVMInFn } from '../helper';
44
import { UnknownObject } from '../types/basic';
55
import { hasOwn } from '../utils';
66

@@ -31,7 +31,7 @@ export function provide(provideOption: ProvideOption) {
3131
return;
3232
}
3333

34-
const vm = ensuerCurrentVMInFn('provide');
34+
const vm = ensureCurrentVMInFn('provide');
3535
(vm as any)._provided =
3636
typeof provideOption === 'function' ? provideOption.call(vm) : provideOption;
3737
}
@@ -41,6 +41,6 @@ export function inject(injectKey: InjectKey) {
4141
return;
4242
}
4343

44-
const vm = ensuerCurrentVMInFn('inject');
44+
const vm = ensureCurrentVMInFn('inject');
4545
return resolveInject(injectKey, vm);
4646
}

src/functions/lifecycle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { ensuerCurrentVMInFn } from '../helper';
1+
import { ensureCurrentVMInFn } from '../helper';
22

33
const genName = (name: string) => `on${name[0].toUpperCase() + name.slice(1)}`;
44
function createLifeCycle(lifeCyclehook: string) {
55
return (callback: Function) => {
6-
const vm = ensuerCurrentVMInFn(genName(lifeCyclehook));
6+
const vm = ensureCurrentVMInFn(genName(lifeCyclehook));
77
vm.$on(`hook:${lifeCyclehook}`, callback);
88
};
99
}
1010

1111
function createLifeCycles(lifeCyclehooks: string[], name: string) {
1212
return (callback: Function) => {
13-
const vm = ensuerCurrentVMInFn(name);
13+
const vm = ensureCurrentVMInFn(name);
1414
lifeCyclehooks.forEach(lifeCyclehook => vm.$on(`hook:${lifeCyclehook}`, callback));
1515
};
1616
}

src/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function isWrapper<T>(obj: any): obj is AbstractWrapper<T> {
77
return obj instanceof AbstractWrapper;
88
}
99

10-
export function ensuerCurrentVMInFn(hook: string): InstanceType<VueConstructor> {
10+
export function ensureCurrentVMInFn(hook: string): InstanceType<VueConstructor> {
1111
const vm = getCurrentVM();
1212
if (process.env.NODE_ENV !== 'production') {
1313
assert(vm, `"${hook}" get called outside of "setup()"`);

src/wrappers/ComputedWrapper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import { getCurrentVue } from '../runtimeContext';
22
import { proxy } from '../utils';
33
import AbstractWrapper from './AbstractWrapper';
44

5-
interface ComputedInteral<T> {
5+
interface ComputedInternal<T> {
66
read(): T;
77
write?(x: T): void;
88
}
99

1010
export default class ComputedWrapper<V> extends AbstractWrapper<V> {
11-
constructor(private _interal: ComputedInteral<V>) {
11+
constructor(private _internal: ComputedInternal<V>) {
1212
super();
1313
}
1414

1515
get value() {
16-
return this._interal.read();
16+
return this._internal.read();
1717
}
1818

1919
set value(val: V) {
20-
if (!this._interal.write) {
20+
if (!this._internal.write) {
2121
if (process.env.NODE_ENV !== 'production') {
2222
getCurrentVue().util.warn(
2323
'Computed property' +
@@ -27,11 +27,11 @@ export default class ComputedWrapper<V> extends AbstractWrapper<V> {
2727
);
2828
}
2929
} else {
30-
this._interal.write(val);
30+
this._internal.write(val);
3131
}
3232
}
3333

34-
exposeToDevltool() {
34+
exposeToDevtool() {
3535
if (process.env.NODE_ENV !== 'production') {
3636
const vm = this._vm!;
3737
const name = this._propName!;

src/wrappers/ValueWrapper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import { proxy } from '../utils';
22
import AbstractWrapper from './AbstractWrapper';
33

4-
interface ValueInteral<T> {
4+
interface ValueInternal<T> {
55
$$state: T;
66
}
77

88
export default class ValueWrapper<V> extends AbstractWrapper<V> {
9-
constructor(private _interal: ValueInteral<V>) {
9+
constructor(private _internal: ValueInternal<V>) {
1010
super();
1111
}
1212

1313
get value() {
14-
return this._interal.$$state;
14+
return this._internal.$$state;
1515
}
1616

1717
set value(v: V) {
18-
this._interal.$$state = v;
18+
this._internal.$$state = v;
1919
}
2020

21-
exposeToDevltool() {
21+
exposeToDevtool() {
2222
if (process.env.NODE_ENV !== 'production') {
2323
const vm = this._vm!;
2424
const name = this._propName!;

0 commit comments

Comments
 (0)
0