antfu

utils

Collection of common JavaScript / TypeScript utils

by antfu

TypeScript

TypeScript99.5%
JavaScript0.5%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template✓PR Template

Recent PRs & issues

Quiet · 2 in progress · Last activity 1y ago
See all on GitHub →
yfwmaniish

Bug Closes #49. loops forever when is negative, because the loop condition is hard-coded to the positive direction: Behavior Positive-step and zero-step behavior is unchanged; negative steps now count down (matching the intuitive/Python-like semantics) instead of hanging. Tests Extended the test with the reporter's case and descending ranges. Full suite passes (), lint clean.

yfwmaniish · 2mo ago
maxtaran2010

Summary The function uses when doing named substitution, which causes it to fall through to the fallback value whenever a variable is explicitly set to a falsy value — , , or . Buggy behavior:** Fix Replace with so only keys that are actually absent from trigger the fallback, not keys that are present but hold a falsy value. Test plan [x] Added test cases for , , and values in named template mode [x] All existing tests continue to pass ( — 39 tests passing)

maxtaran2010 · 4mo ago
NamesMT

Describe the bug Output types of is broken, observed with plain simple primitive and typed variable. Reproduction https://github.com/NamesMT/starter-ts/tree/antfu/utils_repro System Info Used Package Manager pnpm Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead. [x] The provided reproduction is a minimal reproducible of the bug. Contributions [ ] I am willing to submit a PR to fix this issue [ ] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

NamesMT · 1y ago
NamesMT

Clear and concise description of the problem Would be amazing if the package includes a util to convert a string to an URL-slug, it's pretty commonly used when building ECOM / content-centric web applications. Suggested solution Probably something like: I've been using the above snippet for a few projects, haven't hit any weird cases yet. Alternative _No response_ Additional context _No response_ Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

NamesMT · 1y ago
s3xybun

Describe the bug Return type of cannot be using as keys of generic object type. There is a PR related to this #17. Reproduction typescript playground System Info Used Package Manager pnpm Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead. [x] The provided reproduction is a minimal reproducible of the bug. Contributions [x] I am willing to submit a PR to fix this issue [x] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

s3xybun · 1y ago
Structured data for AI agents

Repository: antfu/utils. Description: Collection of common JavaScript / TypeScript utils Stars: 873, Forks: 68. Primary language: TypeScript. Languages: TypeScript (99.5%), JavaScript (0.5%). License: MIT. Latest release: v9.3.0 (1y ago). Open PRs: 2, open issues: 5. Last activity: 1y ago. Community health: 85%. Top contributors: antfu, johannschopplich, NamesMT, Wing-9527, LuciNyan, s3xybun, liuyang0826, jbaubree, akinoccc, xiaoxiangmoe and others.