Comments (2)
// @krnik
from type-fest.
Hi, I'll respond and try to fix the code on 7th Sept.
But, what's happening here is most likely caused by TypeScripts' 3.5 Fixes to unsound writes to indexed access types
.
It's not really an access issue but assign issue. Since simply accessing the property by key
works fine.
Any ideas why accessing and assigning gives different types?
const x = this.configuration[key]; // string | number
this.configuration[key] /* string & number */ = <value>; // TS 3.5
this.configuration[key] /* never */ = <value>; // TS 3.6
Edit:
Related TS PR link
In a nut shell: indexed key assignment is more strict (sinze 3.5) and allows only writes that are certain to give correct result.
from type-fest.
Related Issues (20)
- `PackageJson`: Why properties like `name` and `version` are not required? HOT 1
- `Get<BaseType, Path>` does not work when `Path` contains `${number}` HOT 1
- [Feature Request] Enforce Casing
- Add ConditionalKeys variation where Condition matches any in a union rather than all HOT 1
- NonNullableDeep
- SetRequiredDeep - is it possible? HOT 1
- Feature Request (or bug report?) - Get the last key of a record
- [4.10.0][Regression] failure when type checking with exactOptionalPropertyTypes HOT 5
- IntRange Inclusive HOT 3
- Weird bug report - RangeError: Maximum call stack size exceeded when building HOT 1
- Update Merge type to accept N type arguments HOT 1
- Maintenance strategy: Considering splitting `type-fest` into smaller importable parts HOT 14
- OptionalExcept type HOT 2
- Why do we need to specify the `engines` field in package.json? HOT 1
- Require exactly one key of type `string` HOT 1
- Bug: Nextjs and type-fest camel-case.d.ts Type error: '?' expected.
- `JsonValue` can receive `type` but not `interface` HOT 1
- CamelCasedObjectDeep breaks tuple-types into array-types
- `UnionToUnorderedTuple` type HOT 2
- `NonEmptyObject` fails for objects with dynamic properties HOT 2
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 type-fest.