Skip to content

Commit 07d41d4

Browse files
committed
Fix null handling.
- Updated handling of edge case null values due to previous changes.
1 parent 91fe9d1 commit 07d41d4

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

lib/expand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ async function _expandObject({
671671
return ve;
672672
}
673673
return v;
674-
}).filter(v => v !== null),
674+
}),
675675
{propertyIsArray: options.isFrame});
676676
continue;
677677
}
@@ -1155,7 +1155,6 @@ function _expandValue({activeCtx, activeProperty, value, options}) {
11551155
options
11561156
});
11571157
}
1158-
return {};
11591158
}
11601159
return {'@id': expandedValue};
11611160
}

tests/misc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,7 @@ describe('events', () => {
12031203
const expected =
12041204
[
12051205
{
1206+
"@id": null,
12061207
"ex:p": [
12071208
{
12081209
"@value": "v"
@@ -1240,7 +1241,11 @@ describe('events', () => {
12401241
const expected =
12411242
[
12421243
{
1243-
"ex:idp": [{}],
1244+
"ex:idp": [
1245+
{
1246+
"@id": null
1247+
}
1248+
],
12441249
"ex:p": [
12451250
{
12461251
"@value": "v"
@@ -1278,6 +1283,7 @@ describe('events', () => {
12781283
const expected =
12791284
[
12801285
{
1286+
"@id": null,
12811287
"ex:p": [
12821288
{
12831289
"@value": "v"
@@ -1315,7 +1321,11 @@ describe('events', () => {
13151321
const expected =
13161322
[
13171323
{
1318-
"ex:idp": [{}],
1324+
"ex:idp": [
1325+
{
1326+
"@id": null
1327+
}
1328+
],
13191329
"ex:p": [
13201330
{
13211331
"@value": "v"

0 commit comments

Comments
 (0)