Skip to content

Commit d287e4f

Browse files
object fallback
1 parent 2cd699c commit d287e4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/connectors/datalayer/src/mapping.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const defaultMapping: Mapping = {
3131
export function objToEvent(config: Config, obj: unknown): MappedEvent | void {
3232
if (!(isObject(obj) && isString(obj.event))) return;
3333

34-
const mapping = Object.assign(defaultMapping, config.mapping ?? {});
35-
const { command, custom, ignore, name } = mapping[obj.event];
34+
const mapping = Object.assign(defaultMapping, config.mapping);
35+
const { command, custom, ignore, name } = mapping[obj.event] || {};
3636

3737
if (ignore) return;
3838

0 commit comments

Comments
 (0)