Comparing version 0.0.1 to 0.0.2
/// <reference types="web" /> | ||
import { ShOptions } from './types.js'; | ||
export declare class ParseError extends Error { | ||
filename: string; | ||
incomplete: boolean; | ||
text: string; | ||
pos: { | ||
col: number; | ||
line: number; | ||
offset: number; | ||
}; | ||
constructor({ filename, incomplete, text, pos, message, }: { | ||
filename: string; | ||
incomplete: boolean; | ||
text: string; | ||
pos: { | ||
col: number; | ||
line: number; | ||
offset: number; | ||
}; | ||
message: string; | ||
}); | ||
} | ||
export declare const getPrinter: (getWasmFile: () => BufferSource | Promise<BufferSource>) => (text: string, { filepath, keepComments, stopAt, variant, useTabs, tabWidth, indent, binaryNextLine, switchCaseIndent, spaceRedirects, keepPadding, minify, functionNextLine, }?: Partial<ShOptions>) => Promise<string>; |
import { __awaiter } from "tslib"; | ||
let id = 0; | ||
export class ParseError extends Error { | ||
constructor({ filename, incomplete, text, pos, message, }) { | ||
super(message); | ||
this.filename = filename; | ||
this.incomplete = incomplete; | ||
this.text = text; | ||
this.pos = pos; | ||
} | ||
} | ||
export const getPrinter = (getWasmFile) => { | ||
@@ -44,3 +53,6 @@ let wasmFile; | ||
if ('error' in processed) { | ||
throw new Error(processed.error); | ||
/* istanbul ignore next */ | ||
throw typeof processed.error === 'string' | ||
? new Error(processed.error) | ||
: new ParseError(processed.error); | ||
} | ||
@@ -47,0 +59,0 @@ return processed.text; |
{ | ||
"name": "sh-syntax", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A WASM shell parser and formatter with bash support, based on mvdan/sh", |
@@ -10,3 +10,18 @@ import _fs from 'fs' | ||
number, | ||
{ error: string } | { text: string } | ||
| { | ||
error: | ||
| string | ||
| { | ||
filename: string | ||
incomplete: boolean | ||
text: string | ||
pos: { | ||
col: number | ||
line: number | ||
offset: number | ||
} | ||
message: string | ||
} | ||
} | ||
| { text: string } | ||
> | ||
@@ -27,2 +42,2 @@ | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2919781
1344
1