HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/vuelidate/src/withParamsBrowser.js
// In browser, validators should be independent from Vuelidate.
// The only usecase those do need to be dependent is when you need $params.
// To make the dependency optional, try to grab Vuelidate from global object,
// fallback to stubbed WithParams on failure.

const root =
  typeof window !== 'undefined'
    ? window
    : typeof global !== 'undefined'
    ? global
    : {}

/* istanbul ignore next */
const fakeWithParams = (paramsOrClosure, maybeValidator) => {
  if (typeof paramsOrClosure === 'object' && maybeValidator !== undefined) {
    return maybeValidator
  }
  return paramsOrClosure(() => {})
}

export const withParams = root.vuelidate
  ? root.vuelidate.withParams
  : fakeWithParams