Skip to content

Commit

Permalink
Don't use sparse arrays because they aren't currently supported in QS
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Feb 15, 2021
1 parent 952c2e6 commit 4e6e554
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion lib/core/src/client/preview/parseArgsParam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const validateArgs = (key = '', value: any = ''): boolean => {
const QS_OPTIONS = {
delimiter: ';', // we're parsing a single query param
allowDots: true, // objects are encoded using dot notation
allowSparse: true, // arrays will be merged on top of their initial value
};
export const parseArgsParam = (argsString: string): Args => {
const parts = argsString.split(';').map((part) => part.replace('=', '~').replace(':', '='));
Expand Down
5 changes: 1 addition & 4 deletions lib/router/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ interface Args {
const deepDiff = (value: any, update: any): any => {
if (deepEqual(value, update)) return undefined;
if (typeof value !== typeof update) return update;
if (Array.isArray(value)) {
if (!Array.isArray(update)) return update;
return update.map((upd, index) => deepDiff(value[index], upd));
}
if (Array.isArray(value)) return update;
if (typeof update === 'object') {
return Object.keys(update).reduce((acc, key) => {
const diff = deepDiff(value[key], update[key]);
Expand Down

0 comments on commit 4e6e554

Please sign in to comment.