Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

symbol.js 910B

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