1

I have been developing an application using Typescript that gets compiled into node code. As such I prefer using import statements to require.

I have been attempting to use Lodash with Lodash-Deep, with their official documentation stating that usage should be: const _ = require("deepdash")(require("lodash"));

I wish to convert this into an import statement but have not seen anything like this before and can't find any information in Node docs that explain using require in this fashion.

Would anyone know how to do this or can point me towards the relevant resources so that my code can stay consistent.

1 Answer 1

3

The imported deepdash is a function, and it's need to be called with lodash object as the parameter.

import lodash from "lodash"
import deepdash from "deepdash"

const _ = deepdash(lodash)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for that, just had to adjust the imports slightly: import * as deepdash from "deepdash"; import * as lodash from "lodash";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.