@8ms/helpers 2.3.27 → 2.3.29
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.
|
@@ -54,7 +54,7 @@ var GoogleCloudBigqueryNamespace = class extends BaseNamespace {
|
|
|
54
54
|
query = async (props) => {
|
|
55
55
|
await this.ensureInit();
|
|
56
56
|
let options = { query: "" };
|
|
57
|
-
if ("string" === props) options.query = props;
|
|
57
|
+
if ("string" === typeof props) options.query = props;
|
|
58
58
|
else if (isObject(props)) {
|
|
59
59
|
options.query = props.query;
|
|
60
60
|
if (props?.location) options["location"] = props.location;
|
package/dist/lodash/index.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ declare const merge: <T extends object>(target: T, ...sources: any[]) => T;
|
|
|
31
31
|
//#region src/lodash/orderBy.d.ts
|
|
32
32
|
type OrderDirection = "asc" | "desc";
|
|
33
33
|
type Iteratee<T> = ((item: T) => unknown) | string;
|
|
34
|
-
declare const orderBy: <T>(collection: T[], iteratees: Iteratee<T> | Iteratee<T>[], orders?: OrderDirection | OrderDirection[]) => T[];
|
|
34
|
+
declare const orderBy: <T>(collection: T[] | Record<string, T>, iteratees: Iteratee<T> | Iteratee<T>[], orders?: OrderDirection | OrderDirection[]) => T[];
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/lodash/unescape.d.ts
|
|
37
37
|
declare const unescape: (str: string) => string;
|
package/dist/lodash/index.mjs
CHANGED
|
@@ -118,13 +118,14 @@ const merge = (target, ...sources) => {
|
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/lodash/orderBy.ts
|
|
120
120
|
const orderBy = (collection, iteratees, orders = "asc") => {
|
|
121
|
+
const arr = Array.isArray(collection) ? collection : Object.values(collection);
|
|
121
122
|
const keys = Array.isArray(iteratees) ? iteratees : [iteratees];
|
|
122
123
|
const dirs = Array.isArray(orders) ? orders : [orders];
|
|
123
124
|
const getValue = (item, key) => {
|
|
124
125
|
if (typeof key === "function") return key(item);
|
|
125
126
|
return key.split(".").reduce((acc, part) => acc?.[part], item);
|
|
126
127
|
};
|
|
127
|
-
return [...
|
|
128
|
+
return [...arr].sort((a, b) => {
|
|
128
129
|
for (let i = 0; i < keys.length; i++) {
|
|
129
130
|
const dir = dirs[i] === "desc" ? -1 : 1;
|
|
130
131
|
const aVal = getValue(a, keys[i]);
|
package/dist/url/index.d.mts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
//#region src/url/url.d.ts
|
|
2
|
-
type EnvironmentUrl = {
|
|
3
|
-
localhost: string;
|
|
4
|
-
development: string;
|
|
5
|
-
staging: string;
|
|
6
|
-
production: string;
|
|
7
|
-
};
|
|
8
2
|
/**
|
|
9
3
|
* Does the URL begin with HTTP or HTTPS?
|
|
10
4
|
*/
|
|
@@ -21,9 +15,5 @@ declare const buildParameters: (existing?: object, updated?: object) => string;
|
|
|
21
15
|
* Create a new relative URL based on the current path.
|
|
22
16
|
*/
|
|
23
17
|
declare const buildRelative: (router: any, updated?: object) => string;
|
|
24
|
-
/**
|
|
25
|
-
* Get the current base url.
|
|
26
|
-
*/
|
|
27
|
-
declare const buildEnvironmentUrl: (path: string, url: EnvironmentUrl) => string;
|
|
28
18
|
//#endregion
|
|
29
|
-
export {
|
|
19
|
+
export { buildParameters, buildRelative, isAbsolute, isRelative };
|
package/dist/url/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { merge } from "../lodash/index.mjs";
|
|
2
|
-
import { isDevelopment, isLocalhost, isProduction, isStaging } from "../environment/index.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/url/url.ts
|
|
5
4
|
/**
|
|
@@ -36,17 +35,6 @@ const buildParameters = (existing = {}, updated = {}) => {
|
|
|
36
35
|
const buildRelative = (router, updated = {}) => {
|
|
37
36
|
return `${router.pathname}${buildParameters(router.query, updated || {})}`;
|
|
38
37
|
};
|
|
39
|
-
/**
|
|
40
|
-
* Get the current base url.
|
|
41
|
-
*/
|
|
42
|
-
const buildEnvironmentUrl = (path, url) => {
|
|
43
|
-
let response;
|
|
44
|
-
if (isDevelopment() && isLocalhost()) response = url.localhost;
|
|
45
|
-
else if (isStaging()) response = url.staging;
|
|
46
|
-
else if (isProduction()) response = url.production;
|
|
47
|
-
else response = url.development;
|
|
48
|
-
return response + path || "";
|
|
49
|
-
};
|
|
50
38
|
|
|
51
39
|
//#endregion
|
|
52
|
-
export {
|
|
40
|
+
export { buildParameters, buildRelative, isAbsolute, isRelative };
|