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

@babel/plugin-proposal-function-sent

Package Overview
Dependencies
Maintainers
4
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-function-sent

Compile the function.sent meta property to valid ES2015 code

  • 7.21.4-esm.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is @babel/plugin-proposal-function-sent?

@babel/plugin-proposal-function-sent is a Babel plugin that allows you to use the `function.sent` meta-property within generator functions. This meta-property provides a way to access the value passed to the generator's `next` method, which can be useful for more advanced control flow within generator functions.

What are @babel/plugin-proposal-function-sent's main functionalities?

Accessing the value passed to the generator's next method

This feature allows you to access the value passed to the generator's `next` method using `function.sent`. In the example, the generator function logs the value received each time `next` is called.

function* generator() {
  let value = function.sent;
  while (true) {
    value = yield value;
    console.log('Received:', value);
  }
}

const gen = generator();
console.log(gen.next('First').value); // Logs: 'First'
console.log(gen.next('Second').value); // Logs: 'Second'

Other packages similar to @babel/plugin-proposal-function-sent

Keywords

FAQs

Package last updated on 04 Apr 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