From 536a765276f85bff03b0a2f6d8ee03da75e84842 Mon Sep 17 00:00:00 2001 From: Almaz Date: Sat, 29 Jul 2023 19:38:38 +0300 Subject: [PATCH] Support disabled condition in new scheme (#133) --- src/parking/access-condition.ts | 2 ++ src/test/parking-conditions.test.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/parking/access-condition.ts b/src/parking/access-condition.ts index a6ad668..3665e1f 100644 --- a/src/parking/access-condition.ts +++ b/src/parking/access-condition.ts @@ -108,6 +108,8 @@ function mapAccessValue(tags: OsmTags, accessValue: string | undefined, side?: s return getValue(tags, 'zone', side) ? 'residents' : 'no_stopping' case 'no': + return getValue(tags, 'disabled', side) === 'designated' ? 'disabled' : 'no_stopping' + case 'permissive': case 'permit': return 'no_stopping' diff --git a/src/test/parking-conditions.test.ts b/src/test/parking-conditions.test.ts index 54204a0..e51e2ed 100644 --- a/src/test/parking-conditions.test.ts +++ b/src/test/parking-conditions.test.ts @@ -194,4 +194,17 @@ describe('#getConditions()', () => { } expect(expectedConditions).toStrictEqual(receivedConditions) }) + + test('disabled', async() => { + const tags: OsmTags = { + 'parking:right:access': 'no', + 'parking:right:disabled': 'designated', + } + const receivedConditions = getConditions(tags, 'right') + const expectedConditions: ParkingConditions = { + default: 'disabled', + conditionalValues: [], + } + expect(expectedConditions).toStrictEqual(receivedConditions) + }) })