File tree Expand file tree Collapse file tree 5 files changed +19
-8
lines changed
Expand file tree Collapse file tree 5 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1+ ##### 0.2.1 - 10 July 2015
2+
3+ ###### Backwards compatible bug fixes
4+ - Fix for loading relations in find() and findAll()
5+
16##### 0.2.0 - 10 July 2015
27
38###### Backwards compatible API changes
Original file line number Diff line number Diff line change @@ -277,11 +277,14 @@ module.exports =
277277 if ( containedName ) {
278278 ( function ( ) {
279279 var __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
280+ __options [ 'with' ] = options [ 'with' ] . slice ( ) ;
280281 __options = DSUtils . _ ( relationDef , __options ) ;
281282 DSUtils . remove ( __options [ 'with' ] , containedName ) ;
282283 DSUtils . forEach ( __options [ 'with' ] , function ( relation , i ) {
283284 if ( relation && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ) {
284285 __options [ 'with' ] [ i ] = relation . substr ( containedName . length + 1 ) ;
286+ } else {
287+ __options [ 'with' ] [ i ] = '' ;
285288 }
286289 } ) ;
287290
@@ -371,11 +374,14 @@ module.exports =
371374 if ( containedName ) {
372375 ( function ( ) {
373376 var __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
377+ __options [ 'with' ] = options [ 'with' ] . slice ( ) ;
374378 __options = DSUtils . _ ( relationDef , __options ) ;
375379 DSUtils . remove ( __options [ 'with' ] , containedName ) ;
376380 DSUtils . forEach ( __options [ 'with' ] , function ( relation , i ) {
377381 if ( relation && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ) {
378382 __options [ 'with' ] [ i ] = relation . substr ( containedName . length + 1 ) ;
383+ } else {
384+ __options [ 'with' ] [ i ] = '' ;
379385 }
380386 } ) ;
381387
Original file line number Diff line number Diff line change 11{
22 "name" : " js-data-levelup" ,
33 "description" : " LevelUp adapter for js-data." ,
4- "version" : " 0.2.0 " ,
4+ "version" : " 0.2.1 " ,
55 "homepage" : " http://www.js-data.io/docs/dslevelupadapter" ,
66 "repository" : {
77 "type" : " git" ,
1111 "name" : " Jason Dobry" ,
1212 "email" : " jason.dobry@gmail.com"
1313 },
14- "licenses" : [
15- {
16- "type" : " MIT" ,
17- "url" : " https://github.com/js-data/js-data-levelup/blob/master/LICENSE"
18- }
19- ],
14+ "license" : " MIT" ,
2015 "main" : " ./dist/js-data-levelup.js" ,
2116 "keywords" : [
2217 " data" ,
Original file line number Diff line number Diff line change @@ -189,11 +189,14 @@ class DSLevelUpAdapter {
189189 }
190190 if ( containedName ) {
191191 let __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
192+ __options . with = options . with . slice ( ) ;
192193 __options = DSUtils . _ ( relationDef , __options ) ;
193194 DSUtils . remove ( __options . with , containedName ) ;
194195 DSUtils . forEach ( __options . with , ( relation , i ) => {
195196 if ( relation && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ) {
196197 __options . with [ i ] = relation . substr ( containedName . length + 1 ) ;
198+ } else {
199+ __options . with [ i ] = '' ;
197200 }
198201 } ) ;
199202
@@ -278,11 +281,14 @@ class DSLevelUpAdapter {
278281 }
279282 if ( containedName ) {
280283 let __options = DSUtils . deepMixIn ( { } , options . orig ? options . orig ( ) : options ) ;
284+ __options . with = options . with . slice ( ) ;
281285 __options = DSUtils . _ ( relationDef , __options ) ;
282286 DSUtils . remove ( __options . with , containedName ) ;
283287 DSUtils . forEach ( __options . with , ( relation , i ) => {
284288 if ( relation && relation . indexOf ( containedName ) === 0 && relation . length >= containedName . length && relation [ containedName . length ] === '.' ) {
285289 __options . with [ i ] = relation . substr ( containedName . length + 1 ) ;
290+ } else {
291+ __options . with [ i ] = '' ;
286292 }
287293 } ) ;
288294
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ describe('DSLevelUpAdapter#find', function () {
9292 throw new Error ( 'Should not have reached here!' ) ;
9393 } )
9494 . catch ( function ( err ) {
95- console . log ( err . stack ) ;
9695 assert . equal ( err . message , 'Not Found!' ) ;
9796 } ) ;
9897 } ) ;
You can’t perform that action at this time.
0 commit comments