ts-blank-space
Advanced tools
Comparing version 0.3.3333 to 0.4.0
// Copyright 2024 Bloomberg Finance L.P. | ||
// Distributed under the terms of the Apache 2.0 license. | ||
import tsBlankSpace from "#out/index.js"; | ||
import tsBlankSpace from "../out/index.js"; | ||
@@ -5,0 +5,0 @@ export async function resolve(specifier, context, nextResolve) { |
@@ -105,13 +105,12 @@ // Copyright 2024 Bloomberg Finance L.P. | ||
function visitStatementLike(node ) { | ||
const n = node ; | ||
const kind = node.kind; | ||
switch (kind) { | ||
case SK.ImportDeclaration: | ||
return visitImportDeclaration(n); | ||
return visitImportDeclaration(node ); | ||
case SK.ExportDeclaration: | ||
return visitExportDeclaration(n); | ||
return visitExportDeclaration(node ); | ||
case SK.ExportAssignment: | ||
return visitExportAssignment(n); | ||
return visitExportAssignment(node ); | ||
case SK.ImportEqualsDeclaration: | ||
onError && onError(n); | ||
onError && onError(node); | ||
return VISITED_JS; | ||
@@ -129,19 +128,20 @@ } | ||
function innerVisitor(node , kind ) { | ||
const n = node ; | ||
// prettier-ignore | ||
switch (kind) { | ||
case SK.Identifier: return VISITED_JS; | ||
case SK.VariableDeclaration: return visitVariableDeclaration(n); | ||
case SK.VariableStatement: return visitVariableStatement(n); | ||
case SK.VariableDeclaration: return visitVariableDeclaration(node ); | ||
case SK.VariableStatement: return visitVariableStatement(node ); | ||
case SK.CallExpression: | ||
case SK.NewExpression: return visitCallOrNewExpression(n); | ||
case SK.NewExpression: return visitCallOrNewExpression(node ); | ||
case SK.TypeAliasDeclaration: | ||
case SK.InterfaceDeclaration: blankStatement(n); return VISIT_BLANKED; | ||
case SK.InterfaceDeclaration: | ||
blankStatement(node ); | ||
return VISIT_BLANKED; | ||
case SK.ClassDeclaration: | ||
case SK.ClassExpression: return visitClassLike(n); | ||
case SK.ExpressionWithTypeArguments: return visitExpressionWithTypeArguments(n); | ||
case SK.PropertyDeclaration: return visitPropertyDeclaration(n); | ||
case SK.NonNullExpression: return visitNonNullExpression(n); | ||
case SK.ClassExpression: return visitClassLike(node ); | ||
case SK.ExpressionWithTypeArguments: return visitExpressionWithTypeArguments(node ); | ||
case SK.PropertyDeclaration: return visitPropertyDeclaration(node ); | ||
case SK.NonNullExpression: return visitNonNullExpression(node ); | ||
case SK.SatisfiesExpression: | ||
case SK.AsExpression: return visitTypeAssertion(n); | ||
case SK.AsExpression: return visitTypeAssertion(node ); | ||
case SK.ArrowFunction: | ||
@@ -153,8 +153,8 @@ case SK.FunctionDeclaration: | ||
case SK.GetAccessor: | ||
case SK.SetAccessor: return visitFunctionLikeDeclaration(n, kind); | ||
case SK.SetAccessor: return visitFunctionLikeDeclaration(node , kind); | ||
case SK.EnumDeclaration: | ||
case SK.ModuleDeclaration: return visitEnumOrModule(n); | ||
case SK.IndexSignature: blankExact(n); return VISIT_BLANKED; | ||
case SK.TaggedTemplateExpression: return visitTaggedTemplate(n); | ||
case SK.TypeAssertionExpression: return visitLegacyTypeAssertion(n); | ||
case SK.ModuleDeclaration: return visitEnumOrModule(node ); | ||
case SK.IndexSignature: blankExact(node); return VISIT_BLANKED; | ||
case SK.TaggedTemplateExpression: return visitTaggedTemplate(node ); | ||
case SK.TypeAssertionExpression: return visitLegacyTypeAssertion(node ); | ||
} | ||
@@ -610,4 +610,4 @@ | ||
function never(n ) { | ||
function never(_n ) { | ||
throw new Error("unreachable code was reached"); | ||
} |
{ | ||
"name": "ts-blank-space", | ||
"version": "0.3.3333", | ||
"description": "A small, fast, pure JavaScript, type-stripper using the official TypeScript parser", | ||
"version": "0.4.0", | ||
"license": "Apache-2.0", | ||
"homepage": "https://bloomberg.github.io/ts-blank-space", | ||
"contributors": [ | ||
@@ -27,20 +29,18 @@ "Ashley Claymore <aclaymore@bloomberg.net>", | ||
"imports": { | ||
"#r": "./loader/register.js", | ||
"#out/*": { | ||
"LKG": "./scripts/lkg/*", | ||
"default": "./out/*" | ||
} | ||
"#r": "ts-blank-space-lkg/register" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.9.4", | ||
"prettier": "3.3.3" | ||
"prettier": "3.3.3", | ||
"ts-blank-space-lkg": "npm:ts-blank-space@^0.3.3333" | ||
}, | ||
"scripts": { | ||
"build": "node -C LKG --import=#r ./scripts/build.ts", | ||
"build": "node --import=#r ./scripts/build.ts", | ||
"check": "tsc -p ./src/tsconfig.json --noEmit", | ||
"gen-types": "tsc -p ./src/tsconfig.json --emitDeclarationOnly", | ||
"fixtures": "node -C LKG --import=#r ./tests/fixture/_run.ts", | ||
"fixtures:watch": "node --watch-path ./tests/fixture/cases -C LKG --import=#r ./tests/fixture/_run.ts", | ||
"test": "node --test -C LKG --import=#r ./tests/*.test.ts", | ||
"test-ecosystem": "node --test -C LKG --import=#r ./tests/ecosystem/ecosystem.test.ts", | ||
"fixtures": "node --import=#r ./tests/fixture/_run.ts", | ||
"fixtures:watch": "node --watch-path ./tests/fixture/cases --import=#r ./tests/fixture/_run.ts", | ||
"pretest": "npm run build", | ||
"test": "node --test --import=#r ./tests/*.test.ts", | ||
"test-ecosystem": "node --test --import=#r ./tests/ecosystem/ecosystem.test.ts", | ||
"format": "prettier . -w", | ||
@@ -55,8 +55,9 @@ "format:check": "prettier . -c", | ||
"out/*.d.ts", | ||
"loader/*.js" | ||
"loader/*.js", | ||
"loader/*.d.ts" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/bloomberg/ts-blank-space" | ||
"url": "git+https://github.com/bloomberg/ts-blank-space.git" | ||
} | ||
} |
@@ -1,3 +0,9 @@ | ||
# ts-blank-space | ||
<img src="assets/ts-blank-space.png" width="728" alt="'ts-blank-space' as a logo. the 'ts' is in TypeScript blue and the 'blank-space' is in JavaScript orange" /> | ||
A small, fast, pure JavaScript, type-stripper using the official TypeScript parser. | ||
[![npm Badge](https://img.shields.io/npm/v/ts-blank-space.svg)](https://www.npmjs.com/package/ts-blank-space) | ||
--- | ||
TypeScript goes in: | ||
@@ -33,2 +39,4 @@ | ||
Try it out in the [playground](https://bloomberg.github.io/ts-blank-space/play/). | ||
## Rationale | ||
@@ -35,0 +43,0 @@ |
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
44988
10
667
1
246
3