File tree Expand file tree Collapse file tree 9 files changed +9
-9
lines changed Expand file tree Collapse file tree 9 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ import { getTagString } from './get-tag-string';
66 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
77 * @returns `true` if `o` is a function's array-like `arguments` variable
88 */
9- export function isArguments ( o : any ) : boolean {
9+ export function isArguments ( o : unknown ) : o is IArguments {
1010 return getTagString ( o ) === '[object Arguments]' ;
1111}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { isString } from './is-string';
88 * not counted as `string` values, even if the TypeScript compiler's `strictNullChecks`
99 * flag is set to `false` in your project.
1010 */
11- export function isArrayOfStrings ( values : any ) : values is string [ ] {
11+ export function isArrayOfStrings ( values : unknown ) : values is string [ ] {
1212 if ( ! isArray ( values ) ) {
1313 return false ;
1414 }
Original file line number Diff line number Diff line change 33 *
44 * @returns `true` if `o` is an `Array`, regardless of the types that it contains
55 */
6- export function isArray ( o : any ) : o is unknown [ ] {
6+ export function isArray ( o : unknown ) : o is unknown [ ] {
77 return Array . isArray ( o ) ;
88}
Original file line number Diff line number Diff line change 11/**
22 * Type guard to check to see if the given value is a valid value for the enum.
33 */
4- export function isEnumValue < T > ( enumType : T , value : any ) : value is T [ keyof T ] {
4+ export function isEnumValue < T > ( enumType : T , value : unknown ) : value is T [ keyof T ] {
55 return ( Object . keys ( enumType ) as Array < keyof T > )
66 . map ( ( key ) => {
77 return enumType [ key ] ;
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ import { isObject } from './is-object';
88 * considered `number`s. If you need to check for one of those values, you can use the
99 * built-in `Number.isNaN` or `Number.isFinite` functions.
1010 */
11- export function isNumber ( o : any ) : o is number {
11+ export function isNumber ( o : unknown ) : o is number {
1212 return typeof o === 'number' || ( isObject ( o ) && getTagString ( o ) === '[object Number]' ) ;
1313}
Original file line number Diff line number Diff line change 99 * @see https://github.com/jashkenas/underscore/blob/d5fe0fd4060f13b40608cb9d92eda6d857e8752c/underscore.js#L1322
1010 * @returns `true` if `o` is an `object`
1111 */
12- export function isObject ( o : any ) : o is object {
12+ export function isObject ( o : unknown ) : o is object {
1313 let type = typeof o ;
1414
1515 return o !== null && ( type === 'object' || type === 'function' ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ import { isObject } from './is-object';
88 *
99 * @returns `true` if `o` is `Promise`-like (i.e. has a `then` function)
1010 */
11- export function isPromiseLike ( o : any ) : o is PromiseLike < unknown > {
11+ export function isPromiseLike ( o : unknown ) : o is PromiseLike < unknown > {
1212 return isPromise ( o ) || ( isObject ( o ) && typeof ( o as any ) . then === 'function' ) ;
1313}
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ import { getTagString } from './get-tag-string';
66 *
77 * @returns `true` if `o` is a `Promise`
88 */
9- export function isPromise ( o : any ) : o is Promise < unknown > {
9+ export function isPromise ( o : unknown ) : o is Promise < unknown > {
1010 return isObject ( o ) && getTagString ( o ) === '[object Promise]' ;
1111}
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ import { getTagString } from './get-tag-string';
88 * `string` values, even if the TypeScript compiler's `strictNullChecks` flag is set to
99 * `false` in your project.
1010 */
11- export function isString ( o : any ) : o is string {
11+ export function isString ( o : unknown ) : o is string {
1212 return typeof o === 'string' || ( isObject ( o ) && getTagString ( o ) === '[object String]' ) ;
1313}
You can’t perform that action at this time.
0 commit comments