UNPKG

typed-serverless

Version:

Helps you write a consistent Serverless Framework configuration in TypeScript

22 lines (21 loc) 756 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCfIntrinsicFunction = void 0; function isCfIntrinsicFunction(object) { if (typeof object === 'object' && object !== null) { const keys = Object.keys(object); if (keys.length === 1) { const key = keys[0]; if (key.startsWith('Fn::') || key === 'Ref') { const value = object[keys[0]]; if (Array.isArray(value) || typeof value === 'string' || (key === 'Fn::Transform' && typeof value === 'object')) { return true; } } } } return false; } exports.isCfIntrinsicFunction = isCfIntrinsicFunction;