mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-07 23:37:35 +08:00
15 lines
297 B
TypeScript
15 lines
297 B
TypeScript
import * as es from "es-feature-detection";
|
|
|
|
const fns = es.builtins();
|
|
if (fns["Array.prototype.includes"]) {
|
|
// [].includes
|
|
}
|
|
const syntax = es.syntax();
|
|
if (syntax["Arrow function"]) {
|
|
new Function("() => {}");
|
|
}
|
|
|
|
if (fns.es2017.__all && syntax.es2017.__all) {
|
|
// support es2017!
|
|
}
|