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

reduce-function-call

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reduce-function-call

Reduce function calls in a string, using a callback

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
decreased by-5.88%
Maintainers
1
Weekly downloads
 
Created

What is reduce-function-call?

The reduce-function-call npm package allows you to reduce the arguments of a function call within a string. This can be particularly useful for processing CSS functions or other string-based function calls.

What are reduce-function-call's main functionalities?

Reduce CSS function calls

This feature allows you to reduce the arguments of CSS function calls. In this example, the `calc` function call is reduced to a simpler form.

const reduceFunctionCall = require('reduce-function-call');

const input = 'calc(100% - 50px)';
const output = reduceFunctionCall(input, 'calc', (body) => {
  return '50%';
});
console.log(output); // 'calc(50%)'

Custom function call reduction

You can use this feature to reduce custom function calls within a string. In this example, the `myFunc` function call is reduced to a single argument.

const reduceFunctionCall = require('reduce-function-call');

const input = 'myFunc(1, 2, 3)';
const output = reduceFunctionCall(input, 'myFunc', (body) => {
  return '4';
});
console.log(output); // 'myFunc(4)'

Other packages similar to reduce-function-call

Keywords

FAQs

Package last updated on 12 Sep 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