File tree Expand file tree Collapse file tree 5 files changed +27
-11
lines changed Expand file tree Collapse file tree 5 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 107
107
"immer" : " ^10.0.1" ,
108
108
"redux" : " 5.0.0-alpha.5" ,
109
109
"redux-thunk" : " 3.0.0-alpha.3" ,
110
- "reselect" : " ^4.1.8" ,
111
- "uncheckedindexed" : " ^0.0.1"
110
+ "reselect" : " ^4.1.8"
112
111
},
113
112
"peerDependencies" : {
114
113
"react" : " ^16.9.0 || ^17.0.0 || ^18" ,
Original file line number Diff line number Diff line change 1
- import type { UncheckedIndexedAccess } from 'uncheckedindexed'
1
+ import type { UncheckedIndexedAccess } from '../ uncheckedindexed'
2
2
import type { PayloadAction } from '../createAction'
3
3
import type { CastAny , Id } from '../tsHelpers'
4
4
Original file line number Diff line number Diff line change
1
+ // inlined from https://github.com/EskiMojo14/uncheckedindexed
2
+ // relies on remaining as a TS file, not .d.ts
3
+ type IfMaybeUndefined < T , True , False > = [ undefined ] extends [ T ] ? True : False
4
+
5
+ const testAccess = ( { } as Record < string , 0 > ) . a
6
+
7
+ export type IfUncheckedIndexedAccess < True , False > = IfMaybeUndefined <
8
+ typeof testAccess ,
9
+ True ,
10
+ False
11
+ >
12
+
13
+ export type UncheckedIndexedAccess < T > = IfUncheckedIndexedAccess <
14
+ T | undefined ,
15
+ T
16
+ >
Original file line number Diff line number Diff line change @@ -196,6 +196,15 @@ export default defineConfig((options) => {
196
196
if ( format === 'cjs' && name === 'production.min' ) {
197
197
writeCommonJSEntry ( outputFolder , prefix )
198
198
} else if ( generateTypedefs ) {
199
+ if ( folder === '' ) {
200
+ // we need to delete the declaration file and replace it with the original source file
201
+ fs . rmSync ( path . join ( outputFolder , 'uncheckedindexed.d.ts' ) )
202
+
203
+ fs . copyFileSync (
204
+ 'src/uncheckedindexed.ts' ,
205
+ path . join ( outputFolder , 'uncheckedindexed.ts' )
206
+ )
207
+ }
199
208
// TODO Copy/generate `.d.mts` files?
200
209
// const inputTypedefsFile = `${outputFilename}.d.ts`
201
210
// const outputTypedefsFile = `${outputFilename}.d.mts`
Original file line number Diff line number Diff line change @@ -6793,7 +6793,6 @@ __metadata:
6793
6793
tsup: ^6.7.0
6794
6794
tsx: ^3.12.2
6795
6795
typescript: ~4.9
6796
- uncheckedindexed: ^0.0.1
6797
6796
vitest: ^0.30.1
6798
6797
yargs: ^15.3.1
6799
6798
peerDependencies:
@@ -28409,13 +28408,6 @@ fsevents@^1.2.7:
28409
28408
languageName: node
28410
28409
linkType: hard
28411
28410
28412
- "uncheckedindexed@npm:^0.0.1":
28413
- version: 0.0.1
28414
- resolution: "uncheckedindexed@npm:0.0.1"
28415
- checksum: 66cf7c42df36eeb8520de61ed16df0b1506bb40ede645d9c146672799d2392a3ad8c7b54131b07ff764414dcc12bd74eca90c3fdf13f19631181e6198f916075
28416
- languageName: node
28417
- linkType: hard
28418
-
28419
28411
"unherit@npm:^1.0.4":
28420
28412
version: 1.1.3
28421
28413
resolution: "unherit@npm:1.1.3"
You can’t perform that action at this time.
0 commit comments