1.0.34 • Published 2 years ago

tsl-utils v1.0.34

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago
  • Objects

    • pickFirstObjectItem Retrives first element from array value of object keys, used in combination with groupBy from lodash, groupBy returns grouped values from array with provided key in callback. If key is unique array will have one value. This can be used to take out that value
    • renameKeys Update object keys with callback.
    • objectMap Mapping through object keys and return object with updated values
    • objectLoop Looping through object, same as forEach though you get index as 3rd parameter in callback
    • objectFilter Mapping through object keys and returns new filtered object
    • cleanObject Mapping through object keys and removing undefined values
    • swapObjectData Mapping through object keys and taking values form second object under same key
    • swapObjectCleanedData Mapping through object keys and taking values form second object under same key, all undefined values are removed
    • setObjectLeaf similar to setWith from lodash, though this function returns new object. It takes array of keys and value, it updates object last key with value and if keys do not exist it creates them dynamically
    • getSortedObject Get object where keys are sorted alphabetically
  • Functions

    • promisifyCallback Promisify functions that accept callback that will be called upon resolve, example wainting for message from api
  • Selectors

    • generateSelector Function that generates selector for reselect library
    • combineSelector Function that allows usage of selector logic outside of reselect
  • Arrays

    • includesAll Check if all keys from source array are in target array
    • rangeEach Callback is executed a range number of times
    • rangeMap Creates a range custom array
    • rangeReduce Reduces a range array
    • orderedPromiseAll Return array with all promises resolved in order, one after another
  • Events

    • dispatchEvent Dispatches custom event
    • addOnHistoryChangeEvent Disptaches custom event on every history change
  • Api

    • fetchApi Fetch helper with options for generating query string and prefix, takes custom fetchCallback for usage if node-fetch should be used
  • Browser

    • isBrowser Detects if code is running in a browser
    • domReady Runs function when content is rendered
    • addOnHistoryChangeCallback Calls custom funtion on every history change
1.0.34

2 years ago

1.0.33

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.11

2 years ago

1.0.32

2 years ago

1.0.10

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago