dotfiles/vscode/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/node_modules/bson/lib/symbol.js
Errol Sancaktar ff17c17e23 vscode
2024-06-14 09:31:58 -06:00

46 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BSONSymbol = void 0;
/**
* A class representation of the BSON Symbol type.
* @public
*/
class BSONSymbol {
/**
* @param value - the string representing the symbol.
*/
constructor(value) {
this.value = value;
}
/** Access the wrapped string value. */
valueOf() {
return this.value;
}
/** @internal */
toString() {
return this.value;
}
/** @internal */
inspect() {
return `BSONSymbol("${this.value}")`;
}
/** @internal */
toJSON() {
return this.value;
}
/** @internal */
toExtendedJSON() {
return { $symbol: this.value };
}
/** @internal */
static fromExtendedJSON(doc) {
return new BSONSymbol(doc.$symbol);
}
/** @internal */
[Symbol.for('nodejs.util.inspect.custom')]() {
return this.inspect();
}
}
exports.BSONSymbol = BSONSymbol;
Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' });
//# sourceMappingURL=symbol.js.map