@hapl/api-queries 1.0.21 → 1.0.22
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/dist/api-queries.cjs.development.js +86 -3
- package/dist/api-queries.cjs.development.js.map +1 -1
- package/dist/api-queries.cjs.production.min.js +1 -1
- package/dist/api-queries.cjs.production.min.js.map +1 -1
- package/dist/api-queries.esm.js +86 -3
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/utils.d.ts +62 -0
- package/package.json +1 -3
- package/src/clients/v1/api/file/uploadFile.ts +1 -2
- package/src/clients/v1/api/file/uploadFiles.ts +1 -1
- package/src/publisher/api/uploadResume.ts +1 -1
- package/src/search/api/buildings/findBuildingCoordinates.ts +1 -1
- package/src/search/api/buildings/findBuildingOffers.ts +1 -1
- package/src/utils.ts +87 -0
|
@@ -7,9 +7,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var axios = _interopDefault(require('axios'));
|
|
8
8
|
var qs = _interopDefault(require('qs'));
|
|
9
9
|
var nonSecure = require('nanoid/non-secure');
|
|
10
|
-
var isNil = _interopDefault(require('lodash/isNil'));
|
|
11
|
-
var isString = _interopDefault(require('lodash/isString'));
|
|
12
|
-
var chunk = _interopDefault(require('lodash/chunk'));
|
|
13
10
|
|
|
14
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
15
12
|
try {
|
|
@@ -4083,6 +4080,92 @@ function findExpertGradesByExpertIdRequest(_ref) {
|
|
|
4083
4080
|
});
|
|
4084
4081
|
}
|
|
4085
4082
|
|
|
4083
|
+
/* Код взят c https://github.com/toss/es-toolkit */
|
|
4084
|
+
|
|
4085
|
+
/**
|
|
4086
|
+
* Splits an array into smaller arrays of a specified length.
|
|
4087
|
+
*
|
|
4088
|
+
* This function takes an input array and divides it into multiple smaller arrays,
|
|
4089
|
+
* each of a specified length. If the input array cannot be evenly divided,
|
|
4090
|
+
* the final sub-array will contain the remaining elements.
|
|
4091
|
+
*
|
|
4092
|
+
* @template T The type of elements in the array.
|
|
4093
|
+
* @param {T[]} arr - The array to be chunked into smaller arrays.
|
|
4094
|
+
* @param {number} size - The size of each smaller array. Must be a positive integer.
|
|
4095
|
+
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
|
|
4096
|
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
|
4097
|
+
*
|
|
4098
|
+
* @example
|
|
4099
|
+
* // Splits an array of numbers into sub-arrays of length 2
|
|
4100
|
+
* chunk([1, 2, 3, 4, 5], 2);
|
|
4101
|
+
* // Returns: [[1, 2], [3, 4], [5]]
|
|
4102
|
+
*
|
|
4103
|
+
* @example
|
|
4104
|
+
* // Splits an array of strings into sub-arrays of length 3
|
|
4105
|
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
|
4106
|
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
|
4107
|
+
*/
|
|
4108
|
+
function chunk(arr, size) {
|
|
4109
|
+
if (!Number.isInteger(size) || size <= 0) {
|
|
4110
|
+
throw new Error('Size must be an integer greater than zero.');
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
var chunkLength = Math.ceil(arr.length / size);
|
|
4114
|
+
var result = Array(chunkLength);
|
|
4115
|
+
|
|
4116
|
+
for (var index = 0; index < chunkLength; index++) {
|
|
4117
|
+
var start = index * size;
|
|
4118
|
+
var end = start + size;
|
|
4119
|
+
result[index] = arr.slice(start, end);
|
|
4120
|
+
}
|
|
4121
|
+
|
|
4122
|
+
return result;
|
|
4123
|
+
}
|
|
4124
|
+
/**
|
|
4125
|
+
* Checks if a given value is null or undefined.
|
|
4126
|
+
*
|
|
4127
|
+
* This function tests whether the provided value is either `null` or `undefined`.
|
|
4128
|
+
* It returns `true` if the value is `null` or `undefined`, and `false` otherwise.
|
|
4129
|
+
*
|
|
4130
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.
|
|
4131
|
+
*
|
|
4132
|
+
* @param {unknown} x - The value to test for null or undefined.
|
|
4133
|
+
* @returns {boolean} `true` if the value is null or undefined, `false` otherwise.
|
|
4134
|
+
*
|
|
4135
|
+
* @example
|
|
4136
|
+
* const value1 = null;
|
|
4137
|
+
* const value2 = undefined;
|
|
4138
|
+
* const value3 = 42;
|
|
4139
|
+
* const result1 = isNil(value1); // true
|
|
4140
|
+
* const result2 = isNil(value2); // true
|
|
4141
|
+
* const result3 = isNil(value3); // false
|
|
4142
|
+
*/
|
|
4143
|
+
|
|
4144
|
+
function isNil(x) {
|
|
4145
|
+
return x == null;
|
|
4146
|
+
}
|
|
4147
|
+
/**
|
|
4148
|
+
* Checks if a given value is string.
|
|
4149
|
+
*
|
|
4150
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `string`.
|
|
4151
|
+
*
|
|
4152
|
+
* @param {unknown} value The value to check if it is string.
|
|
4153
|
+
* @returns {value is string} Returns `true` if `value` is a string, else `false`.
|
|
4154
|
+
*
|
|
4155
|
+
* @example
|
|
4156
|
+
* const value1 = 'abc';
|
|
4157
|
+
* const value2 = 123;
|
|
4158
|
+
* const value3 = true;
|
|
4159
|
+
*
|
|
4160
|
+
* console.log(isString(value1)); // true
|
|
4161
|
+
* console.log(isString(value2)); // false
|
|
4162
|
+
* console.log(isString(value3)); // false
|
|
4163
|
+
*/
|
|
4164
|
+
|
|
4165
|
+
function isString(value) {
|
|
4166
|
+
return typeof value === 'string';
|
|
4167
|
+
}
|
|
4168
|
+
|
|
4086
4169
|
function uploadFileRequest(_ref) {
|
|
4087
4170
|
var _ref$baseURL = _ref.baseURL,
|
|
4088
4171
|
baseURL = _ref$baseURL === void 0 ? DEFAULT_BASE_URL : _ref$baseURL,
|