Skip to content

Commit 2277184

Browse files
authored
feat(micro-utilities): add convert-hrtime to replacements (#1215)
Co-authored-by: Maksim <11676775+maksimgm@users.noreply.github.com>
1 parent ee28df8 commit 2277184

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎manifests/micro-utilities.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,12 @@
552552
"description": "You can use a regular expression with `Array.prototype.reduce` to find the shortest leading whitespace across the lines of a string.",
553553
"example": "const minIndent = (string) => (string.match(/^[ \\t]*(?=\\S)/gm) ?? ['']).reduce((r, a) => Math.min(r, a.length), Infinity)"
554554
},
555+
"snippet::nanoseconds-to-seconds": {
556+
"id": "snippet::nanoseconds-to-seconds",
557+
"type": "simple",
558+
"description": "The result of `process.hrtime.bigint()` can be converted to a number and divided by `1e9` (1 billion) to compute the seconds.",
559+
"example": "const seconds = Number(nanoseconds) / 1e9"
560+
},
555561
"snippet::noop": {
556562
"id": "snippet::noop",
557563
"type": "simple",
@@ -830,6 +836,11 @@
830836
"moduleName": "comver-to-semver",
831837
"replacements": ["snippet::comver-to-semver"]
832838
},
839+
"convert-hrtime": {
840+
"type": "module",
841+
"moduleName": "convert-hrtime",
842+
"replacements": ["snippet::nanoseconds-to-seconds"]
843+
},
833844
"define-lazy-prop": {
834845
"type": "module",
835846
"moduleName": "define-lazy-prop",

0 commit comments

Comments
 (0)