argous 1.2.192 → 1.2.194
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/actions/index.d.ts +0 -4
- package/dist/actions/index.js +1 -5
- package/dist/components/FilePreparer/FilePreparer.js +1 -1
- package/dist/reducers/argous.d.ts +0 -8
- package/dist/reducers/argous.js +1 -4
- package/dist/types.d.ts +2 -7
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.js +26 -15
- package/lib/actions/index.ts +0 -4
- package/lib/components/FilePreparer/FilePreparer.js +1 -1
- package/lib/reducers/argous.ts +1 -7
- package/lib/types.d.ts +2 -7
- package/lib/utils/index.ts +23 -20
- package/package.json +1 -1
package/dist/actions/index.d.ts
CHANGED
package/dist/actions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setVldPsw = exports.setMensagensNaoLidas = exports.setAddProgramWidget = exports.setRightSidebar = exports.setSidebar = exports.setNotificacao = exports.setBlockUser = exports.setFavorites = exports.setFields = exports.clearAllFields = exports.setCurrentField = exports.setCurrentProgram = exports.setInitialPage = exports.setProcesso = exports.setLoading = exports.setUsuarioLogado = void 0;
|
|
4
4
|
var setUsuarioLogado = function (usuarioLogado) {
|
|
5
5
|
return { type: 'setUsuarioLogado', usuarioLogado: usuarioLogado };
|
|
6
6
|
};
|
|
@@ -65,7 +65,3 @@ var setVldPsw = function (vldPsw) {
|
|
|
65
65
|
return { type: 'vldPsw', vldPsw: vldPsw };
|
|
66
66
|
};
|
|
67
67
|
exports.setVldPsw = setVldPsw;
|
|
68
|
-
var setVenturaUserPermissions = function (venturaUserPermissions) {
|
|
69
|
-
return { type: 'setVenturaUserPermissions', venturaUserPermissions: venturaUserPermissions };
|
|
70
|
-
};
|
|
71
|
-
exports.setVenturaUserPermissions = setVenturaUserPermissions;
|
|
@@ -235,7 +235,7 @@ var FilePreparer = function (_a, ref) {
|
|
|
235
235
|
// onChange && onChange(multiple ? files : files[0], motivo);
|
|
236
236
|
// setMotivo(undefined);
|
|
237
237
|
// }, [files]);
|
|
238
|
-
react_1.useImperativeHandle(ref, function () { return ({ preparaArquivo: preparaArquivo, loading: loading, setLoading: setLoading }); }, [preparaArquivo, loading]);
|
|
238
|
+
react_1.useImperativeHandle(ref, function () { return ({ preparaArquivo: preparaArquivo, loading: loading, setLoading: setLoading, setFiles: setFiles }); }, [preparaArquivo, loading]);
|
|
239
239
|
var _j = lab_1.useAutocomplete({
|
|
240
240
|
value: files,
|
|
241
241
|
inputValue: files.length ? '' : placeholder || 'Selecione um arquivo',
|
|
@@ -11,7 +11,6 @@ declare const argous: (state: {
|
|
|
11
11
|
sidebar: boolean;
|
|
12
12
|
rightSidebar: boolean;
|
|
13
13
|
addProgramWidget: undefined;
|
|
14
|
-
venturaUserPermissions: {};
|
|
15
14
|
} | undefined, action: ActionType) => {
|
|
16
15
|
processos: any;
|
|
17
16
|
usuarioLogado: {};
|
|
@@ -24,7 +23,6 @@ declare const argous: (state: {
|
|
|
24
23
|
sidebar: boolean;
|
|
25
24
|
rightSidebar: boolean;
|
|
26
25
|
addProgramWidget: undefined;
|
|
27
|
-
venturaUserPermissions: {};
|
|
28
26
|
} | {
|
|
29
27
|
notificacao: any;
|
|
30
28
|
usuarioLogado: {};
|
|
@@ -38,7 +36,6 @@ declare const argous: (state: {
|
|
|
38
36
|
sidebar: boolean;
|
|
39
37
|
rightSidebar: boolean;
|
|
40
38
|
addProgramWidget: undefined;
|
|
41
|
-
venturaUserPermissions: {};
|
|
42
39
|
} | {
|
|
43
40
|
currentProgram: string;
|
|
44
41
|
usuarioLogado: {};
|
|
@@ -52,7 +49,6 @@ declare const argous: (state: {
|
|
|
52
49
|
sidebar: boolean;
|
|
53
50
|
rightSidebar: boolean;
|
|
54
51
|
addProgramWidget: undefined;
|
|
55
|
-
venturaUserPermissions: {};
|
|
56
52
|
} | {
|
|
57
53
|
fields: any;
|
|
58
54
|
usuarioLogado: {};
|
|
@@ -65,7 +61,6 @@ declare const argous: (state: {
|
|
|
65
61
|
sidebar: boolean;
|
|
66
62
|
rightSidebar: boolean;
|
|
67
63
|
addProgramWidget: undefined;
|
|
68
|
-
venturaUserPermissions: {};
|
|
69
64
|
} | {
|
|
70
65
|
favorites: any[];
|
|
71
66
|
usuarioLogado: {};
|
|
@@ -78,7 +73,6 @@ declare const argous: (state: {
|
|
|
78
73
|
sidebar: boolean;
|
|
79
74
|
rightSidebar: boolean;
|
|
80
75
|
addProgramWidget: undefined;
|
|
81
|
-
venturaUserPermissions: {};
|
|
82
76
|
} | {
|
|
83
77
|
addProgramWidget: any;
|
|
84
78
|
usuarioLogado: {};
|
|
@@ -91,7 +85,6 @@ declare const argous: (state: {
|
|
|
91
85
|
vldPsw: boolean;
|
|
92
86
|
sidebar: boolean;
|
|
93
87
|
rightSidebar: boolean;
|
|
94
|
-
venturaUserPermissions: {};
|
|
95
88
|
} | {
|
|
96
89
|
mensagensNaoLidas: number;
|
|
97
90
|
usuarioLogado: {};
|
|
@@ -105,6 +98,5 @@ declare const argous: (state: {
|
|
|
105
98
|
sidebar: boolean;
|
|
106
99
|
rightSidebar: boolean;
|
|
107
100
|
addProgramWidget: undefined;
|
|
108
|
-
venturaUserPermissions: {};
|
|
109
101
|
};
|
|
110
102
|
export default argous;
|
package/dist/reducers/argous.js
CHANGED
|
@@ -24,8 +24,7 @@ var argous = function (state, action) {
|
|
|
24
24
|
vldPsw: false,
|
|
25
25
|
sidebar: true,
|
|
26
26
|
rightSidebar: false,
|
|
27
|
-
addProgramWidget: undefined
|
|
28
|
-
venturaUserPermissions: {}
|
|
27
|
+
addProgramWidget: undefined
|
|
29
28
|
}; }
|
|
30
29
|
switch (action.type) {
|
|
31
30
|
case 'setUsuarioLogado':
|
|
@@ -63,8 +62,6 @@ var argous = function (state, action) {
|
|
|
63
62
|
return __assign(__assign({}, state), { addProgramWidget: action.addProgramWidget });
|
|
64
63
|
case 'setMensagensNaoLidas':
|
|
65
64
|
return __assign(__assign({}, state), { mensagensNaoLidas: action.mensagensNaoLidas });
|
|
66
|
-
case 'setVenturaUserPermissions':
|
|
67
|
-
return __assign(__assign({}, state), { venturaUserPermissions: action.venturaUserPermissions });
|
|
68
65
|
default:
|
|
69
66
|
return state;
|
|
70
67
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -64,8 +64,7 @@ export interface ArgousType {
|
|
|
64
64
|
usuarioLogado: UsuarioLogado,
|
|
65
65
|
vldPsw: boolean,
|
|
66
66
|
rightSidebar: boolean,
|
|
67
|
-
addProgramWidget: any
|
|
68
|
-
venturaUserPermissions: object
|
|
67
|
+
addProgramWidget: any
|
|
69
68
|
}
|
|
70
69
|
export interface StoreState {
|
|
71
70
|
argous: ArgousType
|
|
@@ -154,9 +153,5 @@ interface setVldPsw {
|
|
|
154
153
|
vldPsw: boolean
|
|
155
154
|
}
|
|
156
155
|
|
|
157
|
-
interface setVenturaUserPermissions {
|
|
158
|
-
type: 'setVenturaUserPermissions',
|
|
159
|
-
venturaUserPermissions: object
|
|
160
|
-
}
|
|
161
156
|
|
|
162
|
-
export type ActionType = setUsuarioLogado|setLoading|setProcesso|setInitialPage|setCurrentProgram|setCurrentField|clearAllFields|setFields|setFavorites|setBlockUser|setNotificacao|setSidebar|setMensagensNaoLidas|setVldPsw|setRightSidebar|setAddProgramWidget
|
|
157
|
+
export type ActionType = setUsuarioLogado|setLoading|setProcesso|setInitialPage|setCurrentProgram|setCurrentField|clearAllFields|setFields|setFavorites|setBlockUser|setNotificacao|setSidebar|setMensagensNaoLidas|setVldPsw|setRightSidebar|setAddProgramWidget
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -62,3 +62,13 @@ export declare const currencyMask: (value: string | number) => string | undefine
|
|
|
62
62
|
export declare const toFloat: (value: string) => number | undefined;
|
|
63
63
|
export declare const copyToClipboard: (text: string) => void;
|
|
64
64
|
export declare const confirm: (props: BasicModalProps | string) => Promise<boolean>;
|
|
65
|
+
export declare const storageMeasures: {
|
|
66
|
+
byte: string;
|
|
67
|
+
kilobyte: string;
|
|
68
|
+
megabyte: string;
|
|
69
|
+
gigabyte: string;
|
|
70
|
+
terabyte: string;
|
|
71
|
+
petabyte: string;
|
|
72
|
+
exabyte: string;
|
|
73
|
+
};
|
|
74
|
+
export declare const bytesTranslator: (bytes?: number, decimals?: number, binary?: boolean) => object;
|
package/dist/utils/index.js
CHANGED
|
@@ -82,7 +82,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
82
82
|
return to;
|
|
83
83
|
};
|
|
84
84
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85
|
-
exports.confirm = exports.copyToClipboard = exports.toFloat = exports.currencyMask = exports.numbersOnly = exports.formataCpf = exports.useWebSocket = exports.formataTelefone = exports.reduxDispatch = exports.useStore = exports.useModal = exports.useGraph = exports.randomColor = exports.humanFileSize = exports.sanitizaHTML = exports.formataDinheiro = exports.useUpdateEffect = exports.usePrevious = exports.getNumeroFromInitials = exports.getInitials = exports.getRandomColor = exports.printPdf = exports.downloadFromUrl = exports.downloadBase64 = exports.formataNome = exports.addExtraZero = exports.getCookie = exports.widthToCenterVertically = void 0;
|
|
85
|
+
exports.bytesTranslator = exports.storageMeasures = exports.confirm = exports.copyToClipboard = exports.toFloat = exports.currencyMask = exports.numbersOnly = exports.formataCpf = exports.useWebSocket = exports.formataTelefone = exports.reduxDispatch = exports.useStore = exports.useModal = exports.useGraph = exports.randomColor = exports.humanFileSize = exports.sanitizaHTML = exports.formataDinheiro = exports.useUpdateEffect = exports.usePrevious = exports.getNumeroFromInitials = exports.getInitials = exports.getRandomColor = exports.printPdf = exports.downloadFromUrl = exports.downloadBase64 = exports.formataNome = exports.addExtraZero = exports.getCookie = exports.widthToCenterVertically = void 0;
|
|
86
86
|
var store_1 = require("./store");
|
|
87
87
|
var api_1 = require("../api");
|
|
88
88
|
var ModalProvider_1 = require("../components/ConfirmModal/ModalProvider");
|
|
@@ -94,11 +94,7 @@ var react_1 = require("react");
|
|
|
94
94
|
var widthToCenterVertically = function (content) {
|
|
95
95
|
var B = document.body;
|
|
96
96
|
var H = document.documentElement;
|
|
97
|
-
// if (typeof document.height !== 'undefined') {
|
|
98
|
-
// height = document.height;
|
|
99
|
-
// } else {
|
|
100
97
|
var height = Math.max(B.scrollHeight, B.offsetHeight, H.clientHeight, H.scrollHeight, H.offsetHeight);
|
|
101
|
-
// }
|
|
102
98
|
return (height - content) / 2;
|
|
103
99
|
};
|
|
104
100
|
exports.widthToCenterVertically = widthToCenterVertically;
|
|
@@ -117,11 +113,7 @@ var getCookie = function (cName) {
|
|
|
117
113
|
return '';
|
|
118
114
|
};
|
|
119
115
|
exports.getCookie = getCookie;
|
|
120
|
-
var addExtraZero = function (vl) {
|
|
121
|
-
return vl < 10
|
|
122
|
-
? "0" + (typeof vl === 'string' ? parseInt(vl) : vl)
|
|
123
|
-
: vl;
|
|
124
|
-
};
|
|
116
|
+
var addExtraZero = function (vl) { return (vl < 10) ? "0" + (typeof vl === 'string' ? parseInt(vl) : vl) : vl; };
|
|
125
117
|
exports.addExtraZero = addExtraZero;
|
|
126
118
|
var formataNome = function (value) {
|
|
127
119
|
if (value) {
|
|
@@ -326,11 +318,6 @@ var useModal = function () {
|
|
|
326
318
|
return createModal;
|
|
327
319
|
};
|
|
328
320
|
exports.useModal = useModal;
|
|
329
|
-
// Nao funciona... talvez com redux funcione, q nem a parte de erros
|
|
330
|
-
// export const confirm = ({ title = '', description = '' }) => {
|
|
331
|
-
// const { createModal } = useModal()
|
|
332
|
-
// return createModal(BasicModal)({ title, description })
|
|
333
|
-
// }
|
|
334
321
|
var useStore = function () {
|
|
335
322
|
return store_1.getStore().getState().argous || {};
|
|
336
323
|
};
|
|
@@ -406,3 +393,27 @@ var confirm = function (props) { return new Promise(function (resolve, reject) {
|
|
|
406
393
|
fieldsRedux_1.setAnotherProgramField('openModal', { value: Object.assign({ resolve: resolve, reject: reject, okLabel: 'Confirmar', cancelLabel: 'Cancelar', title: 'Confirmar?' }, typeof props === 'string' ? { description: props } : props) }, 'argousSystem');
|
|
407
394
|
}); };
|
|
408
395
|
exports.confirm = confirm;
|
|
396
|
+
exports.storageMeasures = {
|
|
397
|
+
byte: 'B',
|
|
398
|
+
kilobyte: 'KB',
|
|
399
|
+
megabyte: 'MB',
|
|
400
|
+
gigabyte: 'GB',
|
|
401
|
+
terabyte: 'TB',
|
|
402
|
+
petabyte: 'PB',
|
|
403
|
+
exabyte: 'EB'
|
|
404
|
+
};
|
|
405
|
+
var bytesTranslator = function (bytes, decimals, binary) {
|
|
406
|
+
if (bytes === void 0) { bytes = 0; }
|
|
407
|
+
if (decimals === void 0) { decimals = 2; }
|
|
408
|
+
if (binary === void 0) { binary = false; }
|
|
409
|
+
var measures = Object.values(exports.storageMeasures);
|
|
410
|
+
var divisor = ((binary) ? 1024 : 1000);
|
|
411
|
+
decimals = ((decimals < 0) ? 0 : decimals);
|
|
412
|
+
var index = Math.floor(Math.log(bytes) / Math.log(divisor));
|
|
413
|
+
if (index < 0)
|
|
414
|
+
index = 0;
|
|
415
|
+
var size = parseFloat((bytes / Math.pow(divisor, index)).toFixed(decimals));
|
|
416
|
+
var type = measures[index];
|
|
417
|
+
return { type: type, size: size };
|
|
418
|
+
};
|
|
419
|
+
exports.bytesTranslator = bytesTranslator;
|
package/lib/actions/index.ts
CHANGED
|
@@ -62,8 +62,4 @@ export const setMensagensNaoLidas = (mensagensNaoLidas: number) => {
|
|
|
62
62
|
|
|
63
63
|
export const setVldPsw = (vldPsw: boolean) => {
|
|
64
64
|
return { type: 'vldPsw', vldPsw };
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const setVenturaUserPermissions = (venturaUserPermissions: object) => {
|
|
68
|
-
return { type: 'setVenturaUserPermissions', venturaUserPermissions };
|
|
69
65
|
};
|
|
@@ -151,7 +151,7 @@ const FilePreparer = ({
|
|
|
151
151
|
// setMotivo(undefined);
|
|
152
152
|
// }, [files]);
|
|
153
153
|
|
|
154
|
-
useImperativeHandle(ref, () => ({ preparaArquivo, loading, setLoading }), [preparaArquivo, loading]);
|
|
154
|
+
useImperativeHandle(ref, () => ({ preparaArquivo, loading, setLoading, setFiles }), [preparaArquivo, loading]);
|
|
155
155
|
|
|
156
156
|
const {
|
|
157
157
|
getInputProps,
|
package/lib/reducers/argous.ts
CHANGED
|
@@ -11,8 +11,7 @@ const argous = (state = {
|
|
|
11
11
|
vldPsw: false,
|
|
12
12
|
sidebar: true,
|
|
13
13
|
rightSidebar: false,
|
|
14
|
-
addProgramWidget: undefined
|
|
15
|
-
venturaUserPermissions: {}
|
|
14
|
+
addProgramWidget: undefined
|
|
16
15
|
}, action: ActionType) => {
|
|
17
16
|
switch (action.type) {
|
|
18
17
|
case 'setUsuarioLogado':
|
|
@@ -108,11 +107,6 @@ const argous = (state = {
|
|
|
108
107
|
...state,
|
|
109
108
|
mensagensNaoLidas: action.mensagensNaoLidas
|
|
110
109
|
};
|
|
111
|
-
case 'setVenturaUserPermissions':
|
|
112
|
-
return {
|
|
113
|
-
...state,
|
|
114
|
-
venturaUserPermissions: action.venturaUserPermissions
|
|
115
|
-
};
|
|
116
110
|
default:
|
|
117
111
|
return state;
|
|
118
112
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -64,8 +64,7 @@ export interface ArgousType {
|
|
|
64
64
|
usuarioLogado: UsuarioLogado,
|
|
65
65
|
vldPsw: boolean,
|
|
66
66
|
rightSidebar: boolean,
|
|
67
|
-
addProgramWidget: any
|
|
68
|
-
venturaUserPermissions: object
|
|
67
|
+
addProgramWidget: any
|
|
69
68
|
}
|
|
70
69
|
export interface StoreState {
|
|
71
70
|
argous: ArgousType
|
|
@@ -154,9 +153,5 @@ interface setVldPsw {
|
|
|
154
153
|
vldPsw: boolean
|
|
155
154
|
}
|
|
156
155
|
|
|
157
|
-
interface setVenturaUserPermissions {
|
|
158
|
-
type: 'setVenturaUserPermissions',
|
|
159
|
-
venturaUserPermissions: object
|
|
160
|
-
}
|
|
161
156
|
|
|
162
|
-
export type ActionType = setUsuarioLogado|setLoading|setProcesso|setInitialPage|setCurrentProgram|setCurrentField|clearAllFields|setFields|setFavorites|setBlockUser|setNotificacao|setSidebar|setMensagensNaoLidas|setVldPsw|setRightSidebar|setAddProgramWidget
|
|
157
|
+
export type ActionType = setUsuarioLogado|setLoading|setProcesso|setInitialPage|setCurrentProgram|setCurrentField|clearAllFields|setFields|setFavorites|setBlockUser|setNotificacao|setSidebar|setMensagensNaoLidas|setVldPsw|setRightSidebar|setAddProgramWidget
|
package/lib/utils/index.ts
CHANGED
|
@@ -6,22 +6,14 @@ import { ActionType, ArgousType } from '../types';
|
|
|
6
6
|
import { useTheme } from '@material-ui/core';
|
|
7
7
|
import * as colors from '@material-ui/core/colors';
|
|
8
8
|
import { ChartOptions } from 'chart.js';
|
|
9
|
-
// import { BasicModal } from '../components';
|
|
10
9
|
import { BasicModalProps } from 'lib/components';
|
|
11
10
|
import { isNumber } from 'lodash';
|
|
12
11
|
import React, { useRef, useEffect, useContext, useState } from 'react';
|
|
13
12
|
|
|
14
13
|
export const widthToCenterVertically = (content:number) => {
|
|
15
|
-
|
|
16
14
|
const B = document.body;
|
|
17
15
|
const H = document.documentElement;
|
|
18
|
-
|
|
19
|
-
// if (typeof document.height !== 'undefined') {
|
|
20
|
-
// height = document.height;
|
|
21
|
-
// } else {
|
|
22
16
|
const height = Math.max(B.scrollHeight, B.offsetHeight, H.clientHeight, H.scrollHeight, H.offsetHeight);
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
17
|
return (height - content) / 2;
|
|
26
18
|
};
|
|
27
19
|
|
|
@@ -40,11 +32,7 @@ export const getCookie = (cName: string) => {
|
|
|
40
32
|
return '';
|
|
41
33
|
};
|
|
42
34
|
|
|
43
|
-
export const addExtraZero = (vl:number|string) => {
|
|
44
|
-
return vl < 10
|
|
45
|
-
? `0${typeof vl === 'string' ? parseInt(vl) : vl}`
|
|
46
|
-
: vl;
|
|
47
|
-
};
|
|
35
|
+
export const addExtraZero = (vl: number|string) => (vl < 10) ? `0${typeof vl === 'string' ? parseInt(vl) : vl}` : vl;
|
|
48
36
|
|
|
49
37
|
export const formataNome = (value:string) => {
|
|
50
38
|
if (value) {
|
|
@@ -260,12 +248,6 @@ export const useModal = () => {
|
|
|
260
248
|
return createModal;
|
|
261
249
|
};
|
|
262
250
|
|
|
263
|
-
// Nao funciona... talvez com redux funcione, q nem a parte de erros
|
|
264
|
-
// export const confirm = ({ title = '', description = '' }) => {
|
|
265
|
-
// const { createModal } = useModal()
|
|
266
|
-
// return createModal(BasicModal)({ title, description })
|
|
267
|
-
// }
|
|
268
|
-
|
|
269
251
|
export const useStore = (): ArgousType => {
|
|
270
252
|
return getStore().getState().argous || {};
|
|
271
253
|
};
|
|
@@ -332,4 +314,25 @@ export const copyToClipboard = (text: string) => {
|
|
|
332
314
|
|
|
333
315
|
export const confirm = (props: BasicModalProps | string) => new Promise<boolean>((resolve, reject) => {
|
|
334
316
|
setAnotherProgramField('openModal', { value: Object.assign({ resolve, reject, okLabel: 'Confirmar', cancelLabel: 'Cancelar', title: 'Confirmar?' }, typeof props === 'string' ? { description: props } : props) }, 'argousSystem');
|
|
335
|
-
});
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
export const storageMeasures = {
|
|
320
|
+
byte: 'B',
|
|
321
|
+
kilobyte: 'KB',
|
|
322
|
+
megabyte: 'MB',
|
|
323
|
+
gigabyte: 'GB',
|
|
324
|
+
terabyte: 'TB',
|
|
325
|
+
petabyte: 'PB',
|
|
326
|
+
exabyte: 'EB'
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export const bytesTranslator = (bytes: number = 0, decimals: number = 2, binary: boolean = false): object => {
|
|
330
|
+
const measures = Object.values(storageMeasures);
|
|
331
|
+
const divisor = ((binary) ? 1024 : 1000);
|
|
332
|
+
decimals = ((decimals < 0) ? 0 : decimals);
|
|
333
|
+
let index = Math.floor(Math.log(bytes) / Math.log(divisor));
|
|
334
|
+
if (index < 0) index = 0;
|
|
335
|
+
const size = parseFloat((bytes / Math.pow(divisor, index)).toFixed(decimals));
|
|
336
|
+
const type = measures[index];
|
|
337
|
+
return { type, size };
|
|
338
|
+
};
|