Skip to content

Using lodash method categories #11682

Closed
Closed
@alisabzevari

Description

@alisabzevari

TypeScript Version: nightly (2.1.0-dev.20161017)

I wanted to use lodash method categories. Here is the code I wrote:

import assign from "lodash/assign";
var myVar = assign({}, {foo:"foo"}, {bar:"bar"});

Expected compiled result:

"use strict"
const assign_1 = require("lodash/assign");
var myVar = assign_1({}, {foo:"foo"}, {bar:"bar"});

Actual compiled result:

"use strict"
const assign_1 = require("lodash/assign");
var myVar = assign_1.default({}, {foo:"foo"}, {bar:"bar"});

Some notes:

  • I am using @types/lodash and the definition of assign is:
declare module "lodash/assign" {
   const assign: typeof _.assign;
   export = assign;
}
  • I found out if I remove allowSyntheticDefaultImports and change import * as assign from "lodash/assign";, it will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions