JSPM

phane-tech-object-utils

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q42266F
  • License MIT

Pure JavaScript array utility functions

Package Exports

  • phane-tech-object-utils
  • phane-tech-object-utils/index.cjs
  • phane-tech-object-utils/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (phane-tech-object-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿ“ฆ Kotipalli Phaneendra Kumar - Object Utilities

A lightweight, dependency-free JavaScript module that provides safe and predictable object utility functions.

These helpers make it easy to inspect, validate, and clone objects while handling edge cases such as null, undefined, arrays, and invalid inputs.

Designed to be minimal, consistent, and well-tested for both Node.js and browser environments.


โœจ Highlights

  • ๐Ÿงฑ Object validation helpers
  • ๐Ÿ”‘ Safe key and value access
  • ๐Ÿ“ Object inspection utilities
  • ๐Ÿงฌ Deep cloning support
  • ๐Ÿงช Extensive Jest test coverage
  • โšก Zero dependencies

๐Ÿ“ฆ Installation

npm install phane-tech-object-utils

๐Ÿš€ Import

import {
  isEmptyObject,
  getObjectKeys,
  getObjectValues,
  hasObjectKey,
  deepCloneObject
} from "phane-tech-object-utils";

๐Ÿ“š API Reference

๐Ÿงฑ isEmptyObject(value)

Checks whether an object has no own enumerable properties.

isEmptyObject({}); // true
isEmptyObject({ a: 1 }); // false

๐Ÿ”‘ getObjectKeys(value)

Returns an array of an objectโ€™s own enumerable keys.

getObjectKeys({ a: 1, b: 2 }); // ["a", "b"]

๐Ÿ“ฆ getObjectValues(value)

Returns an array of an objectโ€™s own enumerable values.

getObjectValues({ a: 1, b: 2 }); // [1, 2]

๐Ÿ” hasObjectKey(object, key)

Checks whether an object has a specified own property.

hasObjectKey({ a: 1 }, "a"); // true
hasObjectKey({ a: 1 }, "b"); // false

๐Ÿงฌ deepCloneObject(value)

Creates a deep clone of an object using JSON serialization.

const obj = { a: 1, b: { c: 2 } };
const copy = deepCloneObject(obj);
copy.b.c = 99;
console.log(obj.b.c); // 2

๐Ÿ“„ License

MIT