@neutrium/quantity - v5.0.0
    Preparing search index...

    Function isQuantity

    • Test whether a value belongs to this package's shared Quantity core.

      Parameters

      • x: unknown

        Any value, including null or undefined.

      Returns x is QuantityCore

      Whether the value is a Quantity from the default, regex, or custom entry point.

      Plain definitions and instances from another copy of the package do not pass this check.

      import { Quantity } from '@neutrium/quantity';
      import { isQuantity } from '@neutrium/quantity/guards.js';

      isQuantity(new Quantity('1 m')); // true
      isQuantity(null); // false
      isQuantity({ scalar: 1 }); // false