@datapos/datapos-shared 0.3.303 → 0.3.304
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.
|
@@ -97,7 +97,8 @@ function k(e) {
|
|
|
97
97
|
}
|
|
98
98
|
return t;
|
|
99
99
|
}
|
|
100
|
-
const f = "en-US", c = {}
|
|
100
|
+
const f = "en-US", c = {};
|
|
101
|
+
function B(e) {
|
|
101
102
|
switch (e) {
|
|
102
103
|
case "Edm.Binary":
|
|
103
104
|
return "unknown";
|
|
@@ -136,17 +137,20 @@ const f = "en-US", c = {}, B = (e) => {
|
|
|
136
137
|
default:
|
|
137
138
|
return "unknown";
|
|
138
139
|
}
|
|
139
|
-
}
|
|
140
|
+
}
|
|
141
|
+
function M(e) {
|
|
140
142
|
if (e) {
|
|
141
143
|
const n = e.lastIndexOf("/"), t = e.lastIndexOf(".", n > -1 ? n : e.length);
|
|
142
144
|
return t > -1 ? e.substring(0, t) : e;
|
|
143
145
|
}
|
|
144
|
-
}
|
|
146
|
+
}
|
|
147
|
+
function j(e) {
|
|
145
148
|
if (e) {
|
|
146
149
|
const n = e.lastIndexOf(".");
|
|
147
150
|
if (n > -1) return e.substring(n + 1);
|
|
148
151
|
}
|
|
149
|
-
}
|
|
152
|
+
}
|
|
153
|
+
function a(e, n = 2, t = n, r = f) {
|
|
150
154
|
if (e == null) return "";
|
|
151
155
|
const o = `${r}decimal${n}.${t}`;
|
|
152
156
|
let s = c[o];
|
|
@@ -158,7 +162,17 @@ const f = "en-US", c = {}, B = (e) => {
|
|
|
158
162
|
style: "decimal",
|
|
159
163
|
useGrouping: !0
|
|
160
164
|
}), c[o] = s), s.format(e);
|
|
161
|
-
}
|
|
165
|
+
}
|
|
166
|
+
function U(e) {
|
|
167
|
+
return e == null ? "" : e < 1e3 ? d(e) : e < 1e6 ? `${a(e / 1e3, 2, 0)}K` : e < 1e9 ? `${a(e / 1e6, 2, 0)}M` : e < 1e12 ? `${a(e / 1e9, 2, 0)}B` : `${a(e / 1e12, 2, 0)}T`;
|
|
168
|
+
}
|
|
169
|
+
function L(e) {
|
|
170
|
+
return e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${d(e)} bytes` : e < 1048576 ? `${a(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${a(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${a(e / 1073741824, 2, 0)} GB` : `${a(e / 1099511627776, 2, 0)} TB`;
|
|
171
|
+
}
|
|
172
|
+
function _(e) {
|
|
173
|
+
return e == null ? "" : e < 1e3 ? `${d(e)} ms` : e === 1e3 ? `${d(e)} sec` : e < 6e4 ? `${a(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${a(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${a(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${a(e / 864e5, 2, 0)} days`;
|
|
174
|
+
}
|
|
175
|
+
function d(e, n = f) {
|
|
162
176
|
if (e == null) return "";
|
|
163
177
|
const t = `${n}decimal0.0`;
|
|
164
178
|
let r = c[t];
|
|
@@ -170,7 +184,8 @@ const f = "en-US", c = {}, B = (e) => {
|
|
|
170
184
|
style: "decimal",
|
|
171
185
|
useGrouping: !0
|
|
172
186
|
}), c[t] = r), r.format(e);
|
|
173
|
-
}
|
|
187
|
+
}
|
|
188
|
+
function W(e) {
|
|
174
189
|
switch (e) {
|
|
175
190
|
case "csv":
|
|
176
191
|
return "text/csv";
|
|
@@ -184,7 +199,8 @@ const f = "en-US", c = {}, B = (e) => {
|
|
|
184
199
|
default:
|
|
185
200
|
return "application/octet-stream";
|
|
186
201
|
}
|
|
187
|
-
}
|
|
202
|
+
}
|
|
203
|
+
const b = [
|
|
188
204
|
{ id: "dtv", label: { "en-gb": "Delimited Text" } },
|
|
189
205
|
{ id: "e/e", label: { "en-gb": "Entity/Event" } },
|
|
190
206
|
{ id: "jsonArray", label: { "en-gb": "JSON Array" } },
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Application utilities.
|
|
3
3
|
*/
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
10
|
-
export declare
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
4
|
+
export declare function convertODataTypeIdToUsageTypeId(oDataTypeId: string): string;
|
|
5
|
+
export declare function extractNameFromPath(itemPath: string): string | undefined;
|
|
6
|
+
export declare function extractExtensionFromPath(itemPath: string): string | undefined;
|
|
7
|
+
export declare function formatNumberAsDecimalNumber(number?: number, decimalPlaces?: number, minimumFractionDigits?: number, locale?: string): string;
|
|
8
|
+
export declare function formatNumberAsSize(number?: number): string;
|
|
9
|
+
export declare function formatNumberAsStorageSize(number?: number): string;
|
|
10
|
+
export declare function formatNumberAsDuration(number?: number): string;
|
|
11
|
+
export declare function formatNumberAsWholeNumber(number?: number, locale?: string): string;
|
|
12
|
+
export declare function lookupMimeTypeForExtension(extension?: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.304",
|
|
4
4
|
"description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonathan Terrell <terrell.jm@gmail.com>",
|