@scaleflex/widget-utils 4.0.6 → 4.1.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/CHANGELOG.md +7252 -7227
- package/LICENSE +21 -21
- package/README.md +58 -58
- package/lib/AbortController.js +2 -2
- package/lib/BlurHash/decode.js +4 -4
- package/lib/CustomDate.js +27 -27
- package/lib/EventTracker.js +3 -3
- package/lib/LinkHelper.js +26 -26
- package/lib/ProgressTimeout.js +5 -5
- package/lib/RateLimitedQueue.js +2 -2
- package/lib/TranslationMissingKeysConsoleHelper.js +13 -13
- package/lib/Translator.js +39 -39
- package/lib/addUrlParams.js +6 -6
- package/lib/adjustUpdatedFolders.js +7 -7
- package/lib/canvasToBlob.js +5 -5
- package/lib/checkItemsSupportExportWithReason.js +5 -5
- package/lib/checkPermissions.js +6 -6
- package/lib/clsx.js +3 -3
- package/lib/convertVideoFileTypeToSupported.js +9 -9
- package/lib/copyText.js +10 -10
- package/lib/createThunk.js +21 -21
- package/lib/customEncodeURIComponent.js +21 -21
- package/lib/fetchWithNetworkError.js +2 -2
- package/lib/findAllDOMElements.js +5 -5
- package/lib/findDOMElement.js +5 -5
- package/lib/findIndex.js +2 -2
- package/lib/formatDuration.js +8 -8
- package/lib/formatResolution.js +9 -9
- package/lib/formatSeconds.js +6 -6
- package/lib/generateFileId.js +12 -12
- package/lib/generateSelectInputPlaceholder.js +6 -6
- package/lib/getCloudimagePrefixedUrl.js +6 -6
- package/lib/getDateDaysFromNow.js +5 -5
- package/lib/getDateString.js +2 -2
- package/lib/getDroppedFiles/index.js +8 -8
- package/lib/getDroppedFiles/utils/webkitGetAsEntryApi/getFilesAndDirectoriesFromDirectory.js +7 -7
- package/lib/getDroppedFiles/utils/webkitGetAsEntryApi/getRelativePath.js +6 -6
- package/lib/getDroppedFiles/utils/webkitGetAsEntryApi/index.js +5 -5
- package/lib/getFileNameAndExtension.js +5 -5
- package/lib/getFormattedPreviewUrl.js +18 -18
- package/lib/getHoursAndMinutes.js +4 -4
- package/lib/getMetadataMultiSelectQuery.js +6 -6
- package/lib/getNormalizedItems.js +15 -15
- package/lib/getRandomNumber.js +5 -5
- package/lib/getTime.js +2 -2
- package/lib/getTimeStamp.js +4 -4
- package/lib/handlePromise.js +8 -8
- package/lib/humanReadableDate.js +4 -4
- package/lib/humanReadableDateWithTranslations.js +2 -2
- package/lib/injectVirtualPathToFolders.js +5 -5
- package/lib/isDOMElement.js +4 -4
- package/lib/isDragDropSupported.js +4 -4
- package/lib/isFileSupportedByCloudimage.js +5 -5
- package/lib/isMobileDevice.js +5 -5
- package/lib/isObjectURL.js +5 -5
- package/lib/metadata/checkFieldValidation.js +9 -9
- package/lib/metadata/generateItemMetadataState.js +8 -8
- package/lib/metadata/generateMetadataDefaultState.js +4 -4
- package/lib/metadata/updateValidationErrors.js +8 -8
- package/lib/nanoid.js +4 -4
- package/lib/recursiveFnCall.js +2 -2
- package/lib/removeDuplicatesFromArray.js +9 -9
- package/lib/toArray.js +2 -2
- package/package.json +3 -3
- package/types/index.d.ts +279 -279
|
@@ -4,12 +4,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
/**
|
|
8
|
-
* Retrieves the value of a nested property from an object using a string key.
|
|
9
|
-
*
|
|
10
|
-
* @param {string} key - The string key representing the nested property.
|
|
11
|
-
* @param {object} item - The object from which to retrieve the nested property.
|
|
12
|
-
* @return {*} - The value of the nested property.
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves the value of a nested property from an object using a string key.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} key - The string key representing the nested property.
|
|
11
|
+
* @param {object} item - The object from which to retrieve the nested property.
|
|
12
|
+
* @return {*} - The value of the nested property.
|
|
13
13
|
*/
|
|
14
14
|
export var getItemKey = function getItemKey(key, item) {
|
|
15
15
|
if (key.includes('.')) {
|
|
@@ -22,15 +22,15 @@ export var getItemKey = function getItemKey(key, item) {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Generates a normalized version of the given items array.
|
|
27
|
-
*
|
|
28
|
-
* @param {Array} items - The array of items to be normalized.
|
|
29
|
-
* @param {Object} options - options for the function, consists of the following.
|
|
30
|
-
* @param {Object} extraProps - (optional) Additional properties to add to each normalized item.
|
|
31
|
-
* @param {string} key - (optional) The key to use as the unique identifier for each item.
|
|
32
|
-
* @param {string} returnedKey - (optional) the key used in the function's returned's object.
|
|
33
|
-
* @return {Object} An object containing the normalized slices and an array of UUIDs.
|
|
25
|
+
/**
|
|
26
|
+
* Generates a normalized version of the given items array.
|
|
27
|
+
*
|
|
28
|
+
* @param {Array} items - The array of items to be normalized.
|
|
29
|
+
* @param {Object} options - options for the function, consists of the following.
|
|
30
|
+
* @param {Object} extraProps - (optional) Additional properties to add to each normalized item.
|
|
31
|
+
* @param {string} key - (optional) The key to use as the unique identifier for each item.
|
|
32
|
+
* @param {string} returnedKey - (optional) the key used in the function's returned's object.
|
|
33
|
+
* @return {Object} An object containing the normalized slices and an array of UUIDs.
|
|
34
34
|
*/
|
|
35
35
|
var getNormalizedItems = function getNormalizedItems(items, options) {
|
|
36
36
|
var _ref = options || {},
|
package/lib/getRandomNumber.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @returns {number} -- random number between min and max
|
|
3
|
-
*
|
|
4
|
-
* @param {number} min -- minimum number
|
|
5
|
-
* @param {number} max -- maximum number
|
|
1
|
+
/**
|
|
2
|
+
* @returns {number} -- random number between min and max
|
|
3
|
+
*
|
|
4
|
+
* @param {number} min -- minimum number
|
|
5
|
+
* @param {number} max -- maximum number
|
|
6
6
|
*/
|
|
7
7
|
var getRandomNumber = function getRandomNumber(min, max) {
|
|
8
8
|
min = Math.ceil(min);
|
package/lib/getTime.js
CHANGED
package/lib/getTimeStamp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a timestamp in the format of `hours:minutes:seconds`
|
|
1
|
+
/**
|
|
2
|
+
* Returns a timestamp in the format of `hours:minutes:seconds`
|
|
3
3
|
*/
|
|
4
4
|
export default function getTimeStamp() {
|
|
5
5
|
var noSeconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
@@ -10,8 +10,8 @@ export default function getTimeStamp() {
|
|
|
10
10
|
return hours + ':' + minutes + (noSeconds ? ':' + seconds : '');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* Adds zero to strings shorter than two characters
|
|
13
|
+
/**
|
|
14
|
+
* Adds zero to strings shorter than two characters
|
|
15
15
|
*/
|
|
16
16
|
function pad(str) {
|
|
17
17
|
return str.length !== 2 ? 0 + str : str;
|
package/lib/handlePromise.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import isPromise from './isPromise';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Wraps the promise passed with try/catch block and fires the callback provided depending on success/failture.
|
|
6
|
-
*
|
|
7
|
-
* @param (promise: promise) - promise to be processed
|
|
8
|
-
* @param (successCallback: function) - callback function to be implemented incase of success
|
|
9
|
-
* @param (errorCallback: function) - callback function to be implemented incase of error caught
|
|
10
|
-
- assuming default clbk function would be info(error: error instance, type: error, timeout: 5000)
|
|
11
|
-
* @param (finishCallback: function) - callback function to be implemented after finishing in both cases success/fail.
|
|
4
|
+
/**
|
|
5
|
+
* Wraps the promise passed with try/catch block and fires the callback provided depending on success/failture.
|
|
6
|
+
*
|
|
7
|
+
* @param (promise: promise) - promise to be processed
|
|
8
|
+
* @param (successCallback: function) - callback function to be implemented incase of success
|
|
9
|
+
* @param (errorCallback: function) - callback function to be implemented incase of error caught
|
|
10
|
+
- assuming default clbk function would be info(error: error instance, type: error, timeout: 5000)
|
|
11
|
+
* @param (finishCallback: function) - callback function to be implemented after finishing in both cases success/fail.
|
|
12
12
|
*/
|
|
13
13
|
var handlePromise = function handlePromise(promise) {
|
|
14
14
|
var successCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
|
package/lib/humanReadableDate.js
CHANGED
|
@@ -4,10 +4,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
/**
|
|
8
|
-
* @param {Date} date
|
|
9
|
-
* @param {object} [translations] - Object with translations. Notice: it's used for Hub.
|
|
10
|
-
* @returns {string} - For example: "18 hours ago"
|
|
7
|
+
/**
|
|
8
|
+
* @param {Date} date
|
|
9
|
+
* @param {object} [translations] - Object with translations. Notice: it's used for Hub.
|
|
10
|
+
* @returns {string} - For example: "18 hours ago"
|
|
11
11
|
*/
|
|
12
12
|
var humanReadableDate = function humanReadableDate(date, translationsList) {
|
|
13
13
|
var translations = _objectSpread({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import capitalizeFirstLetter from './capitalizeFirstLetter';
|
|
2
2
|
import humanReadableDate from './humanReadableDate';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Wrapper over function humanReadableDate but with translations
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper over function humanReadableDate but with translations
|
|
6
6
|
*/
|
|
7
7
|
var humanReadableDateWithTranslations = function humanReadableDateWithTranslations(date, i18n) {
|
|
8
8
|
var t = function t(str) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import createFoldervirtualPath from './createFolderVirtualPath';
|
|
2
2
|
import removeEmptyFolders from './removeEmptyFolders';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Util used to add vitual pathes to folders
|
|
6
|
-
* @property { _folders } array
|
|
7
|
-
* @property { parentPath } string
|
|
8
|
-
* @returns { folderWithPath }
|
|
4
|
+
/**
|
|
5
|
+
* Util used to add vitual pathes to folders
|
|
6
|
+
* @property { _folders } array
|
|
7
|
+
* @property { parentPath } string
|
|
8
|
+
* @returns { folderWithPath }
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var _injectVirtualPathToFolders = function injectVirtualPathToFolders() {
|
package/lib/isDOMElement.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
/**
|
|
3
|
-
* Check if an object is a DOM element. Duck-typing based on `nodeType`.
|
|
4
|
-
*
|
|
5
|
-
* @param {*} obj
|
|
2
|
+
/**
|
|
3
|
+
* Check if an object is a DOM element. Duck-typing based on `nodeType`.
|
|
4
|
+
*
|
|
5
|
+
* @param {*} obj
|
|
6
6
|
*/
|
|
7
7
|
export default function isDOMElement(obj) {
|
|
8
8
|
return obj && _typeof(obj) === 'object' && obj.nodeType === Node.ELEMENT_NODE;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the browser supports Drag & Drop (not supported on mobile devices, for example).
|
|
3
|
-
* @property {HTMLElement} htmlElement
|
|
4
|
-
* @returns {boolean}
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the browser supports Drag & Drop (not supported on mobile devices, for example).
|
|
3
|
+
* @property {HTMLElement} htmlElement
|
|
4
|
+
* @returns {boolean}
|
|
5
5
|
*/
|
|
6
6
|
export default function isDragDropSupported(htmlElement) {
|
|
7
7
|
var element = htmlElement || document.createElement('div');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import cloudimageSupportedInputMimiTypes from './cloudimageSupportedInputMimeTypes';
|
|
2
2
|
import getFileType from './getFileType';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Check if the selected item type is supported input for cloudimage
|
|
6
|
-
*
|
|
7
|
-
* @param {object} item
|
|
8
|
-
* @returns {Boolean}
|
|
4
|
+
/**
|
|
5
|
+
* Check if the selected item type is supported input for cloudimage
|
|
6
|
+
*
|
|
7
|
+
* @param {object} item
|
|
8
|
+
* @returns {Boolean}
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var isFileSupportedByCloudimage = function isFileSupportedByCloudimage(file) {
|
package/lib/isMobileDevice.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if current device reports itself as “mobile”.
|
|
3
|
-
* Very simple, not very reliable.
|
|
4
|
-
*
|
|
5
|
-
* @returns {boolean}
|
|
1
|
+
/**
|
|
2
|
+
* Checks if current device reports itself as “mobile”.
|
|
3
|
+
* Very simple, not very reliable.
|
|
4
|
+
*
|
|
5
|
+
* @returns {boolean}
|
|
6
6
|
*/
|
|
7
7
|
export default function isMobileDevice() {
|
|
8
8
|
if (typeof window !== 'undefined' && window.navigator && window.navigator.userAgent && window.navigator.userAgent.match(/Mobi/)) {
|
package/lib/isObjectURL.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if a URL string is an object URL from `URL.createObjectURL`.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} url
|
|
5
|
-
* @returns {boolean}
|
|
1
|
+
/**
|
|
2
|
+
* Check if a URL string is an object URL from `URL.createObjectURL`.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} url
|
|
5
|
+
* @returns {boolean}
|
|
6
6
|
*/
|
|
7
7
|
export default function isObjectURL() {
|
|
8
8
|
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import getGeoPointValidationErrors from './getGeoPointValidationErrors';
|
|
2
2
|
import isValidUri from '../isValidUri';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Check is metadata field value valid
|
|
6
|
-
* @param {(string|number|array)} value
|
|
7
|
-
* @param {string} [fieldValidation]
|
|
8
|
-
* @param {boolean} [required]
|
|
9
|
-
* @returns {(boolean|string)} - If TRUE field is valid, if FALSE or message field is not valid.
|
|
10
|
-
* @param {boolean} [canEdit=true]
|
|
4
|
+
/**
|
|
5
|
+
* Check is metadata field value valid
|
|
6
|
+
* @param {(string|number|array)} value
|
|
7
|
+
* @param {string} [fieldValidation]
|
|
8
|
+
* @param {boolean} [required]
|
|
9
|
+
* @returns {(boolean|string)} - If TRUE field is valid, if FALSE or message field is not valid.
|
|
10
|
+
* @param {boolean} [canEdit=true]
|
|
11
11
|
*/
|
|
12
12
|
function checkFieldValidation(_ref) {
|
|
13
13
|
var fieldValue = _ref.fieldValue,
|
|
@@ -21,8 +21,8 @@ function checkFieldValidation(_ref) {
|
|
|
21
21
|
return typeof i18n === 'function' ? i18n('mutualizedFieldRequired') : 'Field is required!';
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* When field is required but current user can't edit the field, we have to set that current value is valid to unlock other fields save.
|
|
24
|
+
/**
|
|
25
|
+
* When field is required but current user can't edit the field, we have to set that current value is valid to unlock other fields save.
|
|
26
26
|
*/
|
|
27
27
|
if (isFieldRequired && !editable) {
|
|
28
28
|
return true;
|
|
@@ -6,19 +6,19 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import generateMetadataDefaultState from '@scaleflex/widget-utils/lib/metadata/generateMetadataDefaultState';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @param {object[]} metaDataGroups
|
|
11
|
-
* @param {object} item - File or folder
|
|
12
|
-
* @param {object[]} metaRegionalGroups
|
|
13
|
-
* @returns {object} - Item metadata state
|
|
9
|
+
/**
|
|
10
|
+
* @param {object[]} metaDataGroups
|
|
11
|
+
* @param {object} item - File or folder
|
|
12
|
+
* @param {object[]} metaRegionalGroups
|
|
13
|
+
* @returns {object} - Item metadata state
|
|
14
14
|
*/
|
|
15
15
|
export function generateItemMetadataState(metaDataGroups, item, metaRegionalGroups) {
|
|
16
16
|
var defaultState = generateMetadataDefaultState(metaDataGroups, metaRegionalGroups);
|
|
17
17
|
var itemMetadataState = _objectSpread(_objectSpread({}, defaultState), JSON.parse(JSON.stringify(item.meta || {})));
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Sometimes we have cases when field had simple value like string (ex: {title: "My title"}) and then
|
|
21
|
-
* field config was changed and now we have regional_variants. Now {title: {en: "Eng title", fr: "title"}}
|
|
19
|
+
/**
|
|
20
|
+
* Sometimes we have cases when field had simple value like string (ex: {title: "My title"}) and then
|
|
21
|
+
* field config was changed and now we have regional_variants. Now {title: {en: "Eng title", fr: "title"}}
|
|
22
22
|
*/
|
|
23
23
|
(metaDataGroups || []).forEach(function (group) {
|
|
24
24
|
((group || {}).fields || []).forEach(function (field) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {{fields: object}[]} metabaseGroups
|
|
3
|
-
* @param {object[]} metaRegionalGroups
|
|
4
|
-
* @returns {object}
|
|
1
|
+
/**
|
|
2
|
+
* @param {{fields: object}[]} metabaseGroups
|
|
3
|
+
* @param {object[]} metaRegionalGroups
|
|
4
|
+
* @returns {object}
|
|
5
5
|
*/
|
|
6
6
|
function generateMetadataDefaultState(metabaseGroups, metaRegionalGroups) {
|
|
7
7
|
var defaultMetadata = {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import checkFieldValidation from './checkFieldValidation';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @param {object} errors
|
|
5
|
-
* @param {string} key
|
|
6
|
-
* @param {string} [regionalVariantFieldKey]
|
|
7
|
-
* @param {any} fieldValue
|
|
8
|
-
* @param {regexp} [fieldValidation]
|
|
9
|
-
* @param {boolean} [isFieldRequired]
|
|
10
|
-
* @param {(boolean|string[])} [canEdit=true]
|
|
3
|
+
/**
|
|
4
|
+
* @param {object} errors
|
|
5
|
+
* @param {string} key
|
|
6
|
+
* @param {string} [regionalVariantFieldKey]
|
|
7
|
+
* @param {any} fieldValue
|
|
8
|
+
* @param {regexp} [fieldValidation]
|
|
9
|
+
* @param {boolean} [isFieldRequired]
|
|
10
|
+
* @param {(boolean|string[])} [canEdit=true]
|
|
11
11
|
*/
|
|
12
12
|
function updateValidationErrors(_ref) {
|
|
13
13
|
var errors = _ref.errors,
|
package/lib/nanoid.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* Borrowed from https://github.com/ai/nanoid/blob/3.0.2/non-secure/index.js
|
|
2
|
-
* & https://github.com/reduxjs/redux-toolkit/blob/master/packages/toolkit/src/nanoid.ts
|
|
3
|
-
* This alphabet uses `A-Za-z0-9_-` symbols. A genetic algorithm helped
|
|
4
|
-
* optimize the gzip compression for this alphabet.
|
|
1
|
+
/* Borrowed from https://github.com/ai/nanoid/blob/3.0.2/non-secure/index.js
|
|
2
|
+
* & https://github.com/reduxjs/redux-toolkit/blob/master/packages/toolkit/src/nanoid.ts
|
|
3
|
+
* This alphabet uses `A-Za-z0-9_-` symbols. A genetic algorithm helped
|
|
4
|
+
* optimize the gzip compression for this alphabet.
|
|
5
5
|
*/
|
|
6
6
|
var urlAlphabet = 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW';
|
|
7
7
|
var nanoid = function nanoid() {
|
package/lib/recursiveFnCall.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Run fn recursively with intervals until fn is defined.
|
|
1
|
+
/**
|
|
2
|
+
* Run fn recursively with intervals until fn is defined.
|
|
3
3
|
*/
|
|
4
4
|
var recursiveFnCall = function recursiveFnCall() {
|
|
5
5
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Removes duplicate objects from an array based on a specified unique property.
|
|
3
|
-
*
|
|
4
|
-
* This function iterates through the array and uses a Set to keep track of the unique values
|
|
5
|
-
* of the specified property. If a duplicate value is found, the object is filtered out.
|
|
6
|
-
*
|
|
7
|
-
* @param {Array<Object>} array - The array of objects to be filtered.
|
|
8
|
-
* @param {string} uniqueProperty - The property name to check for uniqueness.
|
|
9
|
-
* @returns {Array<Object>} A new array with duplicate objects removed.
|
|
1
|
+
/**
|
|
2
|
+
* Removes duplicate objects from an array based on a specified unique property.
|
|
3
|
+
*
|
|
4
|
+
* This function iterates through the array and uses a Set to keep track of the unique values
|
|
5
|
+
* of the specified property. If a duplicate value is found, the object is filtered out.
|
|
6
|
+
*
|
|
7
|
+
* @param {Array<Object>} array - The array of objects to be filtered.
|
|
8
|
+
* @param {string} uniqueProperty - The property name to check for uniqueness.
|
|
9
|
+
* @returns {Array<Object>} A new array with duplicate objects removed.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
var removeDuplicatesFromArray = function removeDuplicatesFromArray(array, uniqueProperty) {
|
package/lib/toArray.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Shared utility functions for filerobot modules",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
|
-
"version": "4.0
|
|
6
|
+
"version": "4.1.0",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist",
|
|
9
9
|
"/lib",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@scaleflex/icons": "^3.0.0-beta.11",
|
|
18
18
|
"@scaleflex/ui": "^3.0.0-beta.11",
|
|
19
|
-
"@scaleflex/widget-icons": "^4.0
|
|
19
|
+
"@scaleflex/widget-icons": "^4.1.0",
|
|
20
20
|
"abortcontroller-polyfill": "^1.4.0",
|
|
21
21
|
"dompurify": "^3.1.6",
|
|
22
22
|
"lodash.throttle": "^4.1.1"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "471120d67066617a0d8824eae11b07d1f2259473"
|
|
25
25
|
}
|