/*! * Jodit Editor (https://xdsoft.net/jodit/) * Released under MIT see LICENSE.txt in the project root for license information. * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net */ import type { IDictionary } from '../../types'; /** * Parse query string */ export const parseQuery = (queryString: string): IDictionary => { const query: IDictionary = {}, a = queryString.substr(1).split('&'); for (let i = 0; i < a.length; i += 1) { const keyValue = a[i].split('='); query[decodeURIComponent(keyValue[0])] = decodeURIComponent( keyValue[1] || '' ); } return query; };