isFunction

说明

检查是否函数

源码

https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/function/isFunction

用法

isFunction.test.ts
import { isFunction } from "../../utility/function/isFunction";

describe('isFunction', () => {
  test('isFunction should return `true` when received a function object', () => {
    const origin = [
      function () { },
      Symbol,
    ];

    for (const v of origin) {
      expect(isFunction(v)).toBeTruthy();
    }
  });
});

最后更新于