Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sh-syntax

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sh-syntax - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

21

lib/print.d.ts
/// <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>;

14

lib/print.js
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;

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc