82c5bd60039917a8a2cb041f6687d94c8e7afa85
[aai/esr-gui.git] /
1 /**
2  * A class representation of the BSON Double type.
3  *
4  * @class
5  * @param {number} value the number we want to represent as a double.
6  * @return {Double}
7  */
8 function Double(value) {
9   if(!(this instanceof Double)) return new Double(value);
10
11   this._bsontype = 'Double';
12   this.value = value;
13 }
14
15 /**
16  * Access the number value.
17  *
18  * @method
19  * @return {number} returns the wrapped double number.
20  */
21 Double.prototype.valueOf = function() {
22   return this.value;
23 };
24
25 /**
26  * @ignore
27  */
28 Double.prototype.toJSON = function() {
29   return this.value;
30 }
31
32 module.exports = Double;
33 module.exports.Double = Double;