@autofleet/sheilta 1.4.0-beta.4 → 1.4.0
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.
- package/lib/utils.js +2 -2
- package/package.json +2 -2
package/lib/utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateRandomString = exports.extractAssociatedAttributeNameFromOrder = exports.throwBadRequestError = exports.isOrderDesc = exports.extractAttributeNameFromOrder = exports.isAttributeByAssociation = exports.wrapAttributeWithOperator = exports.PAGE_MIN = exports.PER_PAGE_MIN_LIMIT = exports.PER_PAGE_MAX_LIMIT = exports.PAGE_DEFAULT = exports.PER_PAGE_DEFAULT = exports.ASSOCIATION_PREFIX = exports.ORDER_PREFIX = void 0;
|
|
4
|
-
const node_crypto_1 = require("node:crypto");
|
|
5
4
|
const errors_1 = require("@autofleet/errors");
|
|
6
5
|
const operators_1 = require("./operators");
|
|
6
|
+
const randomInt = max => Math.floor(Math.random() * Math.floor(max));
|
|
7
7
|
exports.ORDER_PREFIX = '-';
|
|
8
8
|
exports.ASSOCIATION_PREFIX = '.';
|
|
9
9
|
exports.PER_PAGE_DEFAULT = 20;
|
|
@@ -32,5 +32,5 @@ exports.throwBadRequestError = (message) => {
|
|
|
32
32
|
exports.extractAssociatedAttributeNameFromOrder = (order) => order.split(exports.ASSOCIATION_PREFIX)[1];
|
|
33
33
|
exports.generateRandomString = (length = 5) => {
|
|
34
34
|
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
35
|
-
return Array.from({ length }, () => characters.charAt(
|
|
35
|
+
return Array.from({ length }, () => characters.charAt(randomInt(characters.length))).join('');
|
|
36
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/sheilta",
|
|
3
|
-
"version": "1.4.0
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "manage cache",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "jest --forceExit --runInBand",
|
|
12
12
|
"test-auto": "jest --watch --runInBand",
|
|
13
13
|
"linter": "./node_modules/.bin/eslint src/**/*.ts",
|
|
14
|
-
"build-to-local-repo": "npm run build && cp -r lib/*
|
|
14
|
+
"build-to-local-repo": "npm run build && cp -r lib/* ../$REPO/node_modules/$npm_package_name/lib",
|
|
15
15
|
"watch": "npm-watch build-to-local-repo"
|
|
16
16
|
},
|
|
17
17
|
"watch": {
|