Registry / testing / asobj
library3.0.1jsnpmunverified

Object utility library (v3.0.1) providing common object operations like cloning, assignment, deep/shallow equality, cleanup, and property digging. Targets Node.js >=8. Lightweight with no runtime dependencies. Released as needed; standard JS style. Differentiated by simple API and focus on utility functions without external dependencies.

npm install asobj
INSTALL
IMPORT
SIG · ASOBJ
A
asobj
testingjavascriptv3.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

clone
import { clone } from 'asobj'
ESM import available; require also works for CommonJS.
deepEqual
import { deepEqual } from 'asobj'
const deepEqual = require('asobj').deepEqual
Named export; both import styles work.
assign
import { assign } from 'asobj'
Named export, not default.

Demonstrates cloning, deep comparison, and cleanup with delete options.

import { clone, deepEqual, cleanup } from 'asobj'; const obj1 = { a: 1, b: { c: 2 } }; const obj2 = clone(obj1); console.log(obj2); // { a: 1, b: { c: 2 } } console.log(deepEqual(obj1, obj2)); // true const dirty = { x: 'hello', y: undefined, z: '' }; const clean = cleanup(dirty, { delNull: true, delEmptyString: true }); console.log(clean); // { x: 'hello' }
Debug
Known issues
gotchacleanup() only deletes properties that are undefined, not null by default.
fix
Pass { delNull: true } option to also remove null values.
affects: >=3.0.0
gotchadig() expects keys as separate arguments, not an array.
fix
Use dig(obj, 'a', 'b', 'c') not dig(obj, ['a','b','c']).
affects: >=3.0.0
gotchashallowEqual may return true for objects with same enumerable own properties.
fix
Use deepEqual for nested comparison.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: dig is not a function
dig() is a named export and must be imported explicitly.
fix
import { dig } from 'asobj'
cleanup(...).delNull is not a function
cleanup returns a new object, not a chainable method.
fix
Use cleanup(src, { delNull: true }) directly.
Cannot find module 'asobj'
Package not installed or import path incorrect.
fix
Run npm install asobj or check import path.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
packageasobj