npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hemjs/notions

v2.0.0

Published

Utilities for arrays, objects, strings, and more

Readme

@hemjs/notions

Utilities for arrays, objects, strings, and more.

Table of contents

Installation

Install with npm:

npm install --save @hemjs/notions

Install with yarn:

yarn add @hemjs/notions

Lang

isBoolean

Determines whether a given value is of type boolean.

Type:

function isBoolean(value?: unknown): value is boolean;

Example:

import { isBoolean } from '@hemjs/notions';

isBoolean(false);
// => true
isBoolean(0);
// => false
isBoolean(null);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a boolean, otherwise false.

isClass

Determines whether a given value is a class.

Type:

function isClass<T = unknown>(value: unknown): value is Class<T>;

Example:

import { isClass } from '@hemjs/notions';

class Bar {}

isClass(Bar);
// => true
isClass(new Bar());
// => false
isClass(0);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a class, otherwise false.

isEmpty

Determines whether a given value is considered empty.

Type:

function isEmpty(value?: unknown): value is EmptyLike;

Empty Definitions:

  • null: Returns true when a null value is given.
  • undefined: Returns true when an undefined value is given.
  • boolean: Returns true when the boolean value is false.
  • integer: Returns true when an integer 0 value is given.
  • float: Returns true when a float 0.0 value is given.
  • string: Returns true when an empty string '' is given.
  • space: Returns true when an string is given which contains only whitespace.
  • array: Return true when an empty array ([]) or an array containing only empty values is given.
  • object: Returns true when an empty object ({}) or an object with all properties being null, undefined, or empty strings is given.
  • nan: Returns true for NaN.
  • bigint: Returns true for bigint zero (0n).

Non-plain objects (e.g. Set, Map, Date) are never treated as empty.

Example:

import { isEmpty } from '@hemjs/notions';

// Arrays
isEmpty([]);
// => true
isEmpty([0, false, '', null, undefined]);
// => true
isEmpty([1, 'hello', { a: 1 }]);
// => false

// Objects
isEmpty({});
// => true
isEmpty({ a: null, b: undefined, c: '' });
// => true
isEmpty({ a: 1, b: 'hello' });
// => false

// Strings
isEmpty('');
// => true
isEmpty('  ');
// => true
isEmpty('hello');
// => false

// Other Values
isEmpty(null);
// => true
isEmpty(undefined);
// => true
isEmpty(false);
// => true
isEmpty(0);
// => true
isEmpty(0.0);
// => true
isEmpty(true);
// => false
isEmpty(1);
// => false
isEmpty('hello');
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is empty, otherwise false.

isFunction

Determines whether a given value is of type function.

Type:

function isFunction(value?: unknown): value is (...args: unknown[]) => unknown;

Example:

import { isFunction } from '@hemjs/notions';

isFunction(() => {});
// => true
isFunction(Math.random);
// => true
isFunction(0);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a function, otherwise false.

isNil

Determines whether a given value is nullish (null or undefined).

Type:

function isNil(value?: unknown): value is null | undefined;

Example:

import { isNil } from '@hemjs/notions';

isNil(null);
// => true
isNil(undefined);
// => true
isNil(0);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is nullish, otherwise false.

isNull

Determines whether a given value is exactly null.

Type:

function isNull(value?: unknown): value is null;

Example:

import { isNull } from '@hemjs/notions';

isNull(null);
// => true
isNull(undefined);
// => false
isNull(0);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is null, otherwise false.

isNumber

Determines whether a given value is of type number.

Type:

function isNumber(value?: unknown): value is number;

Example:

import { isNumber } from '@hemjs/notions';

isNumber(10);
// => true
isNumber(Math.PI);
// => true
isNumber('10');
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a number, otherwise false.

isObject

Determines whether a given value is of type object (excluding null).

Type:

function isObject(value?: unknown): value is object;

Example:

import { isObject } from '@hemjs/notions';

isObject({});
// => true
isObject([]);
// => true
isObject(null);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is an object (excluding null), otherwise false.

isPlainObject

Determines whether a given value is a plain object (i.e., an object without a custom prototype).

Type:

function isPlainObject(value?: unknown): value is object;

Example:

import { isPlainObject } from '@hemjs/notions';

isPlainObject({});
// => true
isPlainObject([]);
// => false
isPlainObject(Object.create(null));
// => true

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a plain object, otherwise false.

isString

Determines whether a given value is of type string.

Type:

function isString(value?: unknown): value is string;

Example:

import { isString } from '@hemjs/notions';

isString('hello');
// => true
isString(Symbol('hello'));
// => false
isString(10);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a string, otherwise false.

isSymbol

Determines whether a given value is of type symbol.

Type:

function isSymbol(value?: unknown): value is symbol;

Example:

import { isSymbol } from '@hemjs/notions';

isSymbol(Symbol('hello'));
// => true
isSymbol('hello');
// => false
isSymbol(10);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is a symbol, otherwise false.

isUndefined

Determines whether a given value is undefined.

Type:

function isUndefined(value?: unknown): value is undefined;

Example:

import { isUndefined } from '@hemjs/notions';

isUndefined(undefined);
// => true
isUndefined(null);
// => false
isUndefined(0);
// => false

Parameters:

  • value: The value to be checked. Can be any data type.

Returns:

true if value is undefined, otherwise false.

Object

omit

Creates a new object with specific properties omitted from a source object.

Type:

function omit<T extends Record<string, unknown>, K extends keyof T>(
  obj: T,
  exclusions: readonly K[],
): Omit<T, K>;

Example:

import { omit } from '@hemjs/notions';

const person = { name: 'Alice', age: 30, city: 'Nairobi' };
const publicInfo = omit(person, ['age']);
console.log(publicInfo); // Output: { name: 'Alice', city: 'Nairobi' }

Parameters:

  • obj: The source object from which properties will be copied.
  • exclusions: An array of property keys to exclude from the new object.

Returns:

A new object containing all properties from obj except those listed in exclusions.

pick

Creates a new object containing only the specified properties from a source object.

Type:

function pick<T extends Record<string, unknown>, K extends keyof T>(
  obj: T,
  inclusions: readonly K[],
): Pick<T, K>;

Example:

import { pick } from '@hemjs/notions';

const person = { name: 'Alice', age: 30, city: 'Nairobi' };
const nameAndAge = pick(person, ['name', 'age']);
console.log(nameAndAge); // Output: { name: 'Alice', age: 30 }

Parameters:

  • obj: The source object from which properties will be copied.
  • inclusions: An array of property keys to include in the new object.

Returns:

A new object containing only the properties listed in inclusions from obj.

License

This project is licensed under the MIT license.

See LICENSE for more information.