diff --git a/lib/random.d.ts b/lib/random.d.ts index 8b69aab..297718e 100644 --- a/lib/random.d.ts +++ b/lib/random.d.ts @@ -6,5 +6,7 @@ * to make sure key is sequential. Key will be timestamp in hex plus a 5 char random id. * * Note: Because of the timestamp in ms, key is only sequential until a certain point i.e two keys generated in the same ms. + * @param {boolean} ascending + * @returns {string} randomKey */ export declare const generateKey: (ascending: boolean) => string; diff --git a/lib/random.js b/lib/random.js index 5b8f03e..1106b2f 100644 --- a/lib/random.js +++ b/lib/random.js @@ -12,6 +12,8 @@ const maxDateNowValue = 8.64e15; // Fun fact: This will only work until the year * to make sure key is sequential. Key will be timestamp in hex plus a 5 char random id. * * Note: Because of the timestamp in ms, key is only sequential until a certain point i.e two keys generated in the same ms. + * @param {boolean} ascending + * @returns {string} randomKey */ const generateKey = (ascending) => { const timestamp = ascending ? Date.now() : maxDateNowValue - Date.now(); diff --git a/package-lock.json b/package-lock.json index 7e30710..666c15b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "deta-base-orm", - "version": "0.1.2", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bd4f88b..e452f2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deta-base-orm", - "version": "0.1.2", + "version": "0.2.0", "description": "Basic ORM for Deta Base", "main": "./lib/index.js", "types": "./lib/index.d.ts",