Skip to content

Commit 6ade5df

Browse files
committed
Stable Version 0.2.1.
1 parent dcfea3a commit 6ade5df

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
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

dist/js-data-levelup.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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",
@@ -11,12 +11,7 @@
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",

src/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

test/find.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)