vega-util is a foundational JavaScript utility library within the Vega ecosystem, providing a comprehensive set of helper methods for common operations across Vega modules. It includes functions for type checking (e.g., `isObject`, `isArray`, `isString`), object manipulation (like `extend`, `merge`), array utilities, string operations, logging, error handling, and more. As of its current stable version v6.2.0, vega-util is exclusively distributed as an ESM module. The project maintains an active release cadence, frequently updating to incorporate new features, bug fixes, and security patches, as evidenced by recent v5.x and v6.x releases. Its primary differentiation lies in being a core, dependency-free utility library specifically tailored to support the data visualization functionalities of Vega and Vega-Lite.
npm install vega-utilVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using core utility functions like `isObject`, `merge`, `truthy`, and `pad`.
Migrate your project to use ES modules. Ensure your `package.json` specifies `"type": "module"` or use `.mjs` file extensions. Update all `require()` statements to `import` statements.
Upgrade to `vega` version 5.33.1 or higher for v5.x series, or any v6.x version. If directly using `vega-expression` or `vega-interpreter`, ensure those packages are updated to their latest compatible versions.
Update `vega` (and implicitly its sub-packages) to version 5.32.0 or higher. Always sanitize or validate untrusted Vega/Vega-Lite specifications, especially if not using `vega-interpreter`'s CSP mode.
No direct fix is required for most applications, as `Object.hasOwn` is a safer and more robust alternative. If you have highly customized `Object.prototype` behavior, review its interaction with this change.
Change `const { ... } = require('vega-util');` to `import { ... } from 'vega-util';` and ensure your project is configured for ES modules (e.g., `"type": "module"` in `package.json`).Ensure you are using named imports for `vega-util` functions: `import { isObject } from 'vega-util';`. Do not use `import isObject from 'vega-util';`.Verify the function name and its availability in the specific `vega-util` version you are using by checking the official API documentation or source code. Ensure your TypeScript configuration is correctly resolving module types.
No dependency data recorded yet.