Tim Blasi c58b0ff787 refactor(change_detect): Share more codegen logic
Move more logic in our codegen into a shared util which is called by the
Jit & Prege change detector code.
2015-08-04 18:55:07 +00:00

18 lines
508 B
TypeScript

import {List} from 'angular2/src/facade/collection';
/**
* Converts `funcOrValue` to a string which can be used in generated code.
*/
export function codify(obj: any): string {
return JSON.stringify(obj);
}
/**
* Combine the strings of generated code into a single interpolated string.
* Each element of `vals` is expected to be a string literal or a codegen'd
* call to a method returning a string.
*/
export function combineGeneratedStrings(vals: string[]): string {
return vals.join(' + ');
}