all files / popper/utils/ isNative.js

100% Statements 3/3
50% Branches 1/2
100% Functions 2/2
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11                   14×
const nativeHints = [
    'native code',
    '[object MutationObserverConstructor]' // for mobile safari iOS 9.0
];
 
/**
 * Determine if a function is implemented natively (as opposed to a polyfill).
 * @argument {Function | undefined} fn the function to check
 * @returns {boolean}
 */
export default fn => nativeHints.some(hint => (fn || '').toString().indexOf(hint) > -1);