jodit
Version:
Jodit is an awesome and useful wysiwyg editor with filebrowser
18 lines (17 loc) • 655 B
JavaScript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module helpers/checker
*/
/**
* Check if function or method was not replaced on some custom implementation
*/
export function isNativeFunction(f) {
return (Boolean(f) &&
(typeof f).toLowerCase() === 'function' &&
(f === Function.prototype ||
/^\s*function\s*(\b[a-z$_][a-z0-9$_]*\b)*\s*\((|([a-z$_][a-z0-9$_]*)(\s*,[a-z$_][a-z0-9$_]*)*)\)\s*{\s*\[native code]\s*}\s*$/i.test(String(f))));
}