Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rocambole-token

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rocambole-token

Helpers for rocambole AST token manipulation

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
decreased by-1.02%
Maintainers
1
Weekly downloads
 
Created
Source

rocambole-token

Helpers to manipulate rocambole AST tokens.

Why?

Created mainly to be used by esindent and esformatter.

Important Notes

Right now all methods ignores the loc and range info of the tokens, this is by design since updating the range and loc info on a large JS program multiple times can be very expensive. It's better to write a separate tool to sanitize this info and that can be executed as a separate step.

Also important to note that right now rocambole doesn't add any reference on the token itself to the nodes that contain that token, so if you remove a token that happens to be the startToken or endToken of any node you might have some conflict if you start manipulating the tokens based on the nodes, instead of the token LinkedList. - the node.startToken might be detached from the LinkedList.

Test coverage is pretty low so far, but since it was mostly extracted from esformatter the methods should work as expected. I started to write some tests just to show how I would do it but did not had the time to finish it... (ideally tests should be written before the implementation).

License

Released under the MIT License.

Keywords

FAQs

Package last updated on 02 Jul 2014

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