![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Checks whether given variable is callable. Works fine function and generators in spite of ES6 @@toStringTag
Yes! One more package detecting that given variable is function.
Made as drop-in replacement for is-callable package, but lighter and faster
npm install is-fun
# or via yarn
yarn add is-fun
Use it wherever and however you want - node.js or webpack, CJS or ESM modules!
const isFun = require("is-fun");
isFun(() => {}); // true
import isFun from "is-fun";
isFun(undefined); // false
isFun(null); // false
isFun(false); // false
isFun(true); // false
isFun([]); // false
isFun({}); // false
isFun(/a/g); // false
isFun(new RegExp("a", "g")); // false
isFun(new Date()); // false
isFun(42); // false
isFun(NaN); // false
isFun(Infinity); // false
isFun(new Number(42)); // false
isFun("foo"); // false
isFun(Object("foo")); // false
isFun(function() {}); // true
isFun(function*() {}); // true
isFun(x => x * x); // true
benchmarks ran on 3.4GHz Core i7 CPU width 16GB DDR4 RAM
npm run build && npm i -C benchmark && npm -C benchmark start
# Regular function is-callable × 3,679,405 ops/sec; (result: "true") is-fun × 6,736,726 ops/sec; (result: "true") # Fake function is-callable × 45,630 ops/sec; (result: "false") is-fun × 112,172 ops/sec; (result: "false") # Typed array constructor is-callable × 1,692,920 ops/sec; (result: "true") is-fun × 2,716,742 ops/sec; (result: "true") # Class constructor is-callable × 7,058,944 ops/sec; (result: "false") is-fun × 7,109,810 ops/sec; (result: "false") # Arrow function is-callable × 95,493,127 ops/sec; (result: "true") is-fun × 89,843,495 ops/sec; (result: "true") # Null is-callable × 124,068,441 ops/sec; (result: "false") is-fun × 126,135,930 ops/sec; (result: "false") # Number is-callable × 863,066,938 ops/sec; (result: "false") is-fun × 863,418,881 ops/sec; (result: "false")
FAQs
Checks whether given variable is callable. Works fine function and generators in spite of ES6 @@toStringTag
The npm package is-fun receives a total of 0 weekly downloads. As such, is-fun popularity was classified as not popular.
We found that is-fun demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.