Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

SourceNode

class SourceNode {
constructor();
constructor(
line: number,
column: number,
source: string,
);
constructor(
line: number,
column: number,
source: string,
chunk?: string,
name?: string,
);
add(chunk: string): void;
join(sep: string): SourceNode;
prepend(chunk: string): void;
replaceRight(pattern: string, replacement: string): SourceNode;
setSourceContent(sourceFile: string, sourceContent: string): void;
toString(): string;
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
walkSourceContents(fn: (file: string, content: string) => void): void;
 
static fromStringWithSourceMap(
code: string,
sourceMapConsumer: SourceMapConsumer,
relativePath?: string,
): SourceNode;
}

§Constructors

§
new SourceNode()
[src]
§
new SourceNode(line: number, column: number, source: string)
[src]
§
new SourceNode(line: number, column: number, source: string, chunk?: string, name?: string)
[src]

§Methods

§
add(chunk: string): void
[src]
§
join(sep: string): SourceNode
[src]
§
prepend(chunk: string): void
[src]
§
replaceRight(pattern: string, replacement: string): SourceNode
[src]
§
setSourceContent(sourceFile: string, sourceContent: string): void
[src]
§
toString(): string
[src]
§
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap
[src]
§
walk(fn: (chunk: string, mapping: MappedPosition) => void): void
[src]
§
walkSourceContents(fn: (file: string, content: string) => void): void
[src]

§Static Methods

§
fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode
[src]