@@ -15,18 +15,27 @@ const sharedPropertyDefinition = {
1515 set : noop ,
1616} ;
1717
18- export function proxy ( target : any , key : string , { get, set } : { get ?: Function ; set ?: Function } ) {
18+ export function proxy ( target : any , key : string , { get, set } : { get ?: Function ; set ?: Function } = { } ) {
1919 sharedPropertyDefinition . get = get || noop ;
2020 sharedPropertyDefinition . set = set || noop ;
2121 Object . defineProperty ( target , key , sharedPropertyDefinition ) ;
2222}
2323
24- export function def ( obj : Record < string , any > , key : string , val : any , enumerable ?: boolean ) {
24+ export function def (
25+ obj : Record < string , any > ,
26+ key : string ,
27+ val : any ,
28+ {
29+ enumerable = false ,
30+ writable = true ,
31+ configurable = true ,
32+ } : { enumerable ?: boolean ; writable ?: boolean ; configurable ?: boolean } = { } ,
33+ ) {
2534 Object . defineProperty ( obj , key , {
2635 value : val ,
27- enumerable : ! ! enumerable ,
28- writable : true ,
29- configurable : true ,
36+ enumerable,
37+ writable,
38+ configurable,
3039 } ) ;
3140}
3241
@@ -41,21 +50,21 @@ export function createUid() {
4150
4251export function assert ( condition : any , msg : string ) {
4352 if ( ! condition ) {
44- throw new Error ( `[@vue-async] ${ msg } ` ) ;
53+ throw new Error ( `error: ${ msg } ` ) ;
4554 }
4655}
4756
4857export function warn ( condition : boolean , msg : string , vm ?: _Vue ) {
4958 if ( ! condition ) {
5059 // eslint-disable-next-line no-console
51- console . warn ( `[@vue-async] ${ msg } ` , vm ) ;
60+ console . warn ( `warning: ${ msg } ` , vm ) ;
5261 }
5362}
5463
5564export function error ( condition : boolean , msg : string , vm ?: _Vue ) {
5665 if ( ! condition ) {
5766 // eslint-disable-next-line no-console
58- console . error ( `[@vue-async] ${ msg } ` , vm ) ;
67+ console . error ( `error: ${ msg } ` , vm ) ;
5968 }
6069}
6170
0 commit comments