From 12f3cd9d70ea18990359537a7d343a15e9c6d132 Mon Sep 17 00:00:00 2001 From: Zechariah Date: Sun, 27 Mar 2022 23:42:59 +0800 Subject: [PATCH] Updated validate-any version and updated logs --- package.json | 4 ++-- pnpm-lock.yaml | 8 ++++---- src/utils/checkType.ts | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index d08786c..8cac5f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ytmusic-api", - "version": "1.0.4", + "version": "1.0.5", "description": "YouTube Music API", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -26,7 +26,7 @@ "babel-jest": "^27.4.6", "jest": "^27.4.7", "typescript": "^4.5.5", - "validate-any": "^1.2.0" + "validate-any": "1.3.1" }, "keywords": [ "youtube", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe2202a..fee5ae4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ specifiers: jest: ^27.4.7 tough-cookie: ^4.0.0 typescript: ^4.5.5 - validate-any: ^1.2.0 + validate-any: 1.3.1 dependencies: axios: 0.25.0 @@ -26,7 +26,7 @@ devDependencies: babel-jest: 27.5.1_@babel+core@7.17.8 jest: 27.5.1 typescript: 4.6.3 - validate-any: 1.2.4 + validate-any: 1.3.1 packages: @@ -3642,8 +3642,8 @@ packages: source-map: 0.7.3 dev: true - /validate-any/1.2.4: - resolution: {integrity: sha512-EsmLHSZfvgXQVPD9FacVy6I+XyTGkTzfM437+ogVH0fuMb4Oavcr7xnLMCS1twVsNrZsKtL1dqnVHwD2Ay9Zag==} + /validate-any/1.3.1: + resolution: {integrity: sha512-33HGXUZuJlrn4a3+21IRCBhY51Grbf1MzdUCzG1nnUtCcBphLBQ+Vi79p3E64eOjHz5C6QvXBYFE7JRVHGWQ4A==} dependencies: js-beautify: 1.14.0 dev: true diff --git a/src/utils/checkType.ts b/src/utils/checkType.ts index 6225b48..f3842f1 100644 --- a/src/utils/checkType.ts +++ b/src/utils/checkType.ts @@ -6,11 +6,18 @@ export default (data: T, validator: Validator): T => { if (result.success) { return result.data } else { - console.error("Invalid data schema, please report as an issue", { - expected: validator.formatSchema(), - actual: data, - errors: result.errors - }) + console.error( + "Invalid data schema, please report to https://github.com/zS1L3NT/ts-npm-ytmusic-api/issues/new/choose", + JSON.stringify( + { + expected: validator.getSchema(), + actual: data, + errors: result.errors + }, + null, + 2 + ) + ) return data } }