mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
Merge pull request #23946 from arusakov/bson-objectid-cachehexstring
bson: add cacheHexString boolean flag to ObjectID
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import * as bson from 'bson';
|
||||
|
||||
// enable hex string caching
|
||||
bson.ObjectID.cacheHexString = true
|
||||
|
||||
let BSON = new bson.BSON();
|
||||
let Long = bson.Long;
|
||||
|
||||
|
||||
2
types/bson/index.d.ts
vendored
2
types/bson/index.d.ts
vendored
@@ -135,6 +135,8 @@ export class ObjectID {
|
||||
constructor(id?: string | number | ObjectID);
|
||||
/** The generation time of this ObjectID instance */
|
||||
generationTime: number;
|
||||
/** If true cache the hex string representation of ObjectID */
|
||||
static cacheHexString?: boolean;
|
||||
/**
|
||||
* Creates an ObjectID from a hex string representation of an ObjectID.
|
||||
* @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
|
||||
|
||||
Reference in New Issue
Block a user