mapfun
v0.9.17
Published
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.
Downloads
44
Maintainers
Readme
|Langage|Problem|Solution|
|-|-|-|
|Javascript|||
|Python|||
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 isfalse
value
: boolean flag indicating whether to apply the mapping function to the values of objects or not. The default value istrue
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| |-|-| ||| ||| |||
License
This projet is licensed under the terms of MIT License .