Skip to content

Added Unpack and improved Map method

Compare
Choose a tag to compare
@minwork minwork released this 25 Apr 09:39
· 67 commits to master since this release

Unpack

  • Added unpack method to easily convert multidimensional arrays to flat map of keys concatenated by dot and corresponding values

Map

New functionality

  • Now map method handles multidimensional arrays with ease using one of three modes
    • MAP_ARRAY_KEY_VALUE - Basic mapping supplying callback with current element key as 1st argument and value as 2nd
    • MAP_ARRAY_VALUE_KEYS_LIST - Multidimensional mapping supplying callback with current element value as 1st argument and element keys as subsequent arguments
    • MAP_ARRAY_KEYS_ARRAY_VALUE - Multidimensional mapping supplying callback with array of current element keys as 1st argument and element value as 2nd

Arguments order depreciation

  • Map method now accepts array as 1st argument and callback as 2nd issuing appropriate deprecation warning when using old syntax (callback as 1st and array as 2nd)

For use cases check out updated examples section