locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
15 lines (14 loc) • 637 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.function_exists = function_exists;
const _phpRuntimeState_ts_1 = require("../_helpers/_phpRuntimeState.js");
function function_exists(funcName) {
// discuss at: https://locutus.io/php/function_exists/
// original by: Kevin van Zonneveld (https://kvz.io)
// improved by: Steve Clay
// improved by: Legaev Andrey
// improved by: Brett Zamir (https://brett-zamir.me)
// example 1: function_exists('isFinite')
// returns 1: true
return typeof (0, _phpRuntimeState_ts_1.getPhpGlobalCallable)(funcName) === 'function';
}