-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: BREAKING_CHANGE rewrite in typescript #19
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: tsd@0.28.1 |
49e3c5f
to
20bd302
Compare
Codecov Report
@@ Coverage Diff @@
## master #19 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 1 7 +6
Lines 125 769 +644
Branches 23 81 +58
==========================================
+ Hits 125 769 +644
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
package.json
Outdated
"typescript": "^5.1.6" | ||
}, | ||
"dependencies": { | ||
"@types/long": "^5.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependencies 不需要加
type Primitive = string | number | bigint | boolean | symbol | null | undefined; | ||
type Nullable = null | undefined; | ||
|
||
export function isString(val?: unknown): val is string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val is string
学习了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
断言的时候用 asserts 也很好用,类型确定 https://blog.logrocket.com/assertion-functions-typescript/
文档也写完了 |
2.0.0 released |
[skip ci] ## [2.0.0](v1.4.0...v2.0.0) (2023-07-28) ### ⚠ BREAKING CHANGES * drop Node.js <= 14 ### Features * rewrite in typescript ([#19](#19)) ([58b5703](58b5703))
This Pull Request is rewriting code in Typescript
New Feature
ES Module Import
use default export
compatible with commonjs
use checking method directly, using
isString('')
is better thanstring('')
Type Guard
Accroding to https://www.typescriptlang.org/docs/handbook/2/narrowing.html, support type checking
New API
Breaking Change