🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

ts-blank-space

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-blank-space - npm Package Compare versions

Comparing version

to
0.6.0

28

out/index.js

@@ -152,4 +152,4 @@ // Copyright 2024 Bloomberg Finance L.P.

case SK.SetAccessor: return visitFunctionLikeDeclaration(node , kind);
case SK.EnumDeclaration:
case SK.ModuleDeclaration: return visitEnumOrModule(node );
case SK.EnumDeclaration: return visitEnum(node );
case SK.ModuleDeclaration: return visitModule(node );
case SK.IndexSignature: blankExact(node); return VISIT_BLANKED;

@@ -520,6 +520,14 @@ case SK.TaggedTemplateExpression: return visitTaggedTemplate(node );

function visitEnumOrModule(node ) {
function visitModule(node ) {
if (
(node.modifiers && modifiersContainsDeclare(node.modifiers)) ||
(node.kind === SK.ModuleDeclaration && !valueNamespaceWorker(node ))
// `declare global {...}
node.flags & tslib.NodeFlags.GlobalAugmentation ||
// `namespace N {...}`
(node.flags & tslib.NodeFlags.Namespace &&
// `declare namespace N {...}`
((node.modifiers && modifiersContainsDeclare(node.modifiers)) ||
// `namespace N { <no values> }`
!valueNamespaceWorker(node))) ||
// `declare module "./path" {...}`
node.name.kind === SK.StringLiteral
) {

@@ -534,2 +542,12 @@ blankStatement(node);

function visitEnum(node ) {
if (node.modifiers && modifiersContainsDeclare(node.modifiers)) {
blankStatement(node);
return VISIT_BLANKED;
} else {
onError && onError(node);
return VISITED_JS;
}
}
function valueNamespaceWorker(node ) {

@@ -536,0 +554,0 @@ switch (node.kind) {

2

package.json
{
"name": "ts-blank-space",
"description": "A small, fast, pure JavaScript type-stripper that uses the official TypeScript parser.",
"version": "0.5.1",
"version": "0.6.0",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "homepage": "https://bloomberg.github.io/ts-blank-space",