@botonic/core 0.44.0 → 0.45.0-alpha.1
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/lib/cjs/core-bot.d.ts +1 -1
- package/lib/cjs/debug/inspector.d.ts +1 -1
- package/lib/cjs/debug/inspector.js +0 -2
- package/lib/cjs/debug/inspector.js.map +1 -1
- package/lib/cjs/handoff.d.ts +1 -1
- package/lib/cjs/handoff.js +2 -1
- package/lib/cjs/handoff.js.map +1 -1
- package/lib/cjs/hubtype-service.d.ts +3 -3
- package/lib/cjs/hubtype-service.js +25 -19
- package/lib/cjs/hubtype-service.js.map +1 -1
- package/lib/cjs/models/ai-agents.d.ts +13 -2
- package/lib/cjs/models/hubtype-analytics.d.ts +1 -1
- package/lib/cjs/plugins.d.ts +1 -1
- package/lib/cjs/pusher-utils.js +1 -1
- package/lib/cjs/pusher-utils.js.map +1 -1
- package/lib/cjs/routing/router-utils.d.ts +1 -1
- package/lib/cjs/routing/router-utils.js +15 -8
- package/lib/cjs/routing/router-utils.js.map +1 -1
- package/lib/cjs/routing/router.d.ts +1 -1
- package/lib/cjs/routing/router.js +31 -20
- package/lib/cjs/routing/router.js.map +1 -1
- package/lib/cjs/utils.d.ts +1 -1
- package/lib/cjs/utils.js +12 -8
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/core-bot.d.ts +1 -1
- package/lib/esm/debug/inspector.d.ts +1 -1
- package/lib/esm/debug/inspector.js +0 -2
- package/lib/esm/debug/inspector.js.map +1 -1
- package/lib/esm/handoff.d.ts +1 -1
- package/lib/esm/handoff.js +2 -1
- package/lib/esm/handoff.js.map +1 -1
- package/lib/esm/hubtype-service.d.ts +3 -3
- package/lib/esm/hubtype-service.js +25 -19
- package/lib/esm/hubtype-service.js.map +1 -1
- package/lib/esm/models/ai-agents.d.ts +13 -2
- package/lib/esm/models/hubtype-analytics.d.ts +1 -1
- package/lib/esm/plugins.d.ts +1 -1
- package/lib/esm/pusher-utils.js +1 -1
- package/lib/esm/pusher-utils.js.map +1 -1
- package/lib/esm/routing/router-utils.d.ts +1 -1
- package/lib/esm/routing/router-utils.js +15 -8
- package/lib/esm/routing/router-utils.js.map +1 -1
- package/lib/esm/routing/router.d.ts +1 -1
- package/lib/esm/routing/router.js +31 -20
- package/lib/esm/routing/router.js.map +1 -1
- package/lib/esm/utils.d.ts +1 -1
- package/lib/esm/utils.js +12 -8
- package/lib/esm/utils.js.map +1 -1
- package/package.json +4 -7
- package/src/core-bot.ts +9 -9
- package/src/debug/inspector.ts +4 -6
- package/src/handoff.ts +6 -3
- package/src/hubtype-service.ts +34 -23
- package/src/models/ai-agents.ts +14 -1
- package/src/models/hubtype-analytics.ts +1 -1
- package/src/plugins.ts +1 -1
- package/src/pusher-utils.ts +1 -1
- package/src/routing/router-utils.ts +23 -9
- package/src/routing/router.ts +41 -24
- package/src/utils.ts +18 -9
package/src/utils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PROVIDER, Session } from './models/legacy-types'
|
|
1
|
+
import { PROVIDER, type Session } from './models/legacy-types'
|
|
2
2
|
|
|
3
3
|
export const isNode = (): boolean => {
|
|
4
|
-
// @ts-
|
|
4
|
+
// @ts-expect-error
|
|
5
5
|
return typeof IS_NODE !== 'undefined'
|
|
6
6
|
? // @ts-ignore
|
|
7
7
|
IS_NODE
|
|
@@ -11,7 +11,7 @@ export const isNode = (): boolean => {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const isBrowser = (): boolean => {
|
|
14
|
-
// @ts-
|
|
14
|
+
// @ts-expect-error
|
|
15
15
|
return typeof IS_BROWSER !== 'undefined'
|
|
16
16
|
? // @ts-ignore
|
|
17
17
|
IS_BROWSER
|
|
@@ -38,7 +38,9 @@ export function isFunction(o: any): boolean {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export function cloneObject(object: any): any {
|
|
41
|
-
if (!object)
|
|
41
|
+
if (!object) {
|
|
42
|
+
return {}
|
|
43
|
+
}
|
|
42
44
|
return { ...object }
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -62,15 +64,22 @@ export const join = (...segments: string[]): string => {
|
|
|
62
64
|
const part = parts[i]
|
|
63
65
|
// Remove leading and trailing slashes
|
|
64
66
|
// Also remove "." segments
|
|
65
|
-
if (!part || part === '.')
|
|
67
|
+
if (!part || part === '.') {
|
|
68
|
+
continue
|
|
69
|
+
}
|
|
66
70
|
// Interpret ".." to pop the last segment
|
|
67
|
-
if (part === '..')
|
|
71
|
+
if (part === '..') {
|
|
72
|
+
newParts.pop()
|
|
73
|
+
}
|
|
68
74
|
// Push new path segments.
|
|
69
|
-
else
|
|
75
|
+
else {
|
|
76
|
+
newParts.push(part)
|
|
77
|
+
}
|
|
70
78
|
}
|
|
71
79
|
// Preserve the initial slash if there was one.
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
if (parts[0] === '') {
|
|
81
|
+
newParts.unshift('')
|
|
82
|
+
}
|
|
74
83
|
// Turn back into a single string path.
|
|
75
84
|
return newParts.join('/') || (newParts.length ? '/' : '.')
|
|
76
85
|
}
|