UNPKG

ut2

Version:

一个现代 JavaScript 实用工具库。[点击查看在线文档]。

28 lines (25 loc) 965 B
import isObjectLike from '../isObjectLike.js'; import getTag from './getTag.js'; import { argumentsTag, functionProtoToString, stringUndefined } from './native.js'; var VERSION = "1.21.2"; var isBrowser = typeof window !== stringUndefined && isObjectLike(window) && typeof document !== stringUndefined && isObjectLike(document) && window.document === document; var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag; var FUNC_ERROR_TEXT = 'Expected a function'; function toSource(func) { if (func !== null) { try { return functionProtoToString.call(func); } catch (err) { } try { return func + ''; } catch (err) { } } return ''; } var stubFlase = function () { return false; }; var stubTrue = function () { return true; }; export { FUNC_ERROR_TEXT, VERSION, isBrowser, stubFlase, stubTrue, supportedArgumentsType, toSource };