From 824a2d9f587ca017fc71b84d835e72f54f9c87c4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Nov 2018 18:02:36 +0100 Subject: Began rewrite --- .../locutus/php/funchand/function_exists.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 node_modules/locutus/php/funchand/function_exists.js (limited to 'node_modules/locutus/php/funchand/function_exists.js') diff --git a/node_modules/locutus/php/funchand/function_exists.js b/node_modules/locutus/php/funchand/function_exists.js new file mode 100644 index 0000000..5c8aa99 --- /dev/null +++ b/node_modules/locutus/php/funchand/function_exists.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = function function_exists(funcName) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/function_exists/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Steve Clay + // improved by: Legaev Andrey + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: function_exists('isFinite') + // returns 1: true + // test: skip-1 + + var $global = typeof window !== 'undefined' ? window : global; + + if (typeof funcName === 'string') { + funcName = $global[funcName]; + } + + return typeof funcName === 'function'; +}; +//# sourceMappingURL=function_exists.js.map \ No newline at end of file -- cgit v1.2.3