From 8949bf9c9a1b07ed83dc07e249c5e8e729c2c7de Mon Sep 17 00:00:00 2001 From: Ray Epps Date: Sat, 31 Dec 2022 14:05:41 -0700 Subject: [PATCH] Update docs for v10+ (#219) --- chiller.json | 1 + docs/array/alphabetical.mdx | 34 +++++++------- docs/array/boil.mdx | 34 +++++++------- docs/array/cluster.mdx | 15 +----- docs/array/counting.mdx | 27 +++++------ docs/array/diff.mdx | 10 ---- docs/array/first.mdx | 12 +---- docs/array/flat.mdx | 15 +----- docs/array/fork.mdx | 41 ++++++++--------- docs/array/group.mdx | 36 ++++++--------- docs/array/intersects.mdx | 10 ---- docs/array/iterate.mdx | 22 ++++----- docs/array/last.mdx | 12 +---- docs/array/list.mdx | 54 +++++++++++++++++----- docs/array/max.mdx | 41 +++++++---------- docs/array/merge.mdx | 41 ++++++++--------- docs/array/min.mdx | 40 +++++++--------- docs/array/objectify.mdx | 41 ++++++++--------- docs/array/range.mdx | 48 +++++++++++++++++-- docs/array/replace-or-append.mdx | 35 ++++++-------- docs/array/replace.mdx | 34 ++++++-------- docs/array/select.mdx | 48 ++++++++++--------- docs/array/sift.mdx | 11 ----- docs/array/sort.mdx | 36 ++++++--------- docs/array/sum.mdx | 38 +++++++--------- docs/array/toggle.mdx | 48 +++++++++++++++++++ docs/array/unique.mdx | 40 +++++++--------- docs/array/zip-to-object.mdx | 25 ++++++++++ docs/array/zip.mdx | 23 ++++++++++ docs/async/{try.mdx => tryit.mdx} | 23 ++-------- docs/curry/chain.mdx | 17 +------ docs/curry/debounce.mdx | 22 +++++++-- docs/object/assign.mdx | 21 +++++++++ docs/object/clone.mdx | 23 ++++++++++ docs/object/get.mdx | 2 +- docs/series/series.mdx | 31 ++++++++++++- docs/string/pascal.mdx | 16 +++++++ docs/string/title.mdx | 18 ++++++++ docs/string/trim.mdx | 17 +++++++ docs/typed/is-date.mdx | 17 +++++++ docs/typed/is-empty.mdx | 5 +- docs/typed/is-equal.mdx | 19 ++++++++ docs/typed/is-float.mdx | 17 +++++++ docs/typed/is-int.mdx | 17 +++++++ docs/typed/is-primitive.mdx | 19 ++++++++ package.json | 4 +- yarn.lock | 76 ++++++++++++++++++++++++++++--- 47 files changed, 764 insertions(+), 472 deletions(-) create mode 100644 docs/array/toggle.mdx create mode 100644 docs/array/zip-to-object.mdx create mode 100644 docs/array/zip.mdx rename docs/async/{try.mdx => tryit.mdx} (59%) create mode 100644 docs/object/assign.mdx create mode 100644 docs/object/clone.mdx create mode 100644 docs/string/pascal.mdx create mode 100644 docs/string/title.mdx create mode 100644 docs/string/trim.mdx create mode 100644 docs/typed/is-date.mdx create mode 100644 docs/typed/is-equal.mdx create mode 100644 docs/typed/is-float.mdx create mode 100644 docs/typed/is-int.mdx create mode 100644 docs/typed/is-primitive.mdx diff --git a/chiller.json b/chiller.json index 78f0f3e2..e9c593a8 100644 --- a/chiller.json +++ b/chiller.json @@ -7,6 +7,7 @@ "light": "docs/logo-light.png", "dark": "docs/logo-dark.png" }, + "version": "v10.x.x", "index": "docs/getting-started", "pages": "./docs/**/*.mdx", "theme": "red-400", diff --git a/docs/array/alphabetical.mdx b/docs/array/alphabetical.mdx index d886608f..fe73b67c 100644 --- a/docs/array/alphabetical.mdx +++ b/docs/array/alphabetical.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Sorts an array of objects alphabetically by a property --- - - - ## Basic usage Given an array of objects and a callback function used to determine @@ -16,19 +13,24 @@ sorted alphabetically. ```ts import { alphabetical } from 'radash' -const gods = [{ - name: 'Ra', - power: 100 -}, { - name: 'Zeus', - power: 98 -}, { - name: 'Loki', - power: 72 -}, { - name: 'Vishnu', - power: 100 -}] +const gods = [ + { + name: 'Ra', + power: 100 + }, + { + name: 'Zeus', + power: 98 + }, + { + name: 'Loki', + power: 72 + }, + { + name: 'Vishnu', + power: 100 + } +] alphabetical(gods, g => g.name) // => [Loki, Ra, Vishnu, Zeus] alphabetical(gods, g => g.name, 'desc') // => [Zeus, Vishnu, Ra, Loki] diff --git a/docs/array/boil.mdx b/docs/array/boil.mdx index f90eb6fc..3e6ed8aa 100644 --- a/docs/array/boil.mdx +++ b/docs/array/boil.mdx @@ -1,12 +1,9 @@ --- title: boil group: 'Array' -description: "Reduce a list of items down to one item" +description: 'Reduce a list of items down to one item' --- - - - ## Basic usage Given an array of items return the final item that wins the comparison condition. Useful for more complicated min/max. @@ -14,16 +11,21 @@ Given an array of items return the final item that wins the comparison condition ```ts import { boil } from 'radash' -const gods = [{ - name: 'Ra', - power: 100 -}, { - name: 'Zeus', - power: 98 -}, { - name: 'Loki', - power: 72 -}] - -const mostPowerful = boil(gods, (a, b) => a.power > b.power ? a : b) // => { name: 'Ra', power: 100 } +const gods = [ + { + name: 'Ra', + power: 100 + }, + { + name: 'Zeus', + power: 98 + }, + { + name: 'Loki', + power: 72 + } +] + +boil(gods, (a, b) => (a.power > b.power ? a : b)) +// => { name: 'Ra', power: 100 } ``` diff --git a/docs/array/cluster.mdx b/docs/array/cluster.mdx index 20bc2187..92ebc8b9 100644 --- a/docs/array/cluster.mdx +++ b/docs/array/cluster.mdx @@ -4,27 +4,16 @@ group: 'Array' description: Split a list into many lists of the given size --- - - - ## Basic usage -Given an array of items and a desired cluster size (`n`), returns an array +Given an array of items and a desired cluster size (`n`), returns an array of arrays. Each child array containing `n` (cluster size) items split as evenly as possible. ```ts import { cluster } from 'radash' -const gods = [ - 'Ra', - 'Zeus', - 'Loki', - 'Vishnu', - 'Icarus', - 'Osiris', - 'Thor' -] +const gods = ['Ra', 'Zeus', 'Loki', 'Vishnu', 'Icarus', 'Osiris', 'Thor'] cluster(gods, 3) // => [ diff --git a/docs/array/counting.mdx b/docs/array/counting.mdx index fec22b81..4c04fcc8 100644 --- a/docs/array/counting.mdx +++ b/docs/array/counting.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Creates an object with counts of occurrences of items --- - - - ## Basic usage Given an array of objects and an identity callback function to determine @@ -17,16 +14,20 @@ telling how many times that id occurred. ```ts import { counting } from 'radash' -const gods = [{ - name: 'Ra', - culture: 'egypt' -}, { - name: 'Zeus', - culture: 'greek' -}, { - name: 'Loki', - culture: 'greek' -}] +const gods = [ + { + name: 'Ra', + culture: 'egypt' + }, + { + name: 'Zeus', + culture: 'greek' + }, + { + name: 'Loki', + culture: 'greek' + } +] counting(gods, g => g.culture) // => { egypt: 1, greek: 2 } ``` diff --git a/docs/array/diff.mdx b/docs/array/diff.mdx index 62d4c113..4d6beefe 100644 --- a/docs/array/diff.mdx +++ b/docs/array/diff.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Create an array of differences between two arrays --- - - - ## Basic usage Given two arrays, returns an array of all items that exist in the first array @@ -20,10 +17,3 @@ const newWorldGods = ['vishnu', 'zeus'] diff(oldWorldGods, newWorldGods) // => ['ra'] ``` - - - - - - - diff --git a/docs/array/first.mdx b/docs/array/first.mdx index 88ecb91e..8c5fbd08 100644 --- a/docs/array/first.mdx +++ b/docs/array/first.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Get the first item from a list --- - - - ## Basic usage Given an array of items return the first item or a default value if no items exists. @@ -17,12 +14,5 @@ import { first } from 'radash' const gods = ['ra', 'loki', 'zeus'] first(gods) // => 'ra' -first([], 'vishnu') // => 'vishnu' +first([], 'vishnu') // => 'vishnu' ``` - - - - - - - diff --git a/docs/array/flat.mdx b/docs/array/flat.mdx index 633bc0a6..f5d09c09 100644 --- a/docs/array/flat.mdx +++ b/docs/array/flat.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Flatten an array of arrays into a single dimension --- - - - ## Basic usage Given an array that contains many arrays, return a new array where all items from the children are present at the top level. @@ -14,19 +11,9 @@ Given an array that contains many arrays, return a new array where all items fro ```ts import { flat } from 'radash' -const gods = [ - ['ra', 'loki'], - ['zeus'] -] +const gods = [['ra', 'loki'], ['zeus']] flat(gods) // => [ra, loki, zeus] ``` Note, `_.flat` is not recursive and will not flatten children of children of children ... of children. It will only flatten `T[][]` an array of arrays. - - - - - - - diff --git a/docs/array/fork.mdx b/docs/array/fork.mdx index 9f4a26f7..5364dc4c 100644 --- a/docs/array/fork.mdx +++ b/docs/array/fork.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Split an array into two arrays by a condition --- - - - ## Basic usage Given an array of items and a condition, returns two arrays where the first contains all items that passed the condition and the second contains all items that failed the condition. @@ -14,26 +11,24 @@ Given an array of items and a condition, returns two arrays where the first cont ```ts import { fork } from 'radash' -const gods = [{ - name: 'Ra', - power: 100 -}, { - name: 'Zeus', - power: 98 -}, { - name: 'Loki', - power: 72 -}, { - name: 'Vishnu', - power: 100 -}] +const gods = [ + { + name: 'Ra', + power: 100 + }, + { + name: 'Zeus', + power: 98 + }, + { + name: 'Loki', + power: 72 + }, + { + name: 'Vishnu', + power: 100 + } +] const [finalGods, lesserGods] = fork(gods, f => f.power > 90) // [[ra, vishnu, zues], [loki]] ``` - - - - - - - diff --git a/docs/array/group.mdx b/docs/array/group.mdx index 862f945a..c3e7b4da 100644 --- a/docs/array/group.mdx +++ b/docs/array/group.mdx @@ -1,12 +1,9 @@ --- title: group group: 'Array' -description: "Sort an array of items into groups" +description: 'Sort an array of items into groups' --- - - - ## Basic usage Given an array of items, `group` will build up an object where each key is an array of the items that belong in that group. Generally, this can be useful to categorize an array. @@ -14,23 +11,20 @@ Given an array of items, `group` will build up an object where each key is an ar ```ts import { group } from 'radash' -const fish = [{ - name: 'Marlin', - source: 'ocean' -}, { - name: 'Bass', - source: 'lake' -}, { - name: 'Trout', - source: 'lake' -}] +const fish = [ + { + name: 'Marlin', + source: 'ocean' + }, + { + name: 'Bass', + source: 'lake' + }, + { + name: 'Trout', + source: 'lake' + } +] const fishBySource = group(fish, f => f.source) // => { ocean: [marlin], lake: [bass, trout] } ``` - - - - - - - diff --git a/docs/array/intersects.mdx b/docs/array/intersects.mdx index 970dbd48..68b66db3 100644 --- a/docs/array/intersects.mdx +++ b/docs/array/intersects.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Determine if two arrays have a common item --- - - - ## Basic usage Given two arrays of items, returns true if any item exists in both arrays. @@ -23,10 +20,3 @@ const brackishFish = ['tarpon', 'snook'] intersects(oceanFish, brackishFish) // => true ``` - - - - - - - diff --git a/docs/array/iterate.mdx b/docs/array/iterate.mdx index 8a5be610..79eaa93f 100644 --- a/docs/array/iterate.mdx +++ b/docs/array/iterate.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Iterate over a callback n times --- - - - ## Basic usage A bit like `forEach` meets `reduce`. Useful for running a function `n` number of times to generate a value. The `_.iterate` function takes a count (the number of times to run the callback), a callback function, and an initial value. The callback is run _count_ many times as a reducer and the accumulated value is then returned. @@ -14,18 +11,15 @@ A bit like `forEach` meets `reduce`. Useful for running a function `n` number of ```ts import { iterate } from 'radash' -const value = iterate(4, (acc, idx) => { - return acc + idx -}, 0) // => 10 +const value = iterate( + 4, + (acc, idx) => { + return acc + idx + }, + 0 +) // => 10 ``` -Note, this is **NOT** zero indexed. If you pass a `count` of 5 +Note, this is **NOT** zero indexed. If you pass a `count` of 5 you will get an index of 1, 2, 3, 4, 5 in the callback function. - - - - - - - diff --git a/docs/array/last.mdx b/docs/array/last.mdx index 72e0223f..4decf0b1 100644 --- a/docs/array/last.mdx +++ b/docs/array/last.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Get the last item from a list --- - - - ## Basic usage Given an array of items return the last item or a default value if no items exists. @@ -17,12 +14,5 @@ import { last } from 'radash' const fish = ['marlin', 'bass', 'trout'] const lastFish = last(fish) // => 'trout' -const lastItem = last([], 'bass') // => 'bass' +const lastItem = last([], 'bass') // => 'bass' ``` - - - - - - - diff --git a/docs/array/list.mdx b/docs/array/list.mdx index 8a857d7d..c993ae4d 100644 --- a/docs/array/list.mdx +++ b/docs/array/list.mdx @@ -4,30 +4,62 @@ group: 'Array' description: Create a list with specific items --- +## Basic usage +Given a start, end, value, and step size returns a list with values from start to end by step size. +The interface is identical to `range`. -## Basic usage - -Given a start, end, and optional step size, returns a list that contains numbers from -start to end by step size (which defaults to one). A hat tip to Python's `range` -functionality. Uses `_.range` under the hood. +_A hat tip to Python's `range` functionality_ ```ts import { list } from 'radash' -for (const i of list(0, 200, 10)) { - console.log(i) // => 0, 10, 20, 30 ... 190, 200 -} +list(3) // [0, 1, 2, 3] +list(0, 3) // [0, 1, 2, 3] +list(0, 3, 'y') // [y, y, y, y] +list(0, 3, () => 'y') // [y, y, y, y] +list(0, 3, i => i) // [0, 1, 2, 3] +list(0, 3, i => `y${i}`) // [y0, y1, y2, y3] +list(0, 3, obj) // [obj, obj, obj, obj] +list(0, 6, i => i, 2) // [0, 2, 4, 6] +``` + +## Signatures + +The list function can do a lot with different arguments. + +### list(size) + +When givin a single argument, it's treated as the `size`. Returns a list with values from 0 to `size`. -for (const i of list(0, 5)) { - console.log(i) // => 0, 1, 2, 3, 4, 5 -} +```ts +list(3) // [0, 1, 2, 3] ``` +### list(start, end) + +When given two arguments, they're treated as the `start` and `end`. Returns a list with values from `start` to `end` + +```ts +list(2, 6) // [2, 3, 4, 5, 6] +``` +### list(start, end, value) +When given a third argument it's treated as the `value` to be used in the list. If the `value` is a function it will be called, with an index argument, to create every value. +```ts +list(2, 4, {}) // [{}, {}, {}] +list(2, 4, null) // [null, null, null] +list(2, 4, (i) => i) // [2, 3, 4] +``` +### list(start, end, value, step) +When given a fourth argument it's treated as the `step` size to skip when generating values from `start` to `end`. +```ts +list(2, 4, i => i, 2) // [2, 4] +list(25, 100, i => i, 25) // [25, 50, 75, 100] +``` \ No newline at end of file diff --git a/docs/array/max.mdx b/docs/array/max.mdx index f4f8340a..dd432ee0 100644 --- a/docs/array/max.mdx +++ b/docs/array/max.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Get the largest item from an array --- - - - ## Basic usage Given an array of items and a function to get the value of each item, returns the item with the largest value. Uses `_.boil` under the hood. @@ -14,27 +11,23 @@ Given an array of items and a function to get the value of each item, returns th ```ts import { max } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105, - source: 'ocean' -}, { - name: 'Bass', - weight: 8, - source: 'lake' -}, { - name: 'Trout', - weight: 13, - source: 'lake' -}] +const fish = [ + { + name: 'Marlin', + weight: 105, + source: 'ocean' + }, + { + name: 'Bass', + weight: 8, + source: 'lake' + }, + { + name: 'Trout', + weight: 13, + source: 'lake' + } +] max(fish, f => f.weight) // => {name: "Marlin", weight: 105, source: "ocean"} ``` - - - - - - - - diff --git a/docs/array/merge.mdx b/docs/array/merge.mdx index 3da5444d..711d6fb6 100644 --- a/docs/array/merge.mdx +++ b/docs/array/merge.mdx @@ -4,36 +4,31 @@ group: 'Array' description: Combine two lists overriding items in the first --- - - - ## Basic usage -Given two arrays of items and an identity function, returns the first +Given two arrays of items and an identity function, returns the first list with all items from the second list where there was a match. ```ts import { merge } from 'radash' -const gods = [{ - name: 'Zeus', - power: 92, -}, { - name: 'Ra', - power: 97, -}] - -const newGods = [{ - name: 'Zeus', - power: 100, -}] +const gods = [ + { + name: 'Zeus', + power: 92 + }, + { + name: 'Ra', + power: 97 + } +] + +const newGods = [ + { + name: 'Zeus', + power: 100 + } +] merge(gods, newGods, f => f.name) // => [{name: "Zeus" power: 100}, {name: "Ra", power: 97}] ``` - - - - - - - diff --git a/docs/array/min.mdx b/docs/array/min.mdx index 964ad76b..0c08640b 100644 --- a/docs/array/min.mdx +++ b/docs/array/min.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Get the smallest item from an array --- - - - ## Basic usage Given an array of items and a function to get the value of each item, returns the item with the smallest value. Uses `_.boil` under the hood. @@ -14,26 +11,23 @@ Given an array of items and a function to get the value of each item, returns th ```ts import { min } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105, - source: 'ocean' -}, { - name: 'Bass', - weight: 8, - source: 'lake' -}, { - name: 'Trout', - weight: 13, - source: 'lake' -}] +const fish = [ + { + name: 'Marlin', + weight: 105, + source: 'ocean' + }, + { + name: 'Bass', + weight: 8, + source: 'lake' + }, + { + name: 'Trout', + weight: 13, + source: 'lake' + } +] min(fish, f => f.weight) // => {name: "Bass", weight: 8, source: "lake"} ``` - - - - - - - diff --git a/docs/array/objectify.mdx b/docs/array/objectify.mdx index e5682ce7..0c5aec29 100644 --- a/docs/array/objectify.mdx +++ b/docs/array/objectify.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Convert a list to a dictionary object --- - - - ## Basic usage Given an array of items, create a dictionary with keys and values mapped by given functions. @@ -16,25 +13,25 @@ for each item. The third argument is optional and determines the value for each ```ts import { objectify } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105 -}, { - name: 'Bass', - weight: 8 -}, { - name: 'Trout', - weight: 13 -}] +const fish = [ + { + name: 'Marlin', + weight: 105 + }, + { + name: 'Bass', + weight: 8 + }, + { + name: 'Trout', + weight: 13 + } +] objectify(fish, f => f.name) // => { Marlin: [marlin object], Bass: [bass object], ... } -objectify(fish, f => f.name, f => f.weight) // => { Marlin: 105, Bass: 8, Trout: 13 } +objectify( + fish, + f => f.name, + f => f.weight +) // => { Marlin: 105, Bass: 8, Trout: 13 } ``` - - - - - - - - diff --git a/docs/array/range.mdx b/docs/array/range.mdx index aea13018..9083c8d0 100644 --- a/docs/array/range.mdx +++ b/docs/array/range.mdx @@ -4,16 +4,26 @@ group: 'Array' description: Create a range used for iterating --- +## Basic usage +Given a start, end, value, and step size returns a generator that will yield values from start to end by step size. Useful for replacing `for (let i = 0)` with `for of`. Range will return a generator that `for of` will call one at a time, so it's safe to create large ranges. +The interface is identical to `list`. -## Basic usage - -Given a start, end, and optional step size returns a generator that will yield from start to end by step size (which defaults to one). A hat tip to Python's `range` functionality. Useful for replacing `for (let i = 0)` with `for of`. Range will return a generator that `for of` will call one step at a time, so it's safe to create large ranges. +_A hat tip to Python's `range` functionality_ ```ts import { range } from 'radash' +range(3) // yields 0, 1, 2, 3 +range(0, 3) // yields 0, 1, 2, 3 +range(0, 3, 'y') // yields y, y, y, y +range(0, 3, () => 'y') // yields y, y, y, y +range(0, 3, i => i) // yields 0, 1, 2, 3 +range(0, 3, i => `y${i}`) // yields y0, y1, y2, y3 +range(0, 3, obj) // yields obj, obj, obj, obj +range(0, 6, i => i, 2) // yields 0, 2, 4, 6 + for (const i of range(0, 200, 10)) { console.log(i) // => 0, 10, 20, 30 ... 190, 200 } @@ -23,9 +33,41 @@ for (const i of range(0, 5)) { } ``` +## Signatures + +The range function can do a lot with different arguments. + +### range(size) + +When givin a single argument, it's treated as the `size`. Returns a generator that yields values from 0 to `size`. + +```ts +range(3) // yields 0, 1, 2, 3 +``` + +### range(start, end) +When given two arguments, they're treated as the `start` and `end`. Returns a generator that yields values from `start` to `end` +```ts +range(2, 6) // yields 2, 3, 4, 5, 6 +``` +### range(start, end, value) +When given a third argument it's treated as the `value` to be yielded in the generator. If the `value` is a function it will be called, with an index argument, to create every value. +```ts +range(2, 4, {}) // yields {}, {}, {} +range(2, 4, null) // yields null, null, null +range(2, 4, (i) => i) // yields 2, 3, 4 +``` + +### range(start, end, value, step) +When given a fourth argument it's treated as the `step` size to skip when yielding values from `start` to `end`. + +```ts +range(2, 4, i => i, 2) // yields 2, 4 +range(25, 100, i => i, 25) // yields 25, 50, 75, 100 +``` \ No newline at end of file diff --git a/docs/array/replace-or-append.mdx b/docs/array/replace-or-append.mdx index b17328fc..903e08c0 100644 --- a/docs/array/replace-or-append.mdx +++ b/docs/array/replace-or-append.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Replace item in array or append if no match --- - - - ## Basic usage Given an array of items, an item and an identity function, returns a new array with the item either replaced at the index of the existing item -- if it exists, else it is appended at the end. @@ -14,16 +11,20 @@ Given an array of items, an item and an identity function, returns a new array w ```ts import { replaceOrAppend } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105 -}, { - name: 'Salmon', - weight: 19 -}, { - name: 'Trout', - weight: 13 -}] +const fish = [ + { + name: 'Marlin', + weight: 105 + }, + { + name: 'Salmon', + weight: 19 + }, + { + name: 'Trout', + weight: 13 + } +] const salmon = { name: 'Salmon', @@ -38,11 +39,3 @@ const sockeye = { replaceOrAppend(fish, salmon, f => f.name === 'Salmon') // => [marlin, salmon (weight:22), trout] replaceOrAppend(fish, sockeye, f => f.name === 'Sockeye') // => [marlin, salmon, trout, sockeye] ``` - - - - - - - - diff --git a/docs/array/replace.mdx b/docs/array/replace.mdx index a0eceb11..7b9d0f65 100644 --- a/docs/array/replace.mdx +++ b/docs/array/replace.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Replace an item in an array --- - - - ## Basic usage Given an array of items, replace the one that matches the given condition function. Only replaces the first match. Always returns a copy of the original array. @@ -14,16 +11,20 @@ Given an array of items, replace the one that matches the given condition functi ```ts import { replace } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105 -}, { - name: 'Bass', - weight: 8 -}, { - name: 'Trout', - weight: 13 -}] +const fish = [ + { + name: 'Marlin', + weight: 105 + }, + { + name: 'Bass', + weight: 8 + }, + { + name: 'Trout', + weight: 13 + } +] const salmon = { name: 'Salmon', @@ -33,10 +34,3 @@ const salmon = { // read: replace fish with salmon where the name is Bass replace(fish, salmon, f => f.name === 'Bass') // => [marlin, salmon, trout] ``` - - - - - - - diff --git a/docs/array/select.mdx b/docs/array/select.mdx index 53402df8..91146f9f 100644 --- a/docs/array/select.mdx +++ b/docs/array/select.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Filter and map an array --- - - - ## Basic usage Applies a filter and a map operation at once and in one pass. @@ -14,26 +11,27 @@ Applies a filter and a map operation at once and in one pass. ```ts import { select } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105, - source: 'ocean' -}, { - name: 'Bass', - weight: 8, - source: 'lake' -}, { - name: 'Trout', - weight: 13, - source: 'lake' -}] - -select(fish, f => f.weight, f => f.source === 'lake') // => [8, 13] +const fish = [ + { + name: 'Marlin', + weight: 105, + source: 'ocean' + }, + { + name: 'Bass', + weight: 8, + source: 'lake' + }, + { + name: 'Trout', + weight: 13, + source: 'lake' + } +] + +select( + fish, + f => f.weight, + f => f.source === 'lake' +) // => [8, 13] ``` - - - - - - - diff --git a/docs/array/sift.mdx b/docs/array/sift.mdx index f2649554..be324806 100644 --- a/docs/array/sift.mdx +++ b/docs/array/sift.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Remove all falsy items from list --- - - - ## Basic usage Given a list of items, return a new list with all items that are not falsy. @@ -18,11 +15,3 @@ const fish = ['salmon', null, false, NaN, 'sockeye', 'bass'] sift(fish) // => ['salmon', 'sockeye', 'bass'] ``` - - - - - - - - diff --git a/docs/array/sort.mdx b/docs/array/sort.mdx index d13e8d0b..b407554f 100644 --- a/docs/array/sort.mdx +++ b/docs/array/sort.mdx @@ -4,34 +4,28 @@ group: 'Array' description: Sort a list of items by a property --- - - - ## Basic usage Given an array of items return a new array sorted by the property specified in the get function. A third, and optional, argument allows you to get the sort in descending order. + ```ts import { sort } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105 -}, { - name: 'Bass', - weight: 8 -}, { - name: 'Trout', - weight: 13 -}] +const fish = [ + { + name: 'Marlin', + weight: 105 + }, + { + name: 'Bass', + weight: 8 + }, + { + name: 'Trout', + weight: 13 + } +] sort(fish, f => f.weight) // => [bass, trout, marlin] sort(fish, f => f.weight, true) // => [marlin, trout, bass] ``` - - - - - - - - diff --git a/docs/array/sum.mdx b/docs/array/sum.mdx index 55d142d4..1ffabbbb 100644 --- a/docs/array/sum.mdx +++ b/docs/array/sum.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Add up all items of an array --- - - - ## Basic usage Given an array of items, and an optional function to map each item to a number, add up all the items. @@ -14,23 +11,20 @@ Given an array of items, and an optional function to map each item to a number, ```ts import { sum } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 100 -}, { - name: 'Bass', - weight: 10 -}, { - name: 'Trout', - weight: 15 -}] - -const totalWeight = sum(fish, f => f.weight) // => 125 +const fish = [ + { + name: 'Marlin', + weight: 100 + }, + { + name: 'Bass', + weight: 10 + }, + { + name: 'Trout', + weight: 15 + } +] + +sum(fish, f => f.weight) // => 125 ``` - - - - - - - diff --git a/docs/array/toggle.mdx b/docs/array/toggle.mdx new file mode 100644 index 00000000..55a21421 --- /dev/null +++ b/docs/array/toggle.mdx @@ -0,0 +1,48 @@ +--- +title: toggle +description: Toggles an items existance in an array +group: 'Array' +--- + +## Basic usage + +If the item matching the condition already exists in the list it will be removed. If it does not it will be added. + +```ts +import { toggle } from 'radash' + +const gods = ['ra', 'zeus', 'loki'] + +toggle(gods, 'ra') // => [zeus, loki] +toggle(gods, 'vishnu') // => [ra, zeus, loki, vishnu] +``` + +### toggle(list, item, identity) + +You can pass an optional `toKey` function to determine the identity of non-primitive values. Helpful when working with more complex data types. + +```ts +import { toggle } from 'radash' + +const ra = { name: 'Ra' } +const zeus = { name: 'Zeus' } +const loki = { name: 'Loki' } +const vishnu = { name: 'Vishnu' } + +const gods = [ra, zeus, loki] + +toggle(gods, ra, g => g.name) // => [zeus, loki] +toggle(gods, vishnu, g => g.name) // => [ra, zeus, loki, vishnu] +``` + +### toggle(list, item, identity, options) + +By default, toggle will append the item if it does not exist. If you need to prepend the item instead you can override the `strategy` in the options argument. + +```ts +import { toggle } from 'radash' + +const gods = ['ra', 'zeus', 'loki'] + +toggle(gods, 'vishnu', g => g, { strategy: 'prepend' }) // => [vishnu, ra, zeus, loki] +``` diff --git a/docs/array/unique.mdx b/docs/array/unique.mdx index 19b95a7c..f02e9441 100644 --- a/docs/array/unique.mdx +++ b/docs/array/unique.mdx @@ -4,9 +4,6 @@ group: 'Array' description: Remove duplicates from an array --- - - - ## Basic usage Given an array of items -- and optionally, a function to determine their identity -- return a new array without any duplicates. @@ -14,26 +11,23 @@ Given an array of items -- and optionally, a function to determine their identit ```ts import { unique } from 'radash' -const fish = [{ - name: 'Marlin', - weight: 105, - source: 'ocean' -}, { - name: 'Salmon', - weight: 22, - source: 'river' -}, { - name: 'Salmon', - weight: 22, - source: 'river' -}] +const fish = [ + { + name: 'Marlin', + weight: 105, + source: 'ocean' + }, + { + name: 'Salmon', + weight: 22, + source: 'river' + }, + { + name: 'Salmon', + weight: 22, + source: 'river' + } +] unique(fish, f => f.name) // => [marlin, salmon] ``` - - - - - - - diff --git a/docs/array/zip-to-object.mdx b/docs/array/zip-to-object.mdx new file mode 100644 index 00000000..45c4c806 --- /dev/null +++ b/docs/array/zip-to-object.mdx @@ -0,0 +1,25 @@ +--- +title: zipToObject +group: 'Array' +description: Combine multiple arrays in sets +--- + +## Basic usage + +Creates an object mapping the keys in the first array to their corresponding values in the second array. + +```ts +import { zipToObject } from 'radash' + +const names = ['ra', 'zeus', 'loki'] +const cultures = ['egypt', 'greek', 'norse'] + +zipToObject(names, cultures) +// => { ra: egypt, zeus: greek, loki: norse } + +zipToObject(names, (k, i) => k + i) +// => { ra: ra0, zeus: zeus1, loki: loki2 } + +zipToObject(names, null) +// => { ra: null, zeus: null, loki: null } +``` diff --git a/docs/array/zip.mdx b/docs/array/zip.mdx new file mode 100644 index 00000000..1516fa14 --- /dev/null +++ b/docs/array/zip.mdx @@ -0,0 +1,23 @@ +--- +title: zip +group: 'Array' +description: Combine multiple arrays in sets +--- + +## Basic usage + +Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on. + +```ts +import { zip } from 'radash' + +const names = ['ra', 'zeus', 'loki'] +const cultures = ['egypt', 'greek', 'norse'] + +zip(names, cultures) +// => [ +// [ra, egypt] +// [zeus, greek] +// [loki, norse] +// ] +``` diff --git a/docs/async/try.mdx b/docs/async/tryit.mdx similarity index 59% rename from docs/async/try.mdx rename to docs/async/tryit.mdx index a6dc241f..53484056 100644 --- a/docs/async/try.mdx +++ b/docs/async/tryit.mdx @@ -1,12 +1,9 @@ --- -title: try +title: tryit group: 'Async' description: Convert a function to an error-first async function --- - - - ## Basic usage Error-first callbacks were cool. Using mutable variables to hoist state when doing try/catch was not cool. @@ -14,29 +11,19 @@ Error-first callbacks were cool. Using mutable variables to hoist state when doi The `_.try` function let's you wrap a function to convert it to an error-first async function. ```ts -import * as _ from 'radash' +import { tryit } from 'radash' -const [err, user] = await _.try(api.users.find)(userId) +const [err, user] = await tryit(api.users.find)(userId) ``` -Note, because `try` is a reserved word this function is aliased as `try` and actually named `tryit` in the source. - ### Currying You can curry `try` if you like. ```ts -import * as _ from 'radash' +import { tryit } from 'radash' -const findUser = _.try(api.users.find) +const findUser = tryit(api.users.find) const [err, user] = await findUser(userId) ``` - - - - - - - - diff --git a/docs/curry/chain.mdx b/docs/curry/chain.mdx index b4d94be3..8106f178 100644 --- a/docs/curry/chain.mdx +++ b/docs/curry/chain.mdx @@ -4,9 +4,6 @@ group: 'Curry' description: Create a chain of function to run in order --- - - - ## Basic usage Chaining functions will cause them to execute one after another, passing the output from each function as the input to the next, returning the final output at the end of the chain. @@ -18,19 +15,7 @@ const genesis = () => 0 const addFive = (num: number) => num + 5 const twoX = (num: number) => num * 2 -const chained = chain( - genesis, - addFive, - twoX -) +const chained = chain(genesis, addFive, twoX) chained() // => 10 ``` - - - - - - - - diff --git a/docs/curry/debounce.mdx b/docs/curry/debounce.mdx index 5619b1ad..b56706d6 100644 --- a/docs/curry/debounce.mdx +++ b/docs/curry/debounce.mdx @@ -4,9 +4,6 @@ group: 'Curry' description: Create a debounced callback function --- - - - ## Basic usage Debounce accepts an options object with a `delay` and a source function to call @@ -14,7 +11,6 @@ when invoked. When the returned function is invoked it will only call the source function after the `delay` milliseconds of time has passed. Calls that don't result in invoking the source reset the delay, pushing off the next invocation. - ```ts import { debounce } from 'radash' @@ -37,9 +33,27 @@ debounce Invocations: x x x x - - - - - - - - x x x x x x x x x x - - - - - - - Source Invocations: - - - - - - - - - - x - - - - - - - - - - - - - - - - - x - - - - - ``` +### Cancel + +The function returned by `debounce` has a `cancel` property, a function that when called will permanently stop the source function from being debounced. + +```ts +const debounced = debounce({ delay: 100 }, api.feed.refresh) + +// ... sometime later + +debounced.cancel() +``` +### Flush +The function returned by `debounce` has a `flush` property, a function that when called will directly invoke the source function. +```ts +const debounced = debounce({ delay: 100 }, api.feed.refresh) +// ... sometime later +debounced.flush(event) +``` diff --git a/docs/object/assign.mdx b/docs/object/assign.mdx new file mode 100644 index 00000000..83397e16 --- /dev/null +++ b/docs/object/assign.mdx @@ -0,0 +1,21 @@ +--- +title: assign +description: Merges two objects together recursivly +group: Object +--- + +## Basic usage + +Merges two objects together recursivly into a new object applying values from right to left. Recursion only applies to child object properties. + +```ts +import { assign } from 'radash' + +const ra = { + name: 'Ra', + power: 100 +} + +assign(ra, { name: 'Loki' }) +// => { name: Loki, power: 100 } +``` diff --git a/docs/object/clone.mdx b/docs/object/clone.mdx new file mode 100644 index 00000000..f79b81d8 --- /dev/null +++ b/docs/object/clone.mdx @@ -0,0 +1,23 @@ +--- +title: clone +description: Creates a shallow copy of the given obejct/value. +group: Object +--- + +## Basic usage + +Creates a shallow copy of the given obejct/value. + +```ts +import { clone } from 'radash' + +const ra = { + name: 'Ra', + power: 100 +} + +const gods = [ra] + +clone(ra) // => copy of ra +clone(gods) // => copy of gods +``` diff --git a/docs/object/get.mdx b/docs/object/get.mdx index dad4df20..1d926c3d 100644 --- a/docs/object/get.mdx +++ b/docs/object/get.mdx @@ -23,5 +23,5 @@ const fish = { ] } -const maxAdultSize = get(fish, f => f.sizes[0].range[1]) +const maxAdultSize = get(fish, 'sizes[0].range[1]') // => 18 ``` diff --git a/docs/series/series.mdx b/docs/series/series.mdx index e8682e37..cab4e063 100644 --- a/docs/series/series.mdx +++ b/docs/series/series.mdx @@ -13,13 +13,13 @@ import { series } from 'radash' type Weekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' -const weekdays = series( +const weekdays = series([ 'monday', 'tuesday', 'wednesday', 'thursday', 'friday' -) +]) weekdays.min('tuesday', 'thursday') // => 'tuesday' weekdays.max('wednesday', 'monday') // => 'wednesday' @@ -29,4 +29,31 @@ weekdays.first() // => 'monday' weekdays.last() // => 'friday' weekdays.next('friday') // => null weekdays.next('friday', weekdays.first()) // => 'monday' +weekdays.spin('monday', 3) // => 'thursday' +``` + +## Complex Data Types + +When working with objects you'll want to provide a second argument to `series`, a function that converts non-primitive values into an identity that can be checked for equality. + +```ts +import { series } from 'radash' + +type Weekday = { + day: 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' +} + +const weekdays = series( + [ + { day: 'monday' }, + { day: 'tuesday' }, + { day: 'wednesday' }, + { day: 'thursday' }, + { day: 'friday' } + ], + w => w.day +) + +weekdays.next({ day: 'wednesday' }) // => { day: 'thursday' } +weekdays.previous({ day: 'tuesday' }) // => { day: 'monday' } ``` diff --git a/docs/string/pascal.mdx b/docs/string/pascal.mdx new file mode 100644 index 00000000..9246f3ec --- /dev/null +++ b/docs/string/pascal.mdx @@ -0,0 +1,16 @@ +--- +title: pascal +description: Convert a string to pascal case +group: String +--- + +## Basic usage + +Formats the given string in pascal case fashion. + +```ts +import { pascal } from 'radash' + +pascal('hello world') // => 'HelloWorld' +pascal('va va boom') // => 'VaVaBoom' +``` diff --git a/docs/string/title.mdx b/docs/string/title.mdx new file mode 100644 index 00000000..1656d0e2 --- /dev/null +++ b/docs/string/title.mdx @@ -0,0 +1,18 @@ +--- +title: title +description: Convert a string to title case +group: String +--- + +## Basic usage + +Formats the given string in title case fashion + +```ts +import { title } from 'radash' + +title('hello world') // => 'Hello World' +title('va_va_boom') // => 'Va Va Boom' +title('root-hook') // => 'Root Hook' +title('queryItems') // => 'Query Items' +``` diff --git a/docs/string/trim.mdx b/docs/string/trim.mdx new file mode 100644 index 00000000..58282b9f --- /dev/null +++ b/docs/string/trim.mdx @@ -0,0 +1,17 @@ +--- +title: trim +description: Trim values from a string +group: String +--- + +## Basic usage + +Trims all prefix and suffix characters from the given string. Like the builtin trim function but accepts other characters you would like to trim. + +```ts +import { trim } from 'radash' + +trim(' hello ') // => 'hello' +trim('__hello__', '_') // => 'hello' +trim('/repos/:owner/:repo/', '/') // => 'repos/:owner/:repo' +``` diff --git a/docs/typed/is-date.mdx b/docs/typed/is-date.mdx new file mode 100644 index 00000000..db112ae4 --- /dev/null +++ b/docs/typed/is-date.mdx @@ -0,0 +1,17 @@ +--- +title: isDate +description: 'Determine if a value is a Date' +group: Typed +--- + +## Basic usage + +Determine if a value is a Date. Does not check that the input date is valid, only that it is a Javascript Date type. + +```ts +import { isDate } from 'radash' + +isDate(new Date()) // => true +isDate(12) // => false +isDate('hello') // => false +``` diff --git a/docs/typed/is-empty.mdx b/docs/typed/is-empty.mdx index 58fb125d..03d7cc6a 100644 --- a/docs/typed/is-empty.mdx +++ b/docs/typed/is-empty.mdx @@ -11,6 +11,9 @@ Pass in a value and get a boolean telling you if the value is empty. ```ts import { isEmpty } from 'radash' -isEmpty('hello') // => false +isEmpty([]) // => true +isEmpty('') // => true + +isEmpty('hello') // => false isEmpty(['hello']) // => false ``` diff --git a/docs/typed/is-equal.mdx b/docs/typed/is-equal.mdx new file mode 100644 index 00000000..880a798c --- /dev/null +++ b/docs/typed/is-equal.mdx @@ -0,0 +1,19 @@ +--- +title: isEqual +description: Determine if two values are equal +group: Typed +--- + +## Basic usage + +Given two values, returns true if they are equal. + +```ts +import { isEqual } from 'radash' + +isEqual(null, null) // => true +isEqual([], []) // => true + +isEqual('hello', 'world') // => false +isEqual(22, 'abc') // => false +``` diff --git a/docs/typed/is-float.mdx b/docs/typed/is-float.mdx new file mode 100644 index 00000000..69de1dc8 --- /dev/null +++ b/docs/typed/is-float.mdx @@ -0,0 +1,17 @@ +--- +title: isFloat +description: 'Determine if a value is a float' +group: Typed +--- + +## Basic usage + +Pass in a value and get a boolean telling you if the value is a float. + +```ts +import { isFloat } from 'radash' + +isFloat(12.233) // => true +isFloat(12) // => false +isFloat('hello') // => false +``` diff --git a/docs/typed/is-int.mdx b/docs/typed/is-int.mdx new file mode 100644 index 00000000..e05e375e --- /dev/null +++ b/docs/typed/is-int.mdx @@ -0,0 +1,17 @@ +--- +title: isInt +description: 'Determine if a value is an int' +group: Typed +--- + +## Basic usage + +Pass in a value and get a boolean telling you if the value is an int. + +```ts +import { isInt } from 'radash' + +isInt(12) // => true +isInt(12.233) // => false +isInt('hello') // => false +``` diff --git a/docs/typed/is-primitive.mdx b/docs/typed/is-primitive.mdx new file mode 100644 index 00000000..a19d2f39 --- /dev/null +++ b/docs/typed/is-primitive.mdx @@ -0,0 +1,19 @@ +--- +title: isPrimitive +description: Checks if the given value is primitive +group: Typed +--- + +## Basic usage + +Checks if the given value is primitive. + +Primitive Types: number , string , boolean , symbol, bigint, undefined, null + +```ts +import { isPrimitive } from 'radash' + +isPrimitive(22) // => true +isPrimitive('hello') // => true +isPrimitive(['hello']) // => false +``` diff --git a/package.json b/package.json index d544e4a4..401fc4c0 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "check": "yarn lint && yarn test && yarn build", "build": "yarn tsc --noEmit && yarn rollup -c", "docs:install": "yarn && yarn add --dev next@12.3.4", - "docs:build": "chiller install && chiller sync && ls -al ./.chiller/app/public/docs && chiller build", + "docs:build": "chiller build --ci", "lint": "tslint -p tsconfig.json", "format": "prettier --write \"./**/*.ts\"", "format:check": "prettier --check \"**/*.ts\" --ignore-unknown" @@ -35,7 +35,7 @@ "@types/chai": "^4.3.3", "@types/jest": "^28.1.1", "chai": "^4.3.6", - "chiller": "^1.0.0-rc.27", + "chiller": "^1.0.0-rc.30", "esbuild": "^0.16.3", "jest": "^28.1.3", "prettier": "^2.7.1", diff --git a/yarn.lock b/yarn.lock index 05ce2bf1..e3a9ad81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -828,6 +828,14 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" @@ -905,6 +913,11 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" @@ -920,7 +933,7 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2: +braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -1021,12 +1034,13 @@ check-error@^1.0.2: resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -chiller@^1.0.0-rc.27: - version "1.0.0-rc.27" - resolved "https://registry.yarnpkg.com/chiller/-/chiller-1.0.0-rc.27.tgz#9f275b45ba6305126a03d4611bf712247b9415f3" - integrity sha512-o1ykedCKpa/+bsKUocXj9HHIwj1uXnor491yIUKq+aoyZW2bXokaat3CNOHu0UZELJUeq+0UdUCtYNJFFI2CMA== +chiller@^1.0.0-rc.30: + version "1.0.0-rc.30" + resolved "https://registry.yarnpkg.com/chiller/-/chiller-1.0.0-rc.30.tgz#5098aff4d3216c7d85cedfbeb2c32a571d48f690" + integrity sha512-pF0QSdHWozhXGN9ywDjMkNK5XBAr4VqG2T5EFbLo4OCjiKu78ERfNCm19pSw9BkBdSL5jPpZuSJ6QBlZEC6frg== dependencies: chalk "4.1.2" + chokidar "^3.5.3" cmdish "^1.1.0" commander "^9.4.1" fs-extra "^11.1.0" @@ -1034,6 +1048,21 @@ chiller@^1.0.0-rc.27: radash "^10.3.2" zod "^3.20.2" +chokidar@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + ci-info@^3.2.0: version "3.5.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz" @@ -1347,6 +1376,13 @@ get-stream@^6.0.0: resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" @@ -1438,6 +1474,13 @@ is-arrayish@^0.2.1: resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" @@ -1445,6 +1488,11 @@ is-core-module@^2.9.0: dependencies: has "^1.0.3" +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" @@ -1455,6 +1503,13 @@ is-generator-fn@^2.0.0: resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" @@ -2048,7 +2103,7 @@ node-releases@^2.0.6: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz" integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== -normalize-path@^3.0.0: +normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== @@ -2140,7 +2195,7 @@ picocolors@^1.0.0: resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -2195,6 +2250,13 @@ react-is@^18.0.0: resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"