UNPKG

1.5 kBTypeScriptView Raw
1import { IConstruct } from 'constructs';
2import { Intrinsic } from './private/intrinsic';
3import { IPostProcessor, IResolveContext } from './resolvable';
4import { Stack } from './stack';
5/**
6 * Given an object, converts all keys to PascalCase given they are currently in camel case.
7 * @param obj The object.
8 */
9export declare function capitalizePropertyNames(construct: IConstruct, obj: any): any;
10/**
11 * Turns empty arrays/objects to undefined (after evaluating tokens).
12 */
13export declare function ignoreEmpty(obj: any): any;
14/**
15 * Returns a copy of `obj` without `undefined` (or `null`) values in maps or arrays.
16 */
17export declare function filterUndefined(obj: any): any;
18/**
19 * A Token that applies a function AFTER resolve resolution
20 */
21export declare class PostResolveToken extends Intrinsic implements IPostProcessor {
22 private readonly processor;
23 constructor(value: any, processor: (x: any) => any);
24 resolve(context: IResolveContext): any;
25 postProcess(o: any, _context: IResolveContext): any;
26}
27/**
28 * @returns the list of stacks that lead from the top-level stack (non-nested) all the way to a nested stack.
29 */
30export declare function pathToTopLevelStack(s: Stack): Stack[];
31/**
32 * Given two arrays, returns the last common element or `undefined` if there
33 * isn't (arrays are foriegn).
34 */
35export declare function findLastCommonElement<T>(path1: T[], path2: T[]): T | undefined;
36export declare function undefinedIfAllValuesAreEmpty(object: object): object | undefined;