INNER CODE UNIT · TypeScript

splitOne

org-formation/org-formation-cli · src/yaml-cfn/index.ts:36

const splitOne = (str: string, sep: string): string[] | null => {
  const index = str.indexOf(sep);
  return index < 0 ? null : [str.slice(0, index), str.slice(index + sep.length)];
};

/**
 * Returns true if obj is a representation of a CloudFormation intrinsic, i.e. an object with a
 * single property at key keyName.
 */
const checkType = (obj: {}, keyName: string): boolean => {
  return obj && typeof obj === 'object' && Object.keys(obj).length === 1 &&
    obj.hasOwnProperty(keyName);
};


const overrides: any = {
  // ShortHand notation for !GetAtt accepts Resource.Attribute format while the standard notation
  // is to use an array [Resource, Attribute]. Convert shorthand to standard format.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…