Back to Explore

syntax-tree/hast-util-is-element

GitHub
1 watchersOpen source

Last release:

hast-util-is-element is a small utility for checking whether a HAST node is a (certain) element. It helps avoid repeated code by providing functions like isElement (optionally with a tag-name or other test) and convertElement for generating reusable checks.

Project status

  • Maintenance status: The most recent upstream push and package update were on 2023-07-31 (3.0.0), and there is no evidence of further updates since then, so the source appears quiet/dormant (maintenance mode at best) as of 2026-06-09.
  • Update cadence: Historically, updates have come in infrequent bursts (for example, 2021-12, then 2023-07), and the current gap since the last update is over 2 years, indicating no active cadence right now.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 3.0.0

    hast-util-is-element v3.0.0 modernizes the package for Node.js 16+, switches to package exports, and refactors the TypeScript typing model so users do not need explicit generic type parameters. The implementation also moves to a new internal lib/ module while keeping the public runtime exports to isElement and convertElement.

    Breaking
  • 2.1.3

    Release 2.1.3 is presented as “Add improved docs” with no stated code or API changes. However, the diff shows multiple changes beyond documentation, including TypeScript build configuration changes, regenerated typing-test changes, and CI/test toolchain updates.

  • 2.1.2

    Release 2.1.2 focuses on correcting TypeScript type assertions for hast-util-is-element. The code diff shows changes only to JSDoc-based typings and the accompanying type test file, with no apparent runtime behavior changes.

  • 2.1.1

    Release 2.1.1 is a small TypeScript-focused update. It adds `strict` mode to `tsconfig.json` and adjusts published type definitions to permit `null` for certain callback parameters.

  • 2.1.0

    Release 2.1.0 updates the library version and adds a new JSDoc TypeScript type alias named `Test`. The code diff shows this new `Test` type is then used to update the `test` parameter typing in `isElement` and `convertElement` overloads.

    Features
  • 2.0.1

    Release 2.0.1 is a type-related change only, as reflected by the release note entry “Fix types.” The code diff shows JSDoc type signature adjustments across the exported utilities, with return types shifting away from type guard style annotations.

  • 2.0.0

    Release 2.0.0 migrates the package to ESM and adds extensive JSDoc-driven type information (including generated declaration tests). The implementation also changes the public API surface from a CommonJS default export with `isElement.convert` to ESM named exports.

    Breaking
  • 1.1.0

    Release 1.1.0 adds a new `convert` helper and extends `isElement` to support function-based tests. The implementation also introduces additional parameters (`index`, `parent`, `context`) that are passed through to the compiled test and adds new validation and throwing behavior for those parameters.

    BreakingFeatures
  • 1.0.4

    Release 1.0.4 updates package metadata and documentation, including adding a `funding` field and a new security section in the README. The actual codebase diff is effectively non-functional, with changes limited to package.json/readme.md and development tooling configuration.

    Security
  • 1.0.3

    Release 1.0.3, per the release notes, is a prose refactor. The actual code change in index.js appears to be comment-only, but the release also updates CI and development toolchain versions, and significantly edits the README.