@@ -2997,25 +2997,39 @@ require.define("/node_modules/mongoop/index.js",function(require,module,exports,
29972997 }
29982998
29992999 MongoOp . prototype . applyTo = function ( target ) {
3000- var _this = this ;
30013000 this . result = { } ;
3002- keys ( this . operation ) . forEach ( function ( operator ) {
3003- if ( 'function' !== typeof _this [ operator ] ) {
3004- throw new Error ( "Unrecognized operator: " + operator ) ;
3005- } else {
3006- return _this [ operator ] ( target , _this . operation [ operator ] ) ;
3007- }
3008- } ) ;
3001+ keys ( this . operation ) . forEach ( ( function ( _this ) {
3002+ return function ( operator ) {
3003+ if ( 'function' !== typeof _this [ operator ] ) {
3004+ throw new Error ( "Unrecognized operator: " + operator ) ;
3005+ } else {
3006+ return _this [ operator ] ( target , _this . operation [ operator ] ) ;
3007+ }
3008+ } ;
3009+ } ) ( this ) ) ;
3010+ return this ;
3011+ } ;
3012+
3013+ MongoOp . prototype . map = function ( fn ) {
3014+ var op ;
3015+ op = this . operation ;
3016+ this . operation = { } ;
3017+ keys ( op ) . forEach ( ( function ( _this ) {
3018+ return function ( operator ) {
3019+ return _this . operation [ operator ] = fn ( operator , op [ operator ] ) ;
3020+ } ;
3021+ } ) ( this ) ) ;
30093022 return this ;
30103023 } ;
30113024
30123025 MongoOp . prototype . forEachField = function ( fields , fn ) {
3013- var _this = this ;
3014- return keys ( fields ) . map ( function ( path ) {
3015- var val ;
3016- val = fields [ path ] ;
3017- return _this . result [ path ] = fn ( path , val ) ;
3018- } ) ;
3026+ return keys ( fields ) . map ( ( function ( _this ) {
3027+ return function ( path ) {
3028+ var val ;
3029+ val = fields [ path ] ;
3030+ return _this . result [ path ] = fn ( path , val ) ;
3031+ } ;
3032+ } ) ( this ) ) ;
30193033 } ;
30203034
30213035 MongoOp . prototype . $addToSet = ( function ( ) {
@@ -3036,26 +3050,27 @@ require.define("/node_modules/mongoop/index.js",function(require,module,exports,
30363050 }
30373051 } ;
30383052 return function ( target , fields ) {
3039- var _this = this ;
3040- return this . forEachField ( fields , function ( path , val ) {
3041- var child , collection , _i , _len , _ref1 , _results ;
3042- collection = getAt ( target , path ) ;
3043- if ( collection == null ) {
3044- collection = [ ] ;
3045- setAt ( target , path , collection ) ;
3046- }
3047- if ( val . $each != null ) {
3048- _ref1 = val . $each ;
3049- _results = [ ] ;
3050- for ( _i = 0 , _len = _ref1 . length ; _i < _len ; _i ++ ) {
3051- child = _ref1 [ _i ] ;
3052- _results . push ( $addToSet ( collection , child ) ) ;
3053+ return this . forEachField ( fields , ( function ( _this ) {
3054+ return function ( path , val ) {
3055+ var child , collection , _i , _len , _ref1 , _results ;
3056+ collection = getAt ( target , path ) ;
3057+ if ( collection == null ) {
3058+ collection = [ ] ;
3059+ setAt ( target , path , collection ) ;
30533060 }
3054- return _results ;
3055- } else {
3056- return $addToSet ( collection , val ) ;
3057- }
3058- } ) ;
3061+ if ( val . $each != null ) {
3062+ _ref1 = val . $each ;
3063+ _results = [ ] ;
3064+ for ( _i = 0 , _len = _ref1 . length ; _i < _len ; _i ++ ) {
3065+ child = _ref1 [ _i ] ;
3066+ _results . push ( $addToSet ( collection , child ) ) ;
3067+ }
3068+ return _results ;
3069+ } else {
3070+ return $addToSet ( collection , val ) ;
3071+ }
3072+ } ;
3073+ } ) ( this ) ) ;
30593074 } ;
30603075 } ) ( ) ;
30613076
@@ -4081,7 +4096,7 @@ Bongo = (function(_super) {
40814096
40824097 function Bongo ( options ) {
40834098 EventEmitter ( this ) ;
4084- this . mq = options . mq , this . getSessionToken = options . getSessionToken , this . getUserArea = options . getUserArea , this . fetchName = options . fetchName , this . resourceName = options . resourceName , this . apiEndpoint = options . apiEndpoint , this . useWebsockets = options . useWebsockets , this . batchRequests = options . batchRequests ;
4099+ this . mq = options . mq , this . getSessionToken = options . getSessionToken , this . getUserArea = options . getUserArea , this . fetchName = options . fetchName , this . resourceName = options . resourceName , this . apiEndpoint = options . apiEndpoint , this . useWebsockets = options . useWebsockets , this . batchRequests = options . batchRequests , this . apiDescriptor = options . apiDescriptor ;
40854100 if ( this . useWebsockets == null ) {
40864101 this . useWebsockets = false ;
40874102 }
@@ -4122,7 +4137,7 @@ Bongo = (function(_super) {
41224137 }
41234138 process . nextTick ( ( function ( _this ) {
41244139 return function ( ) {
4125- return _this . api = _this . createRemoteApiShims ( REMOTE_API ) ;
4140+ return _this . api = _this . createRemoteApiShims ( _this . apiDescriptor ) ;
41264141 } ;
41274142 } ) ( this ) ) ;
41284143 }
0 commit comments