This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs-blog-newsletter/backend/node_modules/bson/src/max_key.ts
2024-05-26 22:54:55 +02:00

38 lines
698 B
TypeScript

/** @public */
export interface MaxKeyExtended {
$maxKey: 1;
}
/**
* A class representation of the BSON MaxKey type.
* @public
* @category BSONType
*/
export class MaxKey {
_bsontype!: 'MaxKey';
constructor() {
if (!(this instanceof MaxKey)) return new MaxKey();
}
/** @internal */
toExtendedJSON(): MaxKeyExtended {
return { $maxKey: 1 };
}
/** @internal */
static fromExtendedJSON(): MaxKey {
return new MaxKey();
}
/** @internal */
[Symbol.for('nodejs.util.inspect.custom')](): string {
return this.inspect();
}
inspect(): string {
return 'new MaxKey()';
}
}
Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' });