Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
fuse.js: ability to fallback on default behaviour in case of declaring getFn option

Example: In our code we have an object with the next type

{
  person: {
   name: string,
  },
  status: string,
  date: Date,
}

on the UI we have formatted date and want to search by this field.

As I understand getFn option is what we need.

The only question - is it possible to have a fallback to the default lib behaviour in case if we don't need any adjustment in the code

For now our fn looks like this (raw version that handle only two level depth)

getFn: (obj, path) => {
        if (path.length === 1 && path[0] === 'date') {
          return format(obj[path[0]], DATE_FORMAT)
        }
        console.log({obj, path })
        return path.length === 1 ? obj[path[0]] : (obj[path[0]] && obj[path[0]][path[1]])
      },

Thanks in advance for any suggestions!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda