/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const UNUSABLE_INTERPOLATION_REGEXPS = [ /^\s*$/, /[<>]/, /^[{}]$/, /&(#|[a-z])/i, /^\/\//, // comment ]; export function assertInterpolationSymbols(identifier, value) { if (value != null && !(Array.isArray(value) && value.length == 2)) { throw new Error(`Expected '${identifier}' to be an array, [start, end].`); } else if (value != null) { const start = value[0]; const end = value[1]; // Check for unusable interpolation symbols UNUSABLE_INTERPOLATION_REGEXPS.forEach(regexp => { if (regexp.test(start) || regexp.test(end)) { throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`); } }); } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy9hc3NlcnRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE1BQU0sOEJBQThCLEdBQUc7SUFDckMsT0FBTztJQUNQLE1BQU07SUFDTixRQUFRO0lBQ1IsYUFBYTtJQUNiLE9BQU8sRUFBUyxVQUFVO0NBQzNCLENBQUM7QUFFRixNQUFNLFVBQVUsMEJBQTBCLENBQUMsVUFBa0IsRUFBRSxLQUFVO0lBQ3ZFLElBQUksS0FBSyxJQUFJLElBQUksSUFBSSxDQUFDLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsSUFBSSxLQUFLLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQyxFQUFFO1FBQ2pFLE1BQU0sSUFBSSxLQUFLLENBQUMsYUFBYSxVQUFVLGlDQUFpQyxDQUFDLENBQUM7S0FDM0U7U0FBTSxJQUFJLEtBQUssSUFBSSxJQUFJLEVBQUU7UUFDeEI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