Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add pnpm add-function command #54

Merged
merged 2 commits into from
Jul 1, 2024
Merged

Conversation

aleclarson
Copy link
Member

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Contributors can now run pnpm add-function to automatically set up the files required for adding a new function to Radashi!

Note: You will need to manually export your function from src/mod.ts before you can use it.

pnpm add-function <group-name>/<function-name>

# Example
pnpm add-function array/filter

Details:

  • If you accidentally type a group name that doesn't exist, the script will ask you if that was intentional.
  • It creates a file in the following directories: src, tests, docs, and benchmarks
  • It asks you for a short description of the function, which is displayed on the official website (once it‘s been finished 😉).

Related issue, if any:

What kind of change does this PR introduce?

Other

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

No

Copy link

codspeed-hq bot commented Jul 1, 2024

CodSpeed Performance Report

Congrats! CodSpeed is installed 🎉

🆕 191 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks

  • with ascending order (52 µs)
  • with descending order (51.9 µs)
  • with empty array (16 µs)
  • with non-empty array (35 µs)
  • specified cluster size of 3 (33.9 µs)
  • with default cluster size (33.9 µs)
  • with valid input (37.8 µs)
  • with entirely different arrays (34.2 µs)
  • with identity function (76.7 µs)
  • with empty array and a default value (15.6 µs)
  • with non-empty array (27.2 µs)
  • with non-empty input list (26.3 µs)
  • with empty array (23.8 µs)
  • with non-empty array (41.8 µs)
  • with groups by provided attribute (213.6 µs)
  • with custom identity function (38.8 µs)
  • with mixed arrays (22.4 µs)
  • with no common items (35.4 µs)
  • with object arrays (55.3 µs)
  • with valid input (24.1 µs)
  • with empty list (15.5 µs)
  • with valid input (27.4 µs)
  • with custom step (252.2 µs)
  • with default step (45.1 µs)
  • with function fill (41.6 µs)
  • with object fill (57.1 µs)
  • with string fill (40.2 µs)
  • with list of numbers (28.7 µs)
  • with list of objects (48.6 µs)
  • with complex inputs (51.5 µs)
  • with two empty array inputs (18 µs)
  • with list of numbers (28.5 µs)
  • with list of objects (48.6 µs)
  • with empty list (18.5 µs)
  • with full list and identity value function (60.3 µs)
  • with custom step (16.9 µs)
  • with custom value generator (17 µs)
  • with default step (16.8 µs)
  • with item by index (32.3 µs)
  • with item in a list of objects (41.5 µs)
  • with undefined new item (18.2 µs)
  • append item (27.2 µs)
  • with item at end (30.8 µs)
  • with item at start (34.8 µs)
  • with item in middle (220.9 µs)
  • with empty input list (18.3 µs)
  • with index (40.5 µs)
  • with non-empty input list (53.1 µs)
  • without a condition callback (49.6 µs)
  • with empty input list (18.3 µs)
  • with index (30.2 µs)
  • with non-empty input list (37.1 µs)
  • without a condition callback (51.1 µs)
  • with empty array (15.2 µs)
  • with non-empty array (30.5 µs)
  • with non-empty array (28.1 µs)
  • with ascending order (46.6 µs)
  • with descending order (46.5 µs)
  • with list of numbers (20.9 µs)
  • with list of objects (32.6 µs)
  • with item that does exist (29.4 µs)
  • with item that does exist and custom matcher (45.6 µs)
  • with item that does not exist (27.4 µs)
  • with item that does not exist and custom matcher (36.8 µs)
  • with strategy prepend (45.9 µs)
  • with key fn (235.1 µs)
  • with non-empty array (23.1 µs)
  • with non-empty arrays (53.4 µs)
  • with custom map function (40.8 µs)
  • with non-empty arrays (30.5 µs)
  • with only one value (37.8 µs)
  • with non-empty range (23.4 µs)
  • with two params (20.3 µs)
  • to default precision (0 decimal places) (19 µs)
  • with out-of-bounds precision (40.6 µs)
  • with very small numbers close to zero (37.9 µs)
  • with string (20.1 µs)
  • with undefined (14.8 µs)
  • with string (18.8 µs)
  • with undefined (14.6 µs)
  • with valid input (270.3 µs)
  • with class instance (66.5 µs)
  • with object (42.5 µs)
  • with valid input (157.3 µs)
  • with valid input (192.7 µs)
  • with array of keys (31.9 µs)
  • with class instance (63.6 µs)
  • with filter callback (34.5 µs)
  • with array index path (231.5 µs)
  • with default value (54.7 µs)
  • with simple path (124.8 µs)
  • with undefined nested path and default value (33.9 µs)
  • with empty object (21 µs)
  • with non-empty object (33.3 µs)
  • with empty object (29.7 µs)
  • with non-empty object (112.7 µs)
  • with empty object (19.9 µs)
  • with non-empty object (47.7 µs)
  • with valid input (38.9 µs)
  • with valid input (51.9 µs)
  • with valid input (36.1 µs)
  • with valid input (34.6 µs)
  • with empty keys (15.5 µs)
  • with specific keys (29.6 µs)
  • with empty keys (25 µs)
  • with key not in object (32 µs)
  • with one key not in object (34.5 µs)
  • with array index path (101.1 µs)
  • with deep path (50 µs)
  • with numeric key (51.7 µs)
  • with simple path (40.4 µs)
  • with filter function input (43.5 µs)
  • with valid input (54.4 µs)
  • with valid input (40.8 µs)
  • with valid input (24.6 µs)
  • with valid input (20.4 µs)
  • with valid input (221.1 µs)
  • with special characters (40.7 µs)
  • with valid input (45.3 µs)
  • get first item (11.1 µs)
  • get last item (11.7 µs)
  • max of two items (12.9 µs)
  • min of two items (18.1 µs)
  • get next item (12.5 µs)
  • get previous item (12.5 µs)
  • spin by negative number (206 µs)
  • spin by positive number (45.5 µs)
  • spin by zero (11.3 µs)
  • with valid input (42.8 µs)
  • with valid input (24.1 µs)
  • with valid input (39 µs)
  • with valid input (39.7 µs)
  • with numbers and special characters (no split on number) (58.5 µs)
  • with valid input (116 µs)
  • with valid input (42.8 µs)
  • with valid input (48.7 µs)
  • with a specified character (36.6 µs)
  • with two special characters (40.9 µs)
  • with valid input (40.3 µs)
  • with invalid input (25.6 µs)
  • with non-Date value (19.5 µs)
  • with valid input (24.5 µs)
  • with empty object (43.5 µs)
  • with empty string (35.5 µs)
  • with non-empty object (37.6 µs)
  • with non-empty string (30.3 µs)
  • with null (14.7 µs)
  • with arrays (130.1 µs)
  • with complex objects (201.9 µs)
  • with numbers (120.5 µs)
  • with objects (110.3 µs)
  • with strings (129.9 µs)
  • with float (29.1 µs)
  • with integer (19.6 µs)
  • with non-number value (19.6 µs)
  • with anonymous function (15.1 µs)
  • with arrow function (15.2 µs)
  • with named function (15.1 µs)
  • with null (14.6 µs)
  • with integer (19.5 µs)
  • with non-integer (19.8 µs)
  • with non-number value (29.2 µs)
  • with decimal string (22.3 µs)
  • with integer string (20.5 µs)
  • with non-numeric string (29.5 µs)
  • with float (17.9 µs)
  • with integer (17.8 µs)
  • with non-number (18 µs)
  • with null (18 µs)
  • with class instance (34.5 µs)
  • with null (14.7 µs)
  • with object literal (18.5 µs)
  • with Object.create(null) (21.4 µs)
  • with namespace object (21.1 µs)
  • with non-plain object (Date) (23.8 µs)
  • with non-plain object (arguments) (43.7 µs)
  • with null (14.9 µs)
  • with object literal (21.3 µs)
  • with non-primitive (21.4 µs)
  • with null (14.6 µs)
  • with primitive (14.8 µs)
  • with Promise (22.5 µs)
  • with Promise-like (28.1 µs)
  • with non-Promise (28 µs)
  • with null (18.8 µs)
  • with number (18.8 µs)
  • with object (19 µs)
  • with string (14.6 µs)
  • with Symbol instance (21 µs)
  • with empty object (18.6 µs)
  • with null (14.6 µs)

@aleclarson aleclarson merged commit 46ea682 into main Jul 1, 2024
2 of 6 checks passed
aleclarson added a commit that referenced this pull request Jul 1, 2024
@aleclarson aleclarson added the maintenance An improvement to codebase maintainability label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance An improvement to codebase maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant