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

72
Vistas
Export without destructuring
import { utils } from 'shared'

const {
  pick,
  get,
  isEmpty,
  sortBy,
  orderObjectsArray,
  isString
} = utils.lodashAlternative

export { pick, get, isEmpty, sortBy, orderObjectsArray, isString }

Above you can see exports , imagine I don't want to desctructure all of those functions , how can I do it ? I've tried to make export utils.lodashAlternative , but it will not work , also :

const {...data} = utils.lodashAlternative

export {...data}

Also will not work, it there any way to export it without discructuring ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

A simple way to export everything under utils.lodashAlternative is creating an alias and exporting that one instead. There's no need to create an object and spread lodashAlternative inside.

You can't declare and export afterwards (unless you use as)!

Way 1: using default

import { utils } from 'shared'

const lodashAlternative = utils.lodashAlternative;

export default lodashAlternative;

Way 2: exporting directly

import { utils } from 'shared'

export const lodashAlternative = utils.lodashAlternative;

Way 3: export each one separately, to be able to import them separately

import {utils} from "shared";

const { foo, bar } = utils.lodashAlternative;

export { foo, bar };

import then:

// WITH WAY 1
import lodashAlternative from "lodash-alternative";

// WITH WAY 2
import {lodashAlternative} from "lodash-alternative";

// WITH WAY 3
import {foo, bar} from "lodash-alternative";

Blitz here

about 4 years ago · Juan Pablo Isaza Denunciar
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