Skip to content

Commit

Permalink
Merge pull request #47 from rparet/fix_timestamp_type
Browse files Browse the repository at this point in the history
fixed type on getTimestamp()
  • Loading branch information
niftylettuce authored Mar 12, 2022
2 parents 5006541 + b6efcc6 commit d1520df
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 d1520df

Please sign in to comment.