Comments (7)
Hey @brandongregoryscott, sorry for holding you back. I actually haven't looked into this issue. Let me get back to you this afternoon on this.
from andculturecode.javascript.core.
Yup. value?: string
with type predicate value is ""
is equivalent to value: null | undefined | string
with type predicate value is null | undefined | ''
so the optional parameter actually helps taking care of that. PR is coming in a bit
from andculturecode.javascript.core.
I will look into this
from andculturecode.javascript.core.
Thanks @nhinhdao! No rush, I was just excited to use the new guards! 😂
from andculturecode.javascript.core.
@nhinhdao How's this coming? I am holding back on pushing out a new version w/ the JSDoc + RecordUtils
type guard since it won't be of much use with the way the type guard for isEmpty
currently stands
from andculturecode.javascript.core.
@brandongregoryscott I have found the workaround for this case by using literal type for string;
this type predicate will narrow value to be null | undefined | ''
which works well for this case
from andculturecode.javascript.core.
Woah, that's awesome 👍 Is it actually bound to null | undefined | ''
with the type guard of value is ''
? As long as we don't have to start non-null asserting after isEmpty
returns false, then we should be good to go. Do you want to send out a PR for this, or would you like me to pick it up?
from andculturecode.javascript.core.
Related Issues (20)
- npm run watch no longer runs tsc --watch
- Add type guard for RecordUtils.isRecord
- Add Lodash chunk and flatten to collection utils HOT 1
- Add 'Cache-Control' HttpHeader enum
- Add functionality to pull culture from route HOT 1
- Fix skipped LocalizationUtils.detectCultureCode test
- Reevaluate production vs. peer/dev dependencies HOT 4
- Allow consumer to control 'debug' option for LocalizationUtils/i18next
- Move + export LocalizationInitOptions interface from LocalizationUtils
- Implement network information utilities
- Update README with section on internationalization
- Lighten peer dependency version further
- ReferenceError exception when window is not defined HOT 1
- Add null to the collection type and type guard
- AuditableDefaultValues / Factory for requiring properties to be set
- Upgrade node requirement to v16 LTS HOT 1
- Add 'Content-Length' HttpHeader enum
- Slow workflow/npm install for cypress HOT 2
- Add AriaRole Enum to /src/enumerations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from andculturecode.javascript.core.