UNPKG

@codenameryuu/adonis-datatable

Version:
36 lines (35 loc) 1.01 kB
import app from "@adonisjs/core/services/app"; import lodash from "lodash"; export default class Config { config; constructor(config) { this.config = config; } isWildcard() { return lodash.get(this.config, "search.use_wildcards", false); } isSmartSearch() { return lodash.get(this.config, "search.smart", true); } isCaseInsensitive() { return lodash.get(this.config, "search.case_insensitive", false); } isDebugging() { return lodash.get(this.config, "debug", false); } get(key, defaultValue = null) { return lodash.get(this.config, key, defaultValue); } set(key, value = null) { app.config.set(key, value); } isMultiTerm() { return lodash.get(this.config, "search.multi_term", true); } isStartsWithSearch() { return lodash.get(this.config, "search.starts_with", false); } jsonHeaders() { return lodash.get(this.config, "json.header", {}); } }