fix lint errors
This commit is contained in:
parent
84df0714d8
commit
b9eaf906e7
22 changed files with 55 additions and 49 deletions
|
|
@ -87,7 +87,7 @@ export function groupOn<T, S>(f: (x: T) => S, xs: T[]): T[][] {
|
|||
export function groupByX<T>(collections: T[], keySelector: (x: T) => string) {
|
||||
return collections.reduce((obj: Record<string, T[]>, item: T) => {
|
||||
const key = keySelector(item);
|
||||
if (!obj.hasOwnProperty(key)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
obj[key] = [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export function query(obj: {}): string {
|
||||
export function query(obj: Record<string, unknown>): string {
|
||||
const params = Object.entries(obj)
|
||||
.filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined)
|
||||
.reduce((a, [k, v]) => (a[k] = v, a), {} as Record<string, any>);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue