chore: Update to latest TypeScript and make sure instructions work

This commit is contained in:
Glen Whitney 2023-08-18 10:36:11 -07:00
parent cc1e66c054
commit f06943ba1a
5 changed files with 33 additions and 9 deletions

View File

@ -6,5 +6,6 @@ To build and run the prototype, run:
``` ```
npx tsc npx tsc
echo '{"type": "module"}' > obj/package.json
node obj node obj
``` ```

View File

@ -18,6 +18,8 @@
url: 'https://code.studioinfinity.org/glen/typocomath.git', url: 'https://code.studioinfinity.org/glen/typocomath.git',
}, },
devDependencies: { devDependencies: {
typescript: '^4.9.3', '@types/node': '^20.5.0',
'source-map': '^0.7.4',
typescript: '^5.1.6',
}, },
} }

View File

@ -1,15 +1,33 @@
lockfileVersion: 5.4 lockfileVersion: '6.0'
specifiers: settings:
typescript: ^4.9.3 autoInstallPeers: true
excludeLinksFromLockfile: false
devDependencies: devDependencies:
typescript: 4.9.3 '@types/node':
specifier: ^20.5.0
version: 20.5.0
source-map:
specifier: ^0.7.4
version: 0.7.4
typescript:
specifier: ^5.1.6
version: 5.1.6
packages: packages:
/typescript/4.9.3: /@types/node@20.5.0:
resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} resolution: {integrity: sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q==}
engines: {node: '>=4.2.0'} dev: true
/source-map@0.7.4:
resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==}
engines: {node: '>= 8'}
dev: true
/typescript@5.1.6:
resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==}
engines: {node: '>=14.17'}
hasBin: true hasBin: true
dev: true dev: true

View File

@ -3,3 +3,5 @@ import type {Dependencies, Signature} from '../interfaces/type.js'
export const square = export const square =
<T>(dep: Dependencies<'multiply', T>): Signature<'square', T> => <T>(dep: Dependencies<'multiply', T>): Signature<'square', T> =>
z => dep.multiply(z, z) z => dep.multiply(z, z)
// z => dep.fooBar(z, z) // fails as desired
// z => dep.multiply(z, 'foo') // fails as desired

View File

@ -2,6 +2,7 @@
"compilerOptions": { "compilerOptions": {
"target": "ES2022", "target": "ES2022",
"rootDir": "./src", "rootDir": "./src",
"outDir": "./obj" "outDir": "./obj",
"moduleResolution": "nodenext"
} }
} }