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
๐ Links
- GitHub Repository: https://github.com/phane-tech/js-object-utils
- Demo / Documentation: https://phane-tech.github.io/js-object-utils/module-ObjectUtils.html
- Unit Test Cases Reports: https://phane-tech.github.io/js-object-utils/unit-test-report.html