This commit is contained in:
Andras Schmelczer 2026-05-11 21:38:26 +01:00
parent 9248e26af2
commit f2a2651b8a
95 changed files with 3993 additions and 1471 deletions

View file

@ -14,6 +14,7 @@ test('buildScreenshotRequest accepts supported screenshot parameters', () => {
filter: ['Last known price:100000:500000', 'Total floor area (sqm):50:150'],
school: 'primary:good:2:1:10',
crime: ['Burglary (avg/yr):0:5', 'Vehicle crime (avg/yr):0:10'],
voteShare: ['% Labour:30:55', '% Conservative:10:35'],
ethnicity: ['% White:10:80', '% South Asian:5:35'],
poi: 'supermarket',
tt: 'transit:kings-cross:Kings Cross:b:0:30',
@ -33,6 +34,7 @@ test('buildScreenshotRequest accepts supported screenshot parameters', () => {
'Burglary (avg/yr):0:5',
'Vehicle crime (avg/yr):0:10',
]);
assert.deepEqual(result.qs.getAll('voteShare'), ['% Labour:30:55', '% Conservative:10:35']);
assert.deepEqual(result.qs.getAll('ethnicity'), ['% White:10:80', '% South Asian:5:35']);
});

View file

@ -12,7 +12,7 @@ const MAX_VALUE_LENGTH = 500;
const NUMERIC_RE = /^-?(?:\d+|\d*\.\d+)$/;
const PATH_RE = /^\/(?:invite\/[A-Za-z0-9]{1,20})?$/;
const SAFE_VALUE_RE = /^[^\u0000-\u001f\u007f]+$/;
const REPEATED_KEYS = ['filter', 'school', 'crime', 'ethnicity', 'poi', 'tt'] as const;
const REPEATED_KEYS = ['filter', 'school', 'crime', 'voteShare', 'ethnicity', 'poi', 'tt'] as const;
type Query = Record<string, unknown>;