fbbcc52b7987a8011e7f44b9dd0bdd03fab8b67828430c4712e0859b46e260b8.json raw
1 {"ast":null,"code":"export function handleMintInfoContactFieldDeprecated(data) {\n // Monkey patch old contact field [\"email\", \"me@mail.com\"] Array<[string, string]>; to new contact field [{method: \"email\", info: \"me@mail.com\"}] Array<MintContactInfo>\n // This is to maintain backwards compatibility with older versions of the mint\n if (Array.isArray(data === null || data === void 0 ? void 0 : data.contact) && (data === null || data === void 0 ? void 0 : data.contact.length) > 0) {\n data.contact = data.contact.map(function (contact) {\n if (Array.isArray(contact) && contact.length === 2 && typeof contact[0] === 'string' && typeof contact[1] === 'string') {\n console.warn(\"Mint returned deprecated 'contact' field: Update NUT-06: https://github.com/cashubtc/nuts/pull/117\");\n return {\n method: contact[0],\n info: contact[1]\n };\n }\n return contact;\n });\n }\n return data;\n}\n//# sourceMappingURL=nut-06.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}