All Downloads are FREE. Search and download functionalities are using the official Maven repository.

typescript-redux-query.runtime.mustache Maven / Gradle / Ivy

// tslint:disable
{{>licenseInfo}}

import { Meta, OptimisticUpdate, QueryKey, QueryOptions, Rollback, TransformStrategy, Update } from "redux-query";

export const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, "");

export interface TypedQueryConfig {
    force?: boolean;
    meta?: Meta;
    options?: QueryOptions;
    queryKey?: QueryKey;
    update?: Update;
    optimisticUpdate?: OptimisticUpdate;
    retry?: boolean;
    rollback?: Rollback;
    transform?: TransformStrategy
}

export class RequiredError extends Error {
    name: "RequiredError" = "RequiredError";
    constructor(public field: string, msg?: string) {
        super(msg);
    }
}

export const COLLECTION_FORMATS = {
    csv: ",",
    ssv: " ",
    tsv: "\t",
    pipes: "|",
};

export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';

export function exists(json: any, key: string) {
    const value = json[key];
    return value !== null && value !== undefined;
}

export function mapValues(data: any, fn: (item: any) => any) {
  return Object.keys(data).reduce(
    (acc, key) => ({ ...acc, [key]: fn(data[key]) }),
    {}
  );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy