Skip to content

Allow passing undefined options to move() #947

@Nokel81

Description

@Nokel81
  • **Operating System:**macos
  • **Node.js version:**14.18.3
  • **fs-extra version:**10.0.1

The follow code:

const { move } = require("fs-extra");

move("/some/path/that/exists", "some/path/that/doesnt/exist", undefined)
  .then(() => console.log("success")
  .catch(console.error);

produces the following type error: TypeError: Cannot read property 'overwrite' of undefined

The error seems to be from the handling of optional callback and optional options on line 12-15 of lib/move/move.js

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions