Browse Source

feat: add $randint function

Ahmad Kholid 3 years ago
parent
commit
7fa7a99790
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/utils/reference-data/index.js

+ 3 - 0
src/utils/reference-data/index.js

@@ -24,6 +24,9 @@ export const funcs = {
 
     return result;
   },
+  randint(min = 0, max = 100) {
+    return Math.round(Math.random() * (+max - +min) + +min);
+  },
 };
 
 export default function ({ block, data: refData }) {