From 630ca7d6cbe4fed2d41827205215a2f28a971aea Mon Sep 17 00:00:00 2001 From: Josh Bowling Date: Thu, 1 Aug 2024 07:24:16 +0900 Subject: [PATCH] Update @balena/lint to v8.2.7 Change-type: patch --- package.json | 2 +- src/types/time.ts | 2 +- src/types/web-resource.ts | 2 +- test/Interval.ts | 2 +- test/WebResource.ts | 2 +- test/helpers.ts | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index d2547e9..c822abe 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@balena/abstract-sql-compiler": "^9.2.0", - "@balena/lint": "^8.0.2", + "@balena/lint": "^8.2.7", "@types/bcrypt": "^5.0.2", "@types/chai": "^4.3.16", "@types/chai-datetime": "^0.0.39", diff --git a/src/types/time.ts b/src/types/time.ts index 1d8eb85..afaad2c 100644 --- a/src/types/time.ts +++ b/src/types/time.ts @@ -17,7 +17,7 @@ export const fetchProcessing: TypeUtils.FetchProcessing = ( ) => { if (data != null) { // We append the date of the epoch so that we can parse this as a valid date. - return new Date('Thu, 01 Jan 1970 ' + data).toISOString(); + return new Date(`Thu, 01 Jan 1970 ${data}`).toISOString(); } return data; }; diff --git a/src/types/web-resource.ts b/src/types/web-resource.ts index 2c7dc4d..b5e3a8c 100644 --- a/src/types/web-resource.ts +++ b/src/types/web-resource.ts @@ -116,7 +116,7 @@ export const fetchProcessing: TypeUtils.FetchProcessing = ( * */ export const validate: TypeUtils.Validate = - TypeUtils.validate.checkRequired(async (value: WebResource) => { + TypeUtils.validate.checkRequired((value: WebResource) => { if (typeof value !== 'object') { throw new Error(`is not an object: ${typeof value}`); } diff --git a/test/Interval.ts b/test/Interval.ts index e58acbe..0e7bf92 100644 --- a/test/Interval.ts +++ b/test/Interval.ts @@ -3,6 +3,6 @@ import * as helpers from './helpers'; helpers.describe('Interval', (test) => { describe('validate', function () { test.validate(1, true, 1); - return test.validate('1', true, 1); + test.validate('1', true, 1); }); }); diff --git a/test/WebResource.ts b/test/WebResource.ts index 9a0f482..e163ceb 100644 --- a/test/WebResource.ts +++ b/test/WebResource.ts @@ -30,7 +30,7 @@ helpers.describe('WebResource', (test) => { filename: 'logo.png', href: 'test', }; - test.validate(smallWebResourceInput, true, async (value) => { + test.validate(smallWebResourceInput, true, (value) => { expect(typeof value).to.equal('string'); const asObj = JSON.parse(value); expect(asObj.filename).to.equal(smallWebResourceInput.filename); diff --git a/test/helpers.ts b/test/helpers.ts index b4431de..131e3de 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -81,7 +81,7 @@ const $describe = ( }; }; - describe(typeName, () => + describe(typeName, () => { fn({ type, types: { @@ -91,8 +91,8 @@ const $describe = ( }, fetch: test('fetchProcessing' in type ? type.fetchProcessing : undefined), validate: test(type.validate), - }), - ); + }); + }); }; export { $describe as describe };