jodit
Version:
Jodit is awesome and usefully wysiwyg editor with filebrowser
25 lines (20 loc) • 639 B
text/typescript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2020 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { IDictionary } from '../../types';
/**
* Parse query string
*/
export const parseQuery = (queryString: string): IDictionary<string> => {
const query: IDictionary<string> = {},
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;
};