git ssb

0+

cel-desktop / ssb-pkg



Tree: ca90b5ca0579ebdcc0635288bce4978e3fb200f5

Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-79-npm / bson / bson@0.2.22.js

661 bytesRaw
1'use strict';
2
3var bson = require('bson');
4
5var pure = {};
6pure.Long = bson.pure().Long;
7pure.doc = { long: pure.Long.fromNumber(100) };
8pure.BSON = bson.pure().BSON;
9pure.obj = new (pure.BSON)();
10pure.data = pure.obj.serialize(pure.doc, false, true, false);
11pure.doc2 = pure.obj.deserialize(pure.data);
12
13var natv = {};
14natv.Long = bson.native().Long;
15natv.doc = { long: natv.Long.fromNumber(200) };
16natv.BSON = bson.native().BSON;
17natv.obj = new (natv.BSON)();
18natv.data = natv.obj.serialize(natv.doc, false, true, false);
19natv.doc2 = natv.obj.deserialize(natv.data);
20
21if (pure.doc2.long === 100) {
22 if (natv.doc2.long === 200) {
23 console.log('ok');
24 }
25}
26

Built with git-ssb-web