Socket
Socket
Sign inDemoInstall

@sapphi-red/ts-transformer-for-of

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sapphi-red/ts-transformer-for-of

A TypeScript custom transformer which transforms multiple array methods to one for-of loop.


Version published
Maintainers
1
Install size
39.8 kB
Created

Readme

Source

ts-transformer-for-of

A TypeScript custom transformer which transforms multiple array methods to one for loop. Also this transforms for-of to a traditional for loop.

For now, Array::filter, Array::map and Array::forEach are only supported.

How to use the custom transformer

Unfortunately, TypeScript itself does not currently provide any easy way to use custom transformers (See Microsoft/TypeScript#14419). The followings are the example usage of the custom transformer.

See kimamula/ts-transformer-keys.
You can use this as it.

Caveats

Sparse arrays are not supported

Using this transformer with Sparse arrays, arrays with unfilled slots, may lead to unintended behavior. Before transforming the code, Array iteration methods will skip unfilled slots, but after transforming the code it will work as if it is filled with undefined.

License

MIT

Some code are from kimamula/ts-transformer-keys.
Copyright (c) 2017 Kenji Imamula
kimamula/ts-transformer-keys:/LICENSE

Keywords

FAQs

Last updated on 02 Apr 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc