From e03757bce6485439d85b0cdbcd3ad1519679608c Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 17 Apr 2019 13:52:42 -0700 Subject: [PATCH 1/5] Change typescript compiler target to ES5 --- src/Scheduler.ts | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 56cbcd6..e77b74d 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -396,7 +396,7 @@ export class Scheduler { } public getIntersection(p: IntersectParams): Availability { - const params: AvailabilityParams = Object.assign( + const params: AvailabilityParams = (Object).assign( { schedule: null }, cloneDeep(omit(p, ['schedules'])) ); diff --git a/tsconfig.json b/tsconfig.json index a6e2475..4ba6c29 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES6", + "target": "ES5", "module": "commonjs", "outDir": "./dist/", "sourceMap": true, From af74a0ce45083e5f8819cf0693e9d43addaffeff Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 17 Apr 2019 14:02:40 -0700 Subject: [PATCH 2/5] Replace Object.assign with lodash.assignIn; ES5 doesn't support Object.assign --- src/Scheduler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index e77b74d..81178f2 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -6,7 +6,7 @@ import { TimeAvailability, Schedule, ScheduleSpecificDate, Interval } from '../index.d'; -import {cloneDeep, omit} from 'lodash'; +import { assignIn, cloneDeep, omit} from 'lodash'; import Moment = moment.Moment; export class Scheduler { @@ -396,7 +396,7 @@ export class Scheduler { } public getIntersection(p: IntersectParams): Availability { - const params: AvailabilityParams = (Object).assign( + const params: AvailabilityParams = assignIn( { schedule: null }, cloneDeep(omit(p, ['schedules'])) ); From a7af4612de97938c1c86e36f9c154cd98257acb9 Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 17 Apr 2019 15:36:16 -0700 Subject: [PATCH 3/5] Added missing space for linter --- src/Scheduler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 81178f2..a9ec734 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -396,7 +396,7 @@ export class Scheduler { } public getIntersection(p: IntersectParams): Availability { - const params: AvailabilityParams = assignIn( + const params: AvailabilityParams = assignIn( { schedule: null }, cloneDeep(omit(p, ['schedules'])) ); From 7d147cb057044e9eca57bbb54a11b792f4a71ee9 Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 17 Apr 2019 20:42:52 -0700 Subject: [PATCH 4/5] Use spread to merge objects instead of assignIn --- src/Scheduler.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index a9ec734..6ca8c24 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -6,7 +6,7 @@ import { TimeAvailability, Schedule, ScheduleSpecificDate, Interval } from '../index.d'; -import { assignIn, cloneDeep, omit} from 'lodash'; +import { cloneDeep, omit} from 'lodash'; import Moment = moment.Moment; export class Scheduler { @@ -396,10 +396,10 @@ export class Scheduler { } public getIntersection(p: IntersectParams): Availability { - const params: AvailabilityParams = assignIn( - { schedule: null }, - cloneDeep(omit(p, ['schedules'])) - ); + const params: AvailabilityParams = { + ...{ schedule: null }, + ... cloneDeep(omit(p, ['schedules'])) + }; const availabilities: Availability[] = []; for (const schedule of p.schedules) { params.schedule = schedule; From e3dc527d8811d0c7ece0b892709fae203abe28b0 Mon Sep 17 00:00:00 2001 From: Steve Adams Date: Wed, 6 May 2020 11:57:14 -0700 Subject: [PATCH 5/5] Remove extra space --- src/Scheduler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 6ca8c24..b7833f2 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -6,7 +6,7 @@ import { TimeAvailability, Schedule, ScheduleSpecificDate, Interval } from '../index.d'; -import { cloneDeep, omit} from 'lodash'; +import {cloneDeep, omit} from 'lodash'; import Moment = moment.Moment; export class Scheduler {