Skip to content

Commit

Permalink
fix: static arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Dec 1, 2022
1 parent 77abba4 commit 7fcac82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/util/src/qs.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const isNumeric = (key: string): boolean => !isNaN(+key);

export class QueryString {
public static parseFieldName(name: string): string[] {
public static parseFieldName = (name: string): string[] => {
const base = name.replace(/\[.+/, "");

return [base, ...[...name.matchAll(/\[([^\]]*)\]/ig)].map(([, key]) => key)];
}
};

public static inject([key, ...paths]: string[], value: unknown, fields: any = {}): any {
public static inject = ([key, ...paths]: string[], value: unknown, fields: any = {}): any => {
if (paths.length > 0) {
fields[key] = this.inject(paths, value, fields[key]);
} else {
Expand All @@ -19,5 +19,5 @@ export class QueryString {
}

return fields;
}
};
}

0 comments on commit 7fcac82

Please sign in to comment.