From 758fb19b310e0f259c18a9dabbd9e34896685d00 Mon Sep 17 00:00:00 2001 From: Guilherme Bernal Date: Fri, 1 Oct 2021 10:13:10 +0000 Subject: [PATCH] chore: update dependencies --- .github/workflows/spec.yml | 7 ++---- index.d.ts | 48 +++++++++++++++++--------------------- package.json | 22 ++++++++--------- 3 files changed, 33 insertions(+), 44 deletions(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 3efb55c..9c576ca 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -7,9 +7,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 - with: - node-version: 14 - - run: npm i - - run: npx tsc -noEmit + - run: npm install + - run: npm test - run: npm run eslint:check - - run: npm run prettier:check diff --git a/index.d.ts b/index.d.ts index 5dffaf9..b52bf46 100644 --- a/index.d.ts +++ b/index.d.ts @@ -41,23 +41,19 @@ declare namespace AsTypedInternal { [K in keyof Props]?: Resolve; }; - type ResolveObjectAdditionalProps< - AdditionalProperties - > = unknown extends AdditionalProperties - ? unknown - : AdditionalProperties extends false | undefined - ? unknown - : AdditionalProperties extends true - ? { [key: string]: unknown } - : { [key: string]: Resolve }; - - type ResolveObject< - Props, - RequiredPropNames, - AdditionalProperties - > = ResolveObjectRequiredProps & - ResolveObjectOptionalProps & - ResolveObjectAdditionalProps; + type ResolveObjectAdditionalProps = + unknown extends AdditionalProperties + ? unknown + : AdditionalProperties extends false | undefined + ? unknown + : AdditionalProperties extends true + ? { [key: string]: unknown } + : { [key: string]: Resolve }; + + type ResolveObject = + ResolveObjectRequiredProps & + ResolveObjectOptionalProps & + ResolveObjectAdditionalProps; type AsTypedTupleSchema = Tuple extends [] ? [] @@ -146,16 +142,14 @@ declare namespace AsTypedInternal { ? Resolve & ResolveAllOf : unknown; - type ResolvePath< - Schema, - Path - > = Path extends `${infer Prop}/${infer PathRest}` - ? Prop extends keyof Schema - ? ResolvePath - : never - : Path extends keyof Schema - ? Schema[Path] - : never; + type ResolvePath = + Path extends `${infer Prop}/${infer PathRest}` + ? Prop extends keyof Schema + ? ResolvePath + : never + : Path extends keyof Schema + ? Schema[Path] + : never; type LocateId = Candidates extends { $id: Id } ? Candidates diff --git a/package.json b/package.json index 1763119..521d909 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,7 @@ "scripts": { "test": "tsc -noEmit", "eslint:fix": "eslint --fix '*.ts'", - "eslint:check": "eslint '*.ts'", - "prettier:fix": "prettier --write '*.{t,j}s'", - "prettier:check": "prettier --check '*.{t,j}s'" + "eslint:check": "eslint '*.ts'" }, "keywords": [ "typescript", @@ -30,15 +28,15 @@ }, "homepage": "https://github.com/lbguilherme/as-typed#readme", "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.22.0", - "@typescript-eslint/parser": "^4.22.0", - "@typescript-eslint/typescript-estree": "^4.22.0", - "eslint": "^7.24.0", - "eslint-config-prettier": "^8.2.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-prettier": "^3.3.1", - "prettier": "^2.2.1", + "@typescript-eslint/eslint-plugin": "^4.32.0", + "@typescript-eslint/parser": "^4.32.0", + "@typescript-eslint/typescript-estree": "^4.32.0", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "^2.4.1", "spec.ts": "^1.1.3", - "typescript": "^4.2.4" + "typescript": "^4.4.3" } }