@@ -105,10 +105,10 @@ export function readCookie(cookies, name) {
105
105
if ( ! cookies ) {
106
106
return undefined
107
107
}
108
- var nameEQ = name + '='
109
- var ca = cookies . split ( ';' )
110
- for ( var i = 0 ; i < ca . length ; i ++ ) {
111
- var c = ca [ i ]
108
+ const nameEQ = name + '='
109
+ const ca = cookies . split ( ';' )
110
+ for ( let i = 0 ; i < ca . length ; i ++ ) {
111
+ let c = ca [ i ]
112
112
while ( c . charAt ( 0 ) === ' ' ) {
113
113
c = c . substring ( 1 , c . length )
114
114
}
@@ -142,7 +142,7 @@ const authDefaults = {
142
142
export function getValidPayloadFromToken ( token ) {
143
143
if ( token ) {
144
144
try {
145
- var payload = decode ( token )
145
+ const payload = decode ( token )
146
146
return payloadIsValid ( payload ) ? payload : undefined
147
147
} catch ( error ) {
148
148
return undefined
@@ -240,7 +240,7 @@ export function getModelName(Model) {
240
240
241
241
export function registerModel ( Model , globalModels , apiPrefix , servicePath ) {
242
242
const modelName = getModelName ( Model )
243
- let path = apiPrefix ? `${ apiPrefix } .${ modelName } ` : modelName
243
+ const path = apiPrefix ? `${ apiPrefix } .${ modelName } ` : modelName
244
244
245
245
setByDot ( globalModels , path , Model )
246
246
globalModels . byServicePath [ servicePath ] = Model
@@ -284,7 +284,8 @@ export function updateOriginal(original, newData) {
284
284
// If the old prop is null or undefined, and the new prop is neither
285
285
} else if (
286
286
( oldProp === null || oldProp === undefined ) &&
287
- ( newProp !== null && newProp !== undefined )
287
+ newProp !== null &&
288
+ newProp !== undefined
288
289
) {
289
290
shouldCopyProp = true
290
291
// If both old and new are arrays
@@ -310,7 +311,10 @@ export function updateOriginal(original, newData) {
310
311
} )
311
312
}
312
313
313
- export function getQueryInfo ( params : Params = { } , response : Partial < Pick < Paginated < any > , 'limit' | 'skip' > > = { } ) {
314
+ export function getQueryInfo (
315
+ params : Params = { } ,
316
+ response : Partial < Pick < Paginated < any > , 'limit' | 'skip' > > = { }
317
+ ) {
314
318
const query = params . query || { }
315
319
const qid : string = params . qid || 'default'
316
320
const $limit =
@@ -369,9 +373,7 @@ export function makeNamespace(namespace, servicePath, nameStyle) {
369
373
export function getServicePath ( service : Service < any > , Model : any ) {
370
374
if ( ! service . name && ! service . path && ! Model . servicePath ) {
371
375
throw new Error (
372
- `Service for model named ${
373
- Model . name
374
- } is missing a path or name property. The feathers adapter needs to be updated with a PR to expose this property. You can work around this by adding a static servicePath = passing a 'servicePath' attribute in the options: makeServicePlugin({servicePath: '/path/to/my/service'})`
376
+ `Service for model named ${ Model . name } is missing a path or name property. The feathers adapter needs to be updated with a PR to expose this property. You can work around this by adding a static servicePath = passing a 'servicePath' attribute in the options: makeServicePlugin({servicePath: '/path/to/my/service'})`
375
377
)
376
378
}
377
379
@@ -380,7 +382,7 @@ export function getServicePath(service: Service<any>, Model: any) {
380
382
381
383
export function randomString ( length ) {
382
384
let text = ''
383
- let possible =
385
+ const possible =
384
386
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
385
387
386
388
for ( let i = 0 ; i < length ; i ++ ) {
@@ -413,8 +415,8 @@ export function mergeWithAccessors(
413
415
) {
414
416
const sourceProps = Object . getOwnPropertyNames ( source )
415
417
const destProps = Object . getOwnPropertyNames ( dest )
416
- let sourceIsVueObservable = sourceProps . includes ( '__ob__' )
417
- let destIsVueObservable = destProps . includes ( '__ob__' )
418
+ const sourceIsVueObservable = sourceProps . includes ( '__ob__' )
419
+ const destIsVueObservable = destProps . includes ( '__ob__' )
418
420
sourceProps . forEach ( key => {
419
421
const sourceDesc = Object . getOwnPropertyDescriptor ( source , key )
420
422
const destDesc = Object . getOwnPropertyDescriptor ( dest , key )
@@ -505,7 +507,7 @@ export function checkNamespace(namespace, item, debug) {
505
507
}
506
508
507
509
export function assignIfNotPresent ( Model , props ) : void {
508
- for ( let key in props ) {
510
+ for ( const key in props ) {
509
511
if ( ! Model . hasOwnProperty ( key ) ) {
510
512
Model [ key ] = props [ key ]
511
513
}
0 commit comments