@@ -45,20 +45,21 @@ module.exports =
4545/* 0 */
4646/***/ function ( module , exports , __webpack_require__ ) {
4747
48- var _slicedToArray = ( function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ 'return' ] ) _i [ 'return' ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( 'Invalid attempt to destructure non-iterable instance' ) ; } } ; } ) ( ) ;
48+ 'use strict' ;
4949
50- 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 ; } ; } ) ( ) ;
50+ var _slicedToArray = ( function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ) ( ) ;
5151
52- function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( 'Cannot call a class as a function' ) ; } }
52+ 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 ; } ; } ) ( ) ;
53+
54+ function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
5355
5456 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 ; }
5557
5658 var knex = __webpack_require__ ( 1 ) ;
5759 var JSData = __webpack_require__ ( 2 ) ;
58- var map = __webpack_require__ ( 3 ) ;
59- var underscore = __webpack_require__ ( 4 ) ;
60- var unique = __webpack_require__ ( 5 ) ;
61- var toString = __webpack_require__ ( 6 ) ;
60+ var underscore = __webpack_require__ ( 3 ) ;
61+ var unique = __webpack_require__ ( 4 ) ;
62+ var toString = __webpack_require__ ( 5 ) ;
6263 var DSUtils = JSData . DSUtils ;
6364
6465 var reserved = [ 'orderBy' , 'sort' , 'limit' , 'offset' , 'skip' , 'where' ] ;
@@ -78,9 +79,9 @@ module.exports =
7879 var relationDef = resourceConfig . getResource ( relationName ) ;
7980
8081 var containedName = null ;
81- if ( DSUtils . contains ( options [ ' with' ] , relationName ) ) {
82+ if ( DSUtils . contains ( options . with , relationName ) ) {
8283 containedName = relationName ;
83- } else if ( DSUtils . contains ( options [ ' with' ] , def . localField ) ) {
84+ } else if ( DSUtils . contains ( options . with , def . localField ) ) {
8485 containedName = def . localField ;
8586 } else {
8687 return ;
@@ -89,7 +90,7 @@ module.exports =
8990 var __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
9091
9192 // Filter to only properties under current relation
92- __options [ ' with' ] = options [ ' with' ] . filter ( function ( relation ) {
93+ __options . with = options . with . filter ( function ( relation ) {
9394 return relation !== containedName && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ;
9495 } ) . map ( function ( relation ) {
9596 return relation . substr ( containedName . length + 1 ) ;
@@ -102,7 +103,7 @@ module.exports =
102103 if ( instance ) {
103104 foreignKeyFilter = { '==' : instance [ resourceConfig . idAttribute ] } ;
104105 } else {
105- foreignKeyFilter = { 'in' : map ( items , function ( item ) {
106+ foreignKeyFilter = { 'in' : items . map ( function ( item ) {
106107 return item [ resourceConfig . idAttribute ] ;
107108 } ) } ;
108109 }
@@ -178,7 +179,7 @@ module.exports =
178179 } else {
179180 task = _this . findAll ( resourceConfig . getResource ( relationName ) , {
180181 where : _defineProperty ( { } , relationDef . idAttribute , {
181- 'in' : DSUtils . filter ( map ( items , function ( item ) {
182+ 'in' : DSUtils . filter ( items . map ( function ( item ) {
182183 return DSUtils . get ( item , def . localKey ) ;
183184 } ) , function ( x ) {
184185 return x ;
@@ -225,7 +226,7 @@ module.exports =
225226
226227 var instance = undefined ;
227228 options = options || { } ;
228- options [ ' with' ] = options [ ' with' ] || [ ] ;
229+ options . with = options . with || [ ] ;
229230 var query = options && options . transaction || this . query ;
230231 return query . select ( '*' ) . from ( getTable ( resourceConfig ) ) . where ( resourceConfig . idAttribute , toString ( id ) ) . then ( function ( rows ) {
231232 if ( ! rows . length ) {
@@ -245,7 +246,7 @@ module.exports =
245246
246247 var items = null ;
247248 options = options || { } ;
248- options [ ' with' ] = options [ ' with' ] || [ ] ;
249+ options . with = options . with || [ ] ;
249250 return this . filterQuery ( resourceConfig , params , options ) . then ( function ( _items ) {
250251 items = _items ;
251252 return loadWithRelations . call ( _this3 , _items , resourceConfig , options ) ;
@@ -288,7 +289,7 @@ module.exports =
288289
289290 attrs = DSUtils . removeCircular ( DSUtils . omit ( attrs , resourceConfig . relationFields || [ ] ) ) ;
290291 return this . filterQuery ( resourceConfig , params , options ) . then ( function ( items ) {
291- return map ( items , function ( item ) {
292+ return items . map ( function ( item ) {
292293 return item [ resourceConfig . idAttribute ] ;
293294 } ) ;
294295 } ) . then ( function ( ids ) {
@@ -369,21 +370,21 @@ module.exports =
369370
370371 var relationPath = [ ] ;
371372
372- var _loop = function ( ) {
373+ var _loop = function _loop ( ) {
373374 var relationName = parts . shift ( ) ;
374375 var relationResourceConfig = resourceConfig . getResource ( relationName ) ;
375376 relationPath . push ( relationName ) ;
376377
377378 if ( ! joinedTables . some ( function ( t ) {
378379 return t === relationPath . join ( '.' ) ;
379380 } ) ) {
380- var _localResourceConfig$relationList$filter = localResourceConfig . relationList . filter ( function ( r ) {
381+ var _localResourceConfig$ = localResourceConfig . relationList . filter ( function ( r ) {
381382 return r . relation === relationName ;
382383 } ) ;
383384
384- var _localResourceConfig$relationList$filter2 = _slicedToArray ( _localResourceConfig$relationList$filter , 1 ) ;
385+ var _localResourceConfig$2 = _slicedToArray ( _localResourceConfig$ , 1 ) ;
385386
386- var relation = _localResourceConfig$relationList$filter2 [ 0 ] ;
387+ var relation = _localResourceConfig$2 [ 0 ] ;
387388
388389 if ( relation ) {
389390 var _table = getTable ( localResourceConfig ) ;
@@ -501,24 +502,18 @@ module.exports =
501502
502503/***/ } ,
503504/* 3 */
504- /***/ function ( module , exports ) {
505-
506- module . exports = require ( "mout/array/map" ) ;
507-
508- /***/ } ,
509- /* 4 */
510505/***/ function ( module , exports ) {
511506
512507 module . exports = require ( "mout/string/underscore" ) ;
513508
514509/***/ } ,
515- /* 5 */
510+ /* 4 */
516511/***/ function ( module , exports ) {
517512
518513 module . exports = require ( "mout/array/unique" ) ;
519514
520515/***/ } ,
521- /* 6 */
516+ /* 5 */
522517/***/ function ( module , exports ) {
523518
524519 module . exports = require ( "mout/lang/toString" ) ;
0 commit comments