Skip to content

Commit ec844b6

Browse files
author
Guðmundur Gunnarsson
committed
Added valueAsString to the fetch command.
1 parent c64502d commit ec844b6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/emailjs-imap-client.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,11 @@
10951095
value: sequence
10961096
}]
10971097
};
1098+
1099+
if (options.valueAsString !== undefined) {
1100+
command.valueAsString = options.valueAsString;
1101+
}
1102+
10981103
var query = [];
10991104

11001105
items.forEach((item) => {

test/unit/emailjs-imap-client-test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,21 @@
14471447
}]
14481448
});
14491449
});
1450+
1451+
it('should build FETCH with the valueAsString option', () => {
1452+
expect(br._buildFETCHCommand('1:*', ['body[]'], {valueAsString: false})).to.deep.equal({
1453+
command: 'FETCH',
1454+
attributes: [{
1455+
type: 'SEQUENCE',
1456+
value: '1:*'
1457+
}, {
1458+
type: 'ATOM',
1459+
value: 'BODY',
1460+
section: []
1461+
}],
1462+
valueAsString: false
1463+
});
1464+
});
14501465
});
14511466

14521467
describe('#_parseFETCH', () => {

0 commit comments

Comments
 (0)