Skip to content

Commit

Permalink
fixed type on getTimestamp()
Browse files Browse the repository at this point in the history
  • Loading branch information
rparet committed Mar 12, 2022
1 parent 5006541 commit b6efcc6
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 20 deletions.
2 changes: 1 addition & 1 deletion objectid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare interface ObjectID {

toHexString(): string;
equals(other: ObjectID): boolean;
getTimestamp(): number;
getTimestamp(): Date;
}

declare interface ObjectIDCtor {
Expand Down
305 changes: 289 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"homepage": "https://github.com/williamkapke/bson-objectid",
"devDependencies": {
"@types/node": "^8.0.31",
"mocha": "^5.2.0",
"should": "^4.1.0",
"typescript": "^2.5.3",
"mocha": "^5.2.0"
"typescript": "^4.6.2"
}
}
2 changes: 1 addition & 1 deletion typing-tests/objectid-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ oid = ObjectID(idString);

// ----------------------------------------------------------------------------
// should correctly retrieve timestamp
const timestamp:number = oid.getTimestamp();
const timestamp:Date = oid.getTimestamp();

// ----------------------------------------------------------------------------
// should validate valid hex strings
Expand Down

0 comments on commit b6efcc6

Please sign in to comment.