Socket
Socket
Sign inDemoInstall

unist-util-remove-position

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unist-util-remove-position

Remove `position`s from a unist tree


Version published
Weekly downloads
5M
increased by5.17%
Maintainers
2
Weekly downloads
 
Created

What is unist-util-remove-position?

The unist-util-remove-position npm package is designed to work with Unist syntax trees. It allows users to remove the position information from nodes in the tree. This can be particularly useful when you want to compare nodes based on their content rather than their position in the source file, or when you want to minimize the size of the tree for serialization.

What are unist-util-remove-position's main functionalities?

Remove position from a single node

This feature allows you to remove the position information from a single node in the syntax tree. The code sample shows a node before the position information has been removed.

{"type": "text", "value": "Hello, world!", "position": {"start": {"line": 1, "column": 1, "offset": 0}, "end": {"line": 1, "column": 13, "offset": 12}}}

Remove position from an entire tree

This feature allows you to remove the position information from all nodes in a syntax tree, effectively stripping out all position data. The code sample shows a simple tree before the position information has been removed.

{"type": "root", "children": [{"type": "paragraph", "children": [{"type": "text", "value": "Hello, world!", "position": {"start": {"line": 1, "column": 1, "offset": 0}, "end": {"line": 1, "column": 13, "offset": 12}}}], "position": {"start": {"line": 1, "column": 1, "offset": 0}, "end": {"line": 1, "column": 13, "offset": 12}}}]

Other packages similar to unist-util-remove-position

Keywords

FAQs

Package last updated on 10 Nov 2019

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