7681a4de66f58675875827502a156d5cf2f71a42
[aai/esr-gui.git] /
1 /**
2  * A class representation of the BSON Symbol type.
3  *
4  * @class
5  * @deprecated
6  * @param {string} value the string representing the symbol.
7  * @return {Symbol}
8  */
9 function Symbol(value) {
10   if(!(this instanceof Symbol)) return new Symbol(value);
11   this._bsontype = 'Symbol';
12   this.value = value;
13 }
14
15 /**
16  * Access the wrapped string value.
17  *
18  * @method
19  * @return {String} returns the wrapped string.
20  */
21 Symbol.prototype.valueOf = function() {
22   return this.value;
23 };
24
25 /**
26  * @ignore
27  */
28 Symbol.prototype.toString = function() {
29   return this.value;
30 }
31
32 /**
33  * @ignore
34  */
35 Symbol.prototype.inspect = function() {
36   return this.value;
37 }
38
39 /**
40  * @ignore
41  */
42 Symbol.prototype.toJSON = function() {
43   return this.value;
44 }
45
46 module.exports = Symbol;
47 module.exports.Symbol = Symbol;