Feature detection for function names. See The names of functions in
ES6 for background.
Provides the same results as
node-compat-table
.
$ npm install --save function-name-support
const functionNameSupport = require('function-name-support')
A frozen object with boolean values. Compare with
node-compat-table
:
- function statements:
functionStatements
- function expressions:
functionExpressions
- new Function:
newFunction
- bound functions:
boundFunctions
- variables (function):
functionVariables
- object methods (function):
functionObjectMethods
- accessor properties:
accessorProperties
- shorthand methods:
shorthandMethods
- symbol-keyed methods:
symbolKeyedMethods
- class statements:
classStatements
- class expressions:
classExpressions
- variables (class):
classVariables
- object methods (class):
classObjectMethods
- class prototype methods:
classPrototypeMethods
- class static methods:
classStaticMethods
A boolean indicating whether all known function name inferences are supported.
An integer that stores a serialization of the support
object. Useful when
storing a function name (or lack thereof) for later comparisons along with
details on whether the function name was inferable at all.
Helper method for comparing bitFlags
. Returns true
if it is a subset of
otherFlags
.
Helper method for comparing bitFlags
. Returns true
if it is a superset of
otherFlags
.