UNPKG

@shelf/aws-lambda-libreoffice

Version:

Utility to work with Docker version of LibreOffice in Lambda

15 lines (14 loc) 484 B
export function getConvertedFilePath(logs) { try { const match = logs.match(/\/tmp\/.+->\s(\/tmp\/.+) using/); if (!match) { throw new Error('No match found in logs'); } return match[1]; } catch (e) { const ErrorWithExtendedMessage = new Error(e instanceof Error ? e.message : String(e)); ErrorWithExtendedMessage.message += `;\tTried to parse string: "${logs}"`; throw ErrorWithExtendedMessage; } }