UNPKG

@azerion/bluestack-sdk-react-native

Version:

BlueStack provides functionalities for monetizing your mobile application: from premium sales with rich media, video and innovative formats, it facilitates inserting native mobile ads as well all standard display formats. BlueStack SDK is a library that a

92 lines (83 loc) 1.58 kB
/** * null check * @param value * @returns {boolean} */ export function isNull(value) { return value === null; } /** * object check * @param value * @returns {boolean} */ export function isObject(value) { return value ? typeof value === 'object' && !Array.isArray(value) && !isNull(value) : false; } /** * function check * @param value * @returns {*|boolean} */ export function isFunction(value) { return value ? typeof value === 'function' : false; } /** * string check * @param value * @return {boolean} */ export function isString(value) { return typeof value === 'string'; } /** * number check * @param value * @return {boolean} */ export function isNumber(value) { return typeof value === 'number'; } /** * boolean check * @param value * @return {boolean} */ export function isBoolean(value) { return typeof value === 'boolean'; } /** * array check * @param value * @returns {arg is Array<unknown>} */ export function isArray(value) { return Array.isArray(value); } /** * undefined check * @param value * @returns {boolean} */ export function isUndefined(value) { return typeof value === 'undefined'; } /** * URL check * @param url * @returns {boolean} */ const IS_VALID_URL_REGEX = /^(http|https):\/\/[^ "]+$/; export function isValidUrl(url) { return IS_VALID_URL_REGEX.test(url); } /** * ISO language code check * @param url * @returns {boolean} */ const IS_VALID_ISO_REGEX = /^[a-z]{2}$/; export function isValidISOCode(code) { return IS_VALID_ISO_REGEX.test(code); } //# sourceMappingURL=Validate.js.map