1
1
/*!
2
2
* js-data-localstorage
3
- * @version 2.1.2 - Homepage <http://www.js-data.io/docs/dslocalstorageadapter>
3
+ * @version 2.1.3 - Homepage <http://www.js-data.io/docs/dslocalstorageadapter>
4
4
* @author Jason Dobry <[email protected] >
5
5
* @copyright (c) 2014-2015 Jason Dobry
6
6
* @license MIT <https://github.com/js-data/js-data-localstorage/blob/master/LICENSE>
@@ -63,11 +63,13 @@ return /******/ (function(modules) { // webpackBootstrap
63
63
/* 0 */
64
64
/***/ function ( module , exports , __webpack_require__ ) {
65
65
66
- var _createClass = ( function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( 'value' in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ) ( ) ;
66
+ 'use strict' ;
67
+
68
+ var _createClass = ( function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ) ( ) ;
67
69
68
70
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
69
71
70
- function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( ' Cannot call a class as a function' ) ; } }
72
+ function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( " Cannot call a class as a function" ) ; } }
71
73
72
74
/* global: localStorage */
73
75
var JSData = __webpack_require__ ( 1 ) ;
@@ -210,7 +212,7 @@ return /******/ (function(modules) { // webpackBootstrap
210
212
211
213
var instance = undefined ;
212
214
options = options || { } ;
213
- options [ ' with' ] = options [ ' with' ] || [ ] ;
215
+ options . with = options . with || [ ] ;
214
216
return new DSUtils . Promise ( function ( resolve , reject ) {
215
217
_this . GET ( _this . getIdPath ( resourceConfig , options || { } , id ) ) . then ( function ( item ) {
216
218
return ! item ? reject ( new Error ( 'Not Found!' ) ) : item ;
@@ -222,22 +224,22 @@ return /******/ (function(modules) { // webpackBootstrap
222
224
var relationName = def . relation ;
223
225
var relationDef = resourceConfig . getResource ( relationName ) ;
224
226
var containedName = null ;
225
- if ( DSUtils . contains ( options [ ' with' ] , relationName ) ) {
227
+ if ( DSUtils . contains ( options . with , relationName ) ) {
226
228
containedName = relationName ;
227
- } else if ( DSUtils . contains ( options [ ' with' ] , def . localField ) ) {
229
+ } else if ( DSUtils . contains ( options . with , def . localField ) ) {
228
230
containedName = def . localField ;
229
231
}
230
232
if ( containedName ) {
231
233
( function ( ) {
232
234
var __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
233
- __options [ ' with' ] = options [ ' with' ] . slice ( ) ;
235
+ __options . with = options . with . slice ( ) ;
234
236
__options = DSUtils . _ ( relationDef , __options ) ;
235
- DSUtils . remove ( __options [ ' with' ] , containedName ) ;
236
- DSUtils . forEach ( __options [ ' with' ] , function ( relation , i ) {
237
+ DSUtils . remove ( __options . with , containedName ) ;
238
+ DSUtils . forEach ( __options . with , function ( relation , i ) {
237
239
if ( relation && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ) {
238
- __options [ ' with' ] [ i ] = relation . substr ( containedName . length + 1 ) ;
240
+ __options . with [ i ] = relation . substr ( containedName . length + 1 ) ;
239
241
} else {
240
- __options [ ' with' ] [ i ] = '' ;
242
+ __options . with [ i ] = '' ;
241
243
}
242
244
} ) ;
243
245
@@ -288,7 +290,7 @@ return /******/ (function(modules) { // webpackBootstrap
288
290
return DSUtils . Promise . all ( tasks ) ;
289
291
} ) . then ( function ( ) {
290
292
return resolve ( instance ) ;
291
- } ) [ ' catch' ] ( reject ) ;
293
+ } ) . catch ( reject ) ;
292
294
} ) ;
293
295
}
294
296
} , {
@@ -298,7 +300,7 @@ return /******/ (function(modules) { // webpackBootstrap
298
300
299
301
var items = null ;
300
302
options = options || { } ;
301
- options [ ' with' ] = options [ ' with' ] || [ ] ;
303
+ options . with = options . with || [ ] ;
302
304
return new DSUtils . Promise ( function ( resolve , reject ) {
303
305
try {
304
306
( function ( ) {
@@ -326,22 +328,22 @@ return /******/ (function(modules) { // webpackBootstrap
326
328
var relationName = def . relation ;
327
329
var relationDef = resourceConfig . getResource ( relationName ) ;
328
330
var containedName = null ;
329
- if ( DSUtils . contains ( options [ ' with' ] , relationName ) ) {
331
+ if ( DSUtils . contains ( options . with , relationName ) ) {
330
332
containedName = relationName ;
331
- } else if ( DSUtils . contains ( options [ ' with' ] , def . localField ) ) {
333
+ } else if ( DSUtils . contains ( options . with , def . localField ) ) {
332
334
containedName = def . localField ;
333
335
}
334
336
if ( containedName ) {
335
337
( function ( ) {
336
338
var __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
337
- __options [ ' with' ] = options [ ' with' ] . slice ( ) ;
339
+ __options . with = options . with . slice ( ) ;
338
340
__options = DSUtils . _ ( relationDef , __options ) ;
339
- DSUtils . remove ( __options [ ' with' ] , containedName ) ;
340
- DSUtils . forEach ( __options [ ' with' ] , function ( relation , i ) {
341
+ DSUtils . remove ( __options . with , containedName ) ;
342
+ DSUtils . forEach ( __options . with , function ( relation , i ) {
341
343
if ( relation && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ) {
342
- __options [ ' with' ] [ i ] = relation . substr ( containedName . length + 1 ) ;
344
+ __options . with [ i ] = relation . substr ( containedName . length + 1 ) ;
343
345
} else {
344
- __options [ ' with' ] [ i ] = '' ;
346
+ __options . with [ i ] = '' ;
345
347
}
346
348
} ) ;
347
349
@@ -445,7 +447,7 @@ return /******/ (function(modules) { // webpackBootstrap
445
447
_this3 . PUT ( DSUtils . makePath ( _this3 . getIdPath ( resourceConfig , options , attrs [ resourceConfig . idAttribute ] ) ) , DSUtils . omit ( attrs , resourceConfig . relationFields || [ ] ) ) . then ( function ( item ) {
446
448
_this3 . ensureId ( item [ resourceConfig . idAttribute ] , resourceConfig , options ) ;
447
449
resolve ( item ) ;
448
- } ) [ ' catch' ] ( reject ) ;
450
+ } ) . catch ( reject ) ;
449
451
} ) ;
450
452
} ) ;
451
453
}
@@ -460,7 +462,7 @@ return /******/ (function(modules) { // webpackBootstrap
460
462
_this4 . PUT ( _this4 . getIdPath ( resourceConfig , options , id ) , DSUtils . omit ( attrs , resourceConfig . relationFields || [ ] ) ) . then ( function ( item ) {
461
463
_this4 . ensureId ( item [ resourceConfig . idAttribute ] , resourceConfig , options ) ;
462
464
resolve ( item ) ;
463
- } ) [ ' catch' ] ( reject ) ;
465
+ } ) . catch ( reject ) ;
464
466
} ) ;
465
467
} ) ;
466
468
}
@@ -512,10 +514,10 @@ return /******/ (function(modules) { // webpackBootstrap
512
514
} ) ( ) ;
513
515
514
516
DSLocalStorageAdapter . version = {
515
- full : '2.1.2 ' ,
517
+ full : '2.1.3 ' ,
516
518
major : parseInt ( '2' , 10 ) ,
517
519
minor : parseInt ( '1' , 10 ) ,
518
- patch : parseInt ( '2 ' , 10 ) ,
520
+ patch : parseInt ( '3 ' , 10 ) ,
519
521
alpha : true ? 'false' : false ,
520
522
beta : true ? 'false' : false
521
523
} ;
0 commit comments