UNPKG

1.16 kBJavaScriptView Raw
1"use strict";
2/**
3 * @license
4 * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
5 * This code may only be used under the BSD style license found at
6 * http://polymer.github.io/LICENSE.txt
7 * The complete set of authors may be found at
8 * http://polymer.github.io/AUTHORS.txt
9 * The complete set of contributors may be found at
10 * http://polymer.github.io/CONTRIBUTORS.txt
11 * Code distributed by Google as part of the polymer project is also
12 * subject to an additional IP rights grant found at
13 * http://polymer.github.io/PATENTS.txt
14 */
15Object.defineProperty(exports, "__esModule", { value: true });
16function getCompileTarget(capabilities, compile) {
17 let compileTarget = undefined;
18 if (compile === 'always') {
19 compileTarget = 'es5';
20 }
21 else if (compile === 'auto') {
22 const jsLevels = ['es2018', 'es2017', 'es2016', 'es2015'];
23 compileTarget = jsLevels.find((c) => capabilities.has(c));
24 if (compileTarget === undefined) {
25 compileTarget = 'es5';
26 }
27 }
28 return compileTarget;
29}
30exports.getCompileTarget = getCompileTarget;
31//# sourceMappingURL=get-compile-target.js.map
\No newline at end of file