/
githubmirror
/
serverless
Обзор
Документация
Войти
/
githubmirror
/
serverless
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/sf-core/src/lib/runners/state-utils.js
21 строка
912 B
Tomasz Czubocha
fix(compose): stop package and print from wiping deployed service state (#13792)
10 авг 2026, 16:33
Не верифицирован
10 авг 2026, 16:33
7c8c59f
Код
Авторство
О чём код?
/** * Shape a runner command's returned state. * * A command's state is authoritative only when the run actually gathered * stack outputs (the aws:info flow, spawned by deploy and info). Commands * that gathered nothing return undefined — NOT an empty object — so * consumers (compose's updateLocalState) fall back to the persisted state * instead of mistaking "nothing gathered" for "the service has no outputs". * remove is the one intentional clear: an explicit empty state. * * @param {Object} params * @param {Record<string, string>|undefined} params.stackOutputs * @param {string} params.fullCommand - command.join(' ') * @returns {{outputs: Record<string, string>}|Record<string, never>|undefined} */ export const buildCommandState = ({ stackOutputs, fullCommand }) => { if (fullCommand === 'remove') { return {} } return stackOutputs ? { outputs: stackOutputs } : undefined }