From 78eb4cd68d10a97438730d6391efd216841f8689 Mon Sep 17 00:00:00 2001 From: Cyrille Pontvieux Date: Sat, 7 Mar 2026 22:30:16 +0100 Subject: [PATCH] Allow to not have all keys defined in an mapping key names object This is required by new version on lioness with its ti(params) function. --- src/parse.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/parse.js b/src/parse.js index 6f6f53b..5f9ae46 100644 --- a/src/parse.js +++ b/src/parse.js @@ -347,9 +347,13 @@ export const getTraverser = (cb = noop, opts = {}) => { // The argument is an object mapping key names to gettext props return Object.keys(arg).reduce((acc, prop) => { const gettextPropName = arg[prop] - const matchingObjectValue = node.arguments[i].properties.find( + const matchingObject = node.arguments[i].properties.find( (x) => x.key.name === prop - ).value.value + ) + if (matchingObject === undefined) { + return acc + } + const matchingObjectValue = matchingObject.value.value return gettextPropName === 'comment' ? { ...acc,