File tree 5 files changed +18
-18
lines changed 5 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 1
1
import { VueConstructor } from 'vue' ;
2
2
import { getCurrentVue } from '../runtimeContext' ;
3
- import { ensuerCurrentVMInFn } from '../helper' ;
3
+ import { ensureCurrentVMInFn } from '../helper' ;
4
4
import { UnknownObject } from '../types/basic' ;
5
5
import { hasOwn } from '../utils' ;
6
6
@@ -31,7 +31,7 @@ export function provide(provideOption: ProvideOption) {
31
31
return ;
32
32
}
33
33
34
- const vm = ensuerCurrentVMInFn ( 'provide' ) ;
34
+ const vm = ensureCurrentVMInFn ( 'provide' ) ;
35
35
( vm as any ) . _provided =
36
36
typeof provideOption === 'function' ? provideOption . call ( vm ) : provideOption ;
37
37
}
@@ -41,6 +41,6 @@ export function inject(injectKey: InjectKey) {
41
41
return ;
42
42
}
43
43
44
- const vm = ensuerCurrentVMInFn ( 'inject' ) ;
44
+ const vm = ensureCurrentVMInFn ( 'inject' ) ;
45
45
return resolveInject ( injectKey , vm ) ;
46
46
}
Original file line number Diff line number Diff line change 1
- import { ensuerCurrentVMInFn } from '../helper' ;
1
+ import { ensureCurrentVMInFn } from '../helper' ;
2
2
3
3
const genName = ( name : string ) => `on${ name [ 0 ] . toUpperCase ( ) + name . slice ( 1 ) } ` ;
4
4
function createLifeCycle ( lifeCyclehook : string ) {
5
5
return ( callback : Function ) => {
6
- const vm = ensuerCurrentVMInFn ( genName ( lifeCyclehook ) ) ;
6
+ const vm = ensureCurrentVMInFn ( genName ( lifeCyclehook ) ) ;
7
7
vm . $on ( `hook:${ lifeCyclehook } ` , callback ) ;
8
8
} ;
9
9
}
10
10
11
11
function createLifeCycles ( lifeCyclehooks : string [ ] , name : string ) {
12
12
return ( callback : Function ) => {
13
- const vm = ensuerCurrentVMInFn ( name ) ;
13
+ const vm = ensureCurrentVMInFn ( name ) ;
14
14
lifeCyclehooks . forEach ( lifeCyclehook => vm . $on ( `hook:${ lifeCyclehook } ` , callback ) ) ;
15
15
} ;
16
16
}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export function isWrapper<T>(obj: any): obj is AbstractWrapper<T> {
7
7
return obj instanceof AbstractWrapper ;
8
8
}
9
9
10
- export function ensuerCurrentVMInFn ( hook : string ) : InstanceType < VueConstructor > {
10
+ export function ensureCurrentVMInFn ( hook : string ) : InstanceType < VueConstructor > {
11
11
const vm = getCurrentVM ( ) ;
12
12
if ( process . env . NODE_ENV !== 'production' ) {
13
13
assert ( vm , `"${ hook } " get called outside of "setup()"` ) ;
Original file line number Diff line number Diff line change @@ -2,22 +2,22 @@ import { getCurrentVue } from '../runtimeContext';
2
2
import { proxy } from '../utils' ;
3
3
import AbstractWrapper from './AbstractWrapper' ;
4
4
5
- interface ComputedInteral < T > {
5
+ interface ComputedInternal < T > {
6
6
read ( ) : T ;
7
7
write ?( x : T ) : void ;
8
8
}
9
9
10
10
export default class ComputedWrapper < V > extends AbstractWrapper < V > {
11
- constructor ( private _interal : ComputedInteral < V > ) {
11
+ constructor ( private _internal : ComputedInternal < V > ) {
12
12
super ( ) ;
13
13
}
14
14
15
15
get value ( ) {
16
- return this . _interal . read ( ) ;
16
+ return this . _internal . read ( ) ;
17
17
}
18
18
19
19
set value ( val : V ) {
20
- if ( ! this . _interal . write ) {
20
+ if ( ! this . _internal . write ) {
21
21
if ( process . env . NODE_ENV !== 'production' ) {
22
22
getCurrentVue ( ) . util . warn (
23
23
'Computed property' +
@@ -27,11 +27,11 @@ export default class ComputedWrapper<V> extends AbstractWrapper<V> {
27
27
) ;
28
28
}
29
29
} else {
30
- this . _interal . write ( val ) ;
30
+ this . _internal . write ( val ) ;
31
31
}
32
32
}
33
33
34
- exposeToDevltool ( ) {
34
+ exposeToDevtool ( ) {
35
35
if ( process . env . NODE_ENV !== 'production' ) {
36
36
const vm = this . _vm ! ;
37
37
const name = this . _propName ! ;
Original file line number Diff line number Diff line change 1
1
import { proxy } from '../utils' ;
2
2
import AbstractWrapper from './AbstractWrapper' ;
3
3
4
- interface ValueInteral < T > {
4
+ interface ValueInternal < T > {
5
5
$$state : T ;
6
6
}
7
7
8
8
export default class ValueWrapper < V > extends AbstractWrapper < V > {
9
- constructor ( private _interal : ValueInteral < V > ) {
9
+ constructor ( private _internal : ValueInternal < V > ) {
10
10
super ( ) ;
11
11
}
12
12
13
13
get value ( ) {
14
- return this . _interal . $$state ;
14
+ return this . _internal . $$state ;
15
15
}
16
16
17
17
set value ( v : V ) {
18
- this . _interal . $$state = v ;
18
+ this . _internal . $$state = v ;
19
19
}
20
20
21
- exposeToDevltool ( ) {
21
+ exposeToDevtool ( ) {
22
22
if ( process . env . NODE_ENV !== 'production' ) {
23
23
const vm = this . _vm ! ;
24
24
const name = this . _propName ! ;
You can’t perform that action at this time.
0 commit comments