You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add type guards for various data types and implement behavioral tests (#9)
* feat: add type guards for various data types and implement behavioral tests
- Implemented `isNonEmptyArray`, `isNonEmptyArrayOf`, `isNonEmptyString`, `isNull`, `isNullOrUndefined`, `isNullish`, `isNumber`, `isObject`, `isPlainObject`, `isPromise`, `isRegExp`, `isSet`, `isString`, `isSymbol`, `isThenable`, `isUndefined`, `isValidDate` guards.
- Created comprehensive tests for each guard using Vitest, ensuring positive and negative cases are covered.
- Introduced helper functions for behavioral contract testing to streamline test case definitions.
- Enhanced existing guards with improved type checks and error handling.
- Added type tests to validate type narrowing functionality for various guards.
- Updated `index.ts` to export new guards and maintain module integrity.
* chore: refactoring ftw with tighter code
* refactor: reorganize benchmark and test descriptions for clarity
* chore: update release workflow to trigger on manual dispatch only
* feat: add dependabot configuration for npm and GitHub Actions updates
* feat: add consumer fixtures and smoke tests for type guards
* refactor: update smoke tests to use ESM and improve package handling
* chore: update Node.js version requirement to 20 in package files and CI configuration
* refactor: update Node.js version requirements and improve test imports
* feat: add benchmarks section to README and update package dependencies
|`isString` on string |`39.02 ns`|`19,608,415 ops/s`|
107
+
|`isNumber` on number |`37.68 ns`|`20,371,720 ops/s`|
108
+
|`isPlainObject` on object |`37.85 ns`|`20,250,036 ops/s`|
109
+
|`createEnumGuard` result on enum value |`39.55 ns`|`19,332,792 ops/s`|
110
+
111
+
These are indicative micro-benchmark results from a single local machine. They are useful for relative comparisons inside this repository, not as a guarantee of identical performance in other runtimes or workloads.
80
112
81
113
## Development
82
114
83
115
```bash
116
+
npm run verify
117
+
npm run test:coverage
118
+
npm run build
119
+
npm run bench
120
+
npm run changeset
121
+
npm run changeset:version
122
+
npm run changeset:publish
123
+
```
124
+
125
+
## Verification
126
+
127
+
```bash
128
+
npm run format:check
129
+
npm run lint
130
+
npm run typecheck
84
131
npm test
85
132
npm run build
133
+
npm run test:package
134
+
npm run package:quality
135
+
npm run test:coverage
86
136
```
137
+
138
+
## Releases
139
+
140
+
-`npm run changeset` creates a release note entry for a package change.
141
+
-`npm run changeset:version` applies pending changesets and updates the changelog.
142
+
-`npm run release:publish` runs the full verification stack, coverage, and publishes through Changesets.
143
+
-`.github/workflows/release.yml` is a manual `workflow_dispatch` workflow for optional release publishing.
0 commit comments