We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
Version: 4.2.0 Crash when use namespace#unwrap() method.
To Reproduce
import { Project } from "ts-morph"; const project = new Project(); const source = project.createSourceFile( "./sample.ts", "// aaaa bbbb \n namespace Foo {\n\texport class Bar {\n \t\tconstructor(){}\n \t\tsayHello(){return 'hello';}\n\t}\n}", { overwrite: true }, ); source.saveSync(); source.getNamespaces().forEach(ns => ns.unwrap());
Expected behavior input
// aaaa bbbb namespace Foo { export class Bar { constructor(){} sayHello(){return 'hello';} } }
expect
// aaaa bbbb export class Bar { constructor(){} sayHello(){return 'hello';} }
actual Error: Manipulation error: Cannot get the next when at the end of the iterator.
Error: Manipulation error: Cannot get the next when at the end of the iterator.
The text was updated successfully, but these errors were encountered:
Thanks! Looks like I'm accidentally using position rather than getStart(true): https://github.com/dsherret/ts-morph/blob/d15ef55c9fbadefa34857d99335798b09a4ec561/src/manipulation/textManipulators/UnwrapTextManipulator.ts
getStart(true)
Sorry, something went wrong.
2cc4796
Fixed in 4.3.0 (released).
No branches or pull requests
Describe the bug
Version: 4.2.0
Crash when use namespace#unwrap() method.
To Reproduce
Expected behavior
input
expect
actual
Error: Manipulation error: Cannot get the next when at the end of the iterator.
The text was updated successfully, but these errors were encountered: