Optional Functional API
Additions
Functional API
If you only need to do a single thing, you can also import most functions individually. The result of these functions will not be turned into a flooent object.
import { afterLast } from 'flooent/string'
afterLast('www.example.com', '.') // 'com'
import { move } from 'flooent/array'
move(['music', 'tech', 'sports'], 0, 'after', 1) // ['tech', 'music', 'sports']
import { times } from 'flooent/number'
times(3, i => i) // [0, 1, 2]
import { rename } from 'flooent/map'
rename(new Map([['item_id', 1]]), 'item_id', 'itemId') // Map { itemId → 1 }
Changes
string.between
and string.betweenLast
deprecated
These can already be expressed clearer using string.after
, string.afterLast
, string.before
, and string.beforeLast
without the need of a "nested fluent API". string.between
and string.betweenLast
will be removed in a future major release.