@geek-fun/serverlessinsight
Version:
Full life cycle cross providers serverless application management for your fast-growing business.
30 lines (29 loc) • 889 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseFunction = void 0;
const lodash_1 = require("lodash");
const parseFunction = (functions) => {
if ((0, lodash_1.isEmpty)(functions)) {
return undefined;
}
return Object.entries(functions).map(([key, func]) => ({
key,
name: func.name,
code: func.code,
container: func.container,
memory: func.memory,
gpu: func.gpu,
timeout: func.timeout,
environment: func.environment,
log: func.log,
network: func.network,
storage: {
disk: func.storage?.disk,
nas: func.storage?.nas?.map((nasItem) => ({
mount_path: nasItem.mount_path,
storage_class: nasItem.storage_class,
})),
},
}));
};
exports.parseFunction = parseFunction;