• Stars
    star
    8
  • Rank 2,098,752 (Top 42 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

mapfun is a function that applies a mapping function to an infinite number of input elements, with options to skip certain elements and selectively apply the mapping to keys and/or values of objects. The origin of this function traces back to zikojs
Langage Problem Solution
Javascript Solution Solution
Python problem problem

The magic function called mapfunc

mapfun

  • mapfun is a function that applies a mapping function to an infinite number of input elements, with options to skip certain elements and selectively apply the mapping to keys and/or values of objects.

  • The mapfun function has been developed in JavaScript and Python, offering the same functionality in different programming languages.

Syntax

Javascript Python
mapfun(callback,{},...args) mapfun(callback,{},*args)

Install

Javascript Python
npm i mapfun pip install mapfun

Arguments

  • fun : The mapping function that will be applied to each element in the input elements.
  • ...X for javascripters or*X for pythonista :The elements to be mapped .
  • { skip , key , value } : Object with three optional properties :
    • skip : specifies the elements to skip during the mapping process.
    • key : boolean flag indicating whether to apply the mapping function to the keys of objects or not. The default value is false
    • value : boolean flag indicating whether to apply the mapping function to the values of objects or not. The default value is true

Supported Datatypes

Javascript Support Python Support
Number βœ… int βœ…
String βœ… str βœ…
Boolean βœ… Boolean βœ…
Null βœ… float βœ…
NaN βœ… None βœ…
Undefined βœ… memoryview βœ…
BigInt βœ… complex ❌
Array βœ… list βœ…
Object βœ… object βœ…
Map βœ… dict βœ…
Set βœ… set βœ…
WeakMap ❌ tuple βœ…
WeakSet ❌ bytes βœ…
ArrayBuffer βœ… bytearray βœ…
Symbol ❌ range βœ…

Stats

NPM PYPI
downloads downloads
sourcerank sourcerank

License

This projet is licensed under the terms of MIT License .

More Repositories