Socket
Socket
Sign inDemoInstall

hast-util-has-property

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hast-util-has-property

hast utility to check if a node has a property


Version published
Weekly downloads
584K
increased by0.7%
Maintainers
2
Weekly downloads
 
Created

What is hast-util-has-property?

The `hast-util-has-property` package is a utility for checking if a given HAST (Hypertext Abstract Syntax Tree) node has a specific property. This is particularly useful when working with HAST nodes in the context of HTML processing and transformations.

What are hast-util-has-property's main functionalities?

Check if a node has a specific property

This feature allows you to check if a given HAST node has a specific property. In the example, the node is an anchor element with an `href` property, and the function checks for the presence of this property.

const hasProperty = require('hast-util-has-property');
const node = { type: 'element', tagName: 'a', properties: { href: 'https://example.com' } };
const result = hasProperty(node, 'href');
console.log(result); // true

Other packages similar to hast-util-has-property

Keywords

FAQs

Package last updated on 01 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc