@react-pakistan/util-functions 1.24.14 → 1.24.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ interface Params {
2
+ refLength: number;
3
+ }
4
+ export declare const generateRef: ({ refLength }: Params) => string;
5
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateRef = void 0;
4
+ var uuid_1 = require("uuid");
5
+ var constants_1 = require("../constants");
6
+ var generateRef = function (_a) {
7
+ var _b = _a.refLength, refLength = _b === void 0 ? 5 : _b;
8
+ var ref = (0, uuid_1.v4)().slice(0, refLength);
9
+ var currentYear = new Date().getFullYear().toString().slice(-2);
10
+ return "".concat(ref).concat(constants_1.VALUE_DELIMITER.SLASH).concat(currentYear);
11
+ };
12
+ exports.generateRef = generateRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.24.14",
3
+ "version": "1.24.15",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -70,7 +70,8 @@
70
70
  "ts-jest": "^29",
71
71
  "ts-loader": "^9",
72
72
  "ts-node": "^10",
73
- "typescript": "^5"
73
+ "typescript": "^5",
74
+ "uuid": "^11.1.0"
74
75
  },
75
76
  "engines": {
76
77
  "npm": ">=10.0.0",