UNPKG

@adguard/aglint

Version:

Universal adblock filter list linter.

48 lines (46 loc) 1.16 kB
/* * AGLint v3.0.0 (build date: Wed, 21 May 2025 13:24:14 GMT) * (c) 2025 AdGuard Software Ltd. * Released under the MIT license * https://github.com/AdguardTeam/AGLint#readme */ /** * Checks whether the given value is undefined. * * @param value Value to check. * * @returns `true` if the value is 'undefined', `false` otherwise. */ const isUndefined = (value) => { return typeof value === 'undefined'; }; /** * Checks whether the given value is null. * * @param value Value to check. * * @returns `true` if the value is 'null', `false` otherwise. */ const isNull = (value) => { return value === null; }; /** * Checks whether the given value is a number. * * @param value Value to check. * * @returns `true` if the value is a number, `false` otherwise. */ const isNumber = (value) => { return typeof value === 'number' && !Number.isNaN(value); }; /** * Checks whether the given value is a string. * * @param value Value to check. * @returns `true` if the value is a string, `false` otherwise. */ const isString = (value) => { return typeof value === 'string'; }; export { isNull, isNumber, isString, isUndefined };