We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f53b8f2 commit f2acf88Copy full SHA for f2acf88
README.md
@@ -6,7 +6,7 @@ hashkey-middleware
6
CLI Usage
7
---------
8
9
- node index.js [number]
+ node index.js [number|hashkey]
10
11
Hashkey
12
index.js
@@ -32,9 +32,11 @@ function hashKeyMiddlewareWrapper (options = {
32
33
if (options.isMainModule === true) {
34
const hashid = genHashId(idHashids, process.argv[2]);
35
+ let decoded = decHashId(idHashids, process.argv[2]);
36
+ decoded = { id: decoded[0], time: new Date(decoded[1]) };
37
return {
38
hashid,
- decoded: decHashId(idHashids, hashid),
39
+ decoded: decoded || decHashId(idHashids, hashid),
40
};
41
}
42
0 commit comments