cordo 2.10.0 → 2.10.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/package.json +1 -1
- package/src/core/hooks.ts +4 -2
- package/src/core/magic.ts +4 -0
package/package.json
CHANGED
package/src/core/hooks.ts
CHANGED
|
@@ -15,6 +15,9 @@ export namespace Hooks {
|
|
|
15
15
|
config?: NonNullable<CordoConfig>
|
|
16
16
|
): ReturnType<NonNullable<CordoConfig['hooks'][Name]>> {
|
|
17
17
|
if (!config) {
|
|
18
|
+
if (!CordoMagic.inContext())
|
|
19
|
+
return value as any
|
|
20
|
+
|
|
18
21
|
const contextConfig = CordoMagic.getConfig()
|
|
19
22
|
if (!contextConfig) {
|
|
20
23
|
console.warn(`Calling hook '${hookName}' failed, no config provided and no config found in context.`)
|
|
@@ -26,8 +29,7 @@ export namespace Hooks {
|
|
|
26
29
|
|
|
27
30
|
const hook = config.hooks[hookName]
|
|
28
31
|
if (!hook)
|
|
29
|
-
|
|
30
|
-
return value
|
|
32
|
+
return value as any
|
|
31
33
|
|
|
32
34
|
if (hookName === 'transformUserFacingText') {
|
|
33
35
|
// @ts-expect-error
|