duck-nukem / optional-type Goto Github PK
View Code? Open in Web Editor NEWJava's Optional coming to Typescript
License: MIT License
Java's Optional coming to Typescript
License: MIT License
Is your feature request related to a problem? Please describe.
In JS world, undefined is more common than null - it would be nice if we could work with that.
Describe the solution you'd like
A new public API method for handling both null & undefined
Describe the bug
Not a bug, just not high quality code
To Reproduce
Check isTypeInvalid()
implementation
Expected behavior
Current implementation is:
private isTypeInvalid<T>(value: Undefinable<T>): boolean {
const valueType = String(value) as JavascriptRepresentation;
const isInvalidType = this.invalidTypes.has(valueType);
const isWhiteListed = !this.allowedInvalidTypes.has(valueType);
return isInvalidType && isWhiteListed;
}
As you can see it doesn't make sense to return isWhiteListed
for the name of the method. It should be !isWhiteListed
in the return, and the variable should lose the negation
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
N/A
23.10.0
to 23.10.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
ts-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 13 commits.
d9c5b45
Merge pull request #743 from huafu/release/23.10.1
e4a3a09
chore(release): 23.10.1
ab94359
Merge pull request #742 from huafu/fix-740-no-js-compilation-with-allow-js
a844fd4
Merge branch 'master' into fix-740-no-js-compilation-with-allow-js
18dced1
Merge pull request #741 from huafu/e2e-weird-deep-paths
9e7d6a0
test(config): adds test related to allowJs
374dca1
fix(compile): js files were never transpiled thru TS
70fd9af
ci(cache): removes some paths from the caching
c12dfff
fix(windows): normalize paths
0141098
test(e2e): deep paths and coverage
6ccbff3
Merge pull request #736 from huafu/detect-import-and-throw-if-none
a2a4be2
fix(config): warn instead of forcing ESM interoperability
21644da
Merge pull request #735 from huafu/master
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.