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

tsickle

Package Overview
Dependencies
Maintainers
7
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsickle - npm Package Compare versions

Comparing version 0.43.0 to 0.46.0

24

out/src/clutz.js

@@ -40,9 +40,10 @@ "use strict";

// Construct
// import 'path/to/file';
// import 'path/to/clutz_dts_file';
// for Clutz imports.
// Humans write Clutz imports like
// import 'goog:foo';
// so to consume that from a d.ts, you need to first import the d.ts
// that defines that "goog:foo" module before you can resolve the
// import.
// or
// import 'path/to/the/js_file';
// so to for that import to resolve, you need to first import the clutz
// d.ts that defines that declared module.
const imports = gatherNecessaryClutzImports(typeChecker, file);

@@ -246,11 +247,14 @@ let importStmts;

/**
* moduleSymbolFromGoog returns the module's symbol if and only if it is a module that uses
* tsickle's support for namespace imports (using goog: or declaring a namespace to import in a
* moduleSymbolFromClutz returns the module's symbol if and only if it is a
* module that uses tsickle's support for namespace imports (using goog: or
* declaring the namespace to import in a special __clutz_actual_namespace
* field).
*/
function moduleSymbolFromGoog(typeChecker, stmt) {
if (!ts.isImportDeclaration(stmt) && !ts.isExportDeclaration(stmt))
function moduleSymbolFromClutz(typeChecker, stmt) {
if (!ts.isImportDeclaration(stmt) && !ts.isExportDeclaration(stmt)) {
return undefined;
if (!stmt.moduleSpecifier)
}
if (!stmt.moduleSpecifier) {
return undefined; // can be absent on 'export' statements.
}
const moduleSymbol = typeChecker.getSymbolAtLocation(stmt.moduleSpecifier);

@@ -341,3 +345,3 @@ const ignoredDiagnostics = [];

// Then handle explicit import/export statements.
const moduleSymbol = moduleSymbolFromGoog(typeChecker, stmt);
const moduleSymbol = moduleSymbolFromClutz(typeChecker, stmt);
if (!moduleSymbol)

@@ -344,0 +348,0 @@ continue;

@@ -33,2 +33,3 @@ "use strict";

const decorators_1 = require("./decorators");
const jsdoc = require("./jsdoc");
const transformer_util_1 = require("./transformer_util");

@@ -75,11 +76,10 @@ /**

exports.shouldLower = shouldLower;
/**
* Creates the AST for the decorator field type annotation, which has the form
* { type: Function, args?: any[] }[]
*/
function createDecoratorInvocationType() {
const typeElements = [];
typeElements.push(ts.createPropertySignature(undefined, 'type', undefined, ts.createTypeReferenceNode(ts.createIdentifier('Function'), undefined), undefined));
typeElements.push(ts.createPropertySignature(undefined, 'args', ts.createToken(ts.SyntaxKind.QuestionToken), ts.createArrayTypeNode(ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)), undefined));
return ts.createArrayTypeNode(ts.createTypeLiteralNode(typeElements));
const DECORATOR_INVOCATION_JSDOC_TYPE = '!Array<{type: !Function, args: (undefined|!Array<?>)}>';
function addJSDocTypeAnnotation(node, jsdocType) {
ts.setSyntheticLeadingComments(node, [
jsdoc.toSynthesizedComment([{
tagName: 'type',
type: jsdocType,
}]),
]);
}

@@ -99,3 +99,3 @@ /**

// The decorator was a plain @Foo.
metadataProperties.push(ts.createPropertyAssignment('type', expr));
metadataProperties.push(ts.factory.createPropertyAssignment('type', expr));
break;

@@ -105,3 +105,3 @@ case ts.SyntaxKind.CallExpression:

const call = expr;
metadataProperties.push(ts.createPropertyAssignment('type', call.expression));
metadataProperties.push(ts.factory.createPropertyAssignment('type', call.expression));
if (call.arguments.length) {

@@ -112,5 +112,4 @@ const args = [];

}
const argsArrayLiteral = ts.createArrayLiteral(args);
argsArrayLiteral.elements.hasTrailingComma = true;
metadataProperties.push(ts.createPropertyAssignment('args', argsArrayLiteral));
const argsArrayLiteral = ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(args, /* hasTrailingComma */ true));
metadataProperties.push(ts.factory.createPropertyAssignment('args', argsArrayLiteral));
}

@@ -129,3 +128,3 @@ break;

}
return ts.createObjectLiteral(metadataProperties);
return ts.factory.createObjectLiteralExpression(metadataProperties);
}

@@ -137,7 +136,6 @@ /**

function createDecoratorClassProperty(decoratorList) {
const modifier = ts.createToken(ts.SyntaxKind.StaticKeyword);
const type = createDecoratorInvocationType();
const initializer = ts.createArrayLiteral(decoratorList, true);
initializer.elements.hasTrailingComma = true;
const prop = ts.createProperty(undefined, [modifier], 'decorators', undefined, type, initializer);
const modifier = ts.factory.createToken(ts.SyntaxKind.StaticKeyword);
const initializer = ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(decoratorList, /* hasTrailingComma */ true), true);
const prop = ts.factory.createPropertyDeclaration(undefined, [modifier], 'decorators', undefined, undefined, initializer);
addJSDocTypeAnnotation(prop, DECORATOR_INVOCATION_JSDOC_TYPE);
// NB: the .decorators property does not get a @nocollapse property. There is

@@ -152,33 +150,2 @@ // no good reason why - it means .decorators is not runtime accessible if you

/**
* Creates the AST for the 'ctorParameters' field type annotation:
* () => ({ type: any, decorators?: {type: Function, args?: any[]}[] }|null)[]
*/
function createCtorParametersClassPropertyType() {
// Sorry about this. Try reading just the string literals below.
const typeElements = [];
typeElements.push(ts.createPropertySignature(undefined, 'type', undefined, ts.createTypeReferenceNode(ts.createIdentifier('any'), undefined), undefined));
typeElements.push(ts.createPropertySignature(undefined, 'decorators', ts.createToken(ts.SyntaxKind.QuestionToken), ts.createArrayTypeNode(ts.createTypeLiteralNode([
ts.createPropertySignature(undefined, 'type', undefined, ts.createTypeReferenceNode(ts.createIdentifier('Function'), undefined), undefined),
ts.createPropertySignature(undefined, 'args', ts.createToken(ts.SyntaxKind.QuestionToken), ts.createArrayTypeNode(ts.createTypeReferenceNode(ts.createIdentifier('any'), undefined)), undefined),
])), undefined));
return ts.createFunctionTypeNode(undefined, [], ts.createArrayTypeNode(ts.createUnionTypeNode([
ts.createTypeLiteralNode(typeElements),
ts.factory.createTypeReferenceNode('null')
])));
}
/**
* Sets a Closure \@nocollapse synthetic comment on the given node. This prevents Closure Compiler
* from collapsing the apparently static property, which would make it impossible to find for code
* trying to detect it at runtime.
*/
function addNoCollapseComment(n) {
ts.setSyntheticLeadingComments(n, [{
kind: ts.SyntaxKind.MultiLineCommentTrivia,
text: '* @nocollapse ',
pos: -1,
end: -1,
hasTrailingNewLine: true
}]);
}
/**
* createCtorParametersClassProperty creates a static 'ctorParameters' property containing

@@ -200,3 +167,3 @@ * downleveled decorator information.

if (!ctorParam.type && ctorParam.decorators.length === 0) {
params.push(ts.createNull());
params.push(ts.factory.createNull());
continue;

@@ -207,3 +174,3 @@ }

undefined;
const members = [ts.createPropertyAssignment('type', paramType || ts.createIdentifier('undefined'))];
const members = [ts.factory.createPropertyAssignment('type', paramType || ts.factory.createIdentifier('undefined'))];
const decorators = [];

@@ -214,10 +181,17 @@ for (const deco of ctorParam.decorators) {

if (decorators.length) {
members.push(ts.createPropertyAssignment('decorators', ts.createArrayLiteral(decorators)));
members.push(ts.factory.createPropertyAssignment('decorators', ts.factory.createArrayLiteralExpression(decorators)));
}
params.push(ts.createObjectLiteral(members));
params.push(ts.factory.createObjectLiteralExpression(members));
}
const initializer = ts.createArrowFunction(undefined, undefined, [], undefined, ts.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.createArrayLiteral(params, true));
const type = createCtorParametersClassPropertyType();
const ctorProp = ts.createProperty(undefined, [ts.createToken(ts.SyntaxKind.StaticKeyword)], 'ctorParameters', undefined, type, initializer);
addNoCollapseComment(ctorProp);
const initializer = ts.factory.createArrowFunction(undefined, undefined, [], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createArrayLiteralExpression(params, true));
const ctorProp = ts.factory.createPropertyDeclaration(undefined, [ts.factory.createToken(ts.SyntaxKind.StaticKeyword)], 'ctorParameters', undefined, undefined, initializer);
ts.setSyntheticLeadingComments(ctorProp, [
jsdoc.toSynthesizedComment([
{
tagName: 'type',
type: lines(`function(): !Array<(null|{`, ` type: ?,`, ` decorators: (undefined|${DECORATOR_INVOCATION_JSDOC_TYPE}),`, `})>`),
},
{ tagName: 'nocollapse' }
]),
]);
return ctorProp;

@@ -238,15 +212,9 @@ }

for (const [name, decorators] of properties.entries()) {
entries.push(ts.createPropertyAssignment(name, ts.createArrayLiteral(decorators.map(deco => extractMetadataFromSingleDecorator(deco, diagnostics)))));
entries.push(ts.factory.createPropertyAssignment(name, ts.factory.createArrayLiteralExpression(decorators.map(deco => extractMetadataFromSingleDecorator(deco, diagnostics)))));
}
const initializer = ts.createObjectLiteral(entries, true);
const type = ts.createTypeLiteralNode([ts.createIndexSignature(undefined, undefined, [ts.createParameter(undefined, undefined, undefined, 'key', undefined, ts.createTypeReferenceNode('string', undefined), undefined)], createDecoratorInvocationType())]);
return ts.createProperty(undefined, [ts.createToken(ts.SyntaxKind.StaticKeyword)], 'propDecorators', undefined, type, initializer);
const initializer = ts.factory.createObjectLiteralExpression(entries, true);
const prop = ts.factory.createPropertyDeclaration(undefined, [ts.factory.createToken(ts.SyntaxKind.StaticKeyword)], 'propDecorators', undefined, undefined, initializer);
addJSDocTypeAnnotation(prop, `!Object<string, ${DECORATOR_INVOCATION_JSDOC_TYPE}>`);
return prop;
}
function isNameEqual(classMember, name) {
if (classMember.name === undefined) {
return false;
}
const id = classMember.name;
return id.text === name;
}
/**

@@ -269,6 +237,6 @@ * Returns an expression representing the (potentially) value part for the given node.

case ts.SyntaxKind.ConstructorType:
return ts.createIdentifier('Function');
return ts.factory.createIdentifier('Function');
case ts.SyntaxKind.ArrayType:
case ts.SyntaxKind.TupleType:
return ts.createIdentifier('Array');
return ts.factory.createIdentifier('Array');
case ts.SyntaxKind.TypePredicate:

@@ -278,11 +246,11 @@ case ts.SyntaxKind.TrueKeyword:

case ts.SyntaxKind.BooleanKeyword:
return ts.createIdentifier('Boolean');
return ts.factory.createIdentifier('Boolean');
case ts.SyntaxKind.StringLiteral:
case ts.SyntaxKind.StringKeyword:
return ts.createIdentifier('String');
return ts.factory.createIdentifier('String');
case ts.SyntaxKind.ObjectKeyword:
return ts.createIdentifier('Object');
return ts.factory.createIdentifier('Object');
case ts.SyntaxKind.NumberKeyword:
case ts.SyntaxKind.NumericLiteral:
return ts.createIdentifier('Number');
return ts.factory.createIdentifier('Number');
case ts.SyntaxKind.TypeReference:

@@ -337,3 +305,3 @@ const typeRef = node;

return undefined;
return ts.createPropertyAccess(ref, name.right);
return ts.factory.createPropertyAccessExpression(ref, name.right);
}

@@ -375,3 +343,3 @@ /**

const decorators = decoratorsToKeep.length ?
ts.setTextRange(ts.createNodeArray(decoratorsToKeep), element.decorators) :
ts.setTextRange(ts.factory.createNodeArray(decoratorsToKeep), element.decorators) :
undefined;

@@ -423,3 +391,3 @@ switch (element.kind) {

parametersInfo.push(paramInfo);
const newParam = ts.updateParameter(param,
const newParam = ts.factory.updateParameterDeclaration(param,
// Must pass 'undefined' to avoid emitting decorator metadata.

@@ -429,3 +397,3 @@ decoratorsToKeep.length ? decoratorsToKeep : undefined, param.modifiers, param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer);

}
const updated = ts.updateConstructor(ctor, ctor.decorators, ctor.modifiers, newParameters, ts.visitFunctionBody(ctor.body, visitor, context));
const updated = ts.factory.updateConstructorDeclaration(ctor, ctor.decorators, ctor.modifiers, newParameters, ts.visitFunctionBody(ctor.body, visitor, context));
return [updated, parametersInfo];

@@ -441,3 +409,2 @@ }

function transformClassDeclaration(classDecl) {
classDecl = ts.getMutableClone(classDecl);
const newMembers = [];

@@ -483,3 +450,2 @@ const decoratedProperties = new Map();

}
// const newClassDeclaration = ts.getMutableClone(classDecl);
if (decoratorsToLower.length) {

@@ -499,5 +465,5 @@ newMembers.push(createDecoratorClassProperty(decoratorsToLower));

const newDecorators = decoratorsToKeep.length ?
ts.createNodeArray(decoratorsToKeep) :
ts.factory.createNodeArray(decoratorsToKeep) :
undefined;
return ts.factory.updateClassDeclaration(classDecl, newDecorators, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, ts.setTextRange(ts.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members));
return ts.factory.updateClassDeclaration(classDecl, newDecorators, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, ts.setTextRange(ts.factory.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members));
}

@@ -541,2 +507,5 @@ function visitor(node) {

exports.decoratorDownlevelTransformer = decoratorDownlevelTransformer;
function lines(...s) {
return s.join('\n');
}
//# sourceMappingURL=decorator_downlevel_transformer.js.map

@@ -48,1 +48,12 @@ /**

export declare function transformDecoratorsOutputForClosurePropertyRenaming(diagnostics: ts.Diagnostic[]): (context: ts.TransformationContext) => ts.Transformer<ts.SourceFile>;
/**
* A transformation pass that removes the annotations contained in
* TAGS_CONFLICTING_WITH_DECORATE from toplevel statements of the form `ident =
* tslib_1.__decorate(...)`.
*
* These call statements are generated for decorated classes and other
* declarations. The leading comments of the declarations are cloned to the
* `__decorate()` calls and may contain annotations that are not allowed in this
* context and result in JSCompiler errors.
*/
export declare function transformDecoratorJsdoc(): ts.TransformerFactory<ts.SourceFile>;

@@ -10,4 +10,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.transformDecoratorsOutputForClosurePropertyRenaming = exports.hasExportingDecorator = exports.getDecoratorDeclarations = void 0;
exports.transformDecoratorJsdoc = exports.transformDecoratorsOutputForClosurePropertyRenaming = exports.hasExportingDecorator = exports.getDecoratorDeclarations = void 0;
const ts = require("typescript");
const jsdoc = require("./jsdoc");
const transformer_util_1 = require("./transformer_util");

@@ -181,2 +182,59 @@ /**

}
const TAGS_CONFLICTING_WITH_DECORATE = new Set(['template', 'abstract']);
/**
* Removes problematic annotations from JsDoc comments.
*/
function sanitizeDecorateComments(comments) {
const sanitized = [];
for (const comment of comments) {
const parsedComment = jsdoc.parse(comment);
if (parsedComment && parsedComment.tags.length !== 0) {
const filteredTags = parsedComment.tags.filter(t => !(TAGS_CONFLICTING_WITH_DECORATE.has(t.tagName)));
if (filteredTags.length !== 0) {
sanitized.push(jsdoc.toSynthesizedComment(filteredTags));
}
}
}
return sanitized;
}
/**
* A transformation pass that removes the annotations contained in
* TAGS_CONFLICTING_WITH_DECORATE from toplevel statements of the form `ident =
* tslib_1.__decorate(...)`.
*
* These call statements are generated for decorated classes and other
* declarations. The leading comments of the declarations are cloned to the
* `__decorate()` calls and may contain annotations that are not allowed in this
* context and result in JSCompiler errors.
*/
function transformDecoratorJsdoc() {
return (context) => {
const transformer = (sourceFile) => {
for (const stmt of sourceFile.statements) {
// Only need to iterate over top-level statements in the source
// file.
if (!ts.isExpressionStatement(stmt))
continue;
const comments = ts.getSyntheticLeadingComments(stmt);
if (!comments || comments.length === 0)
continue;
const expr = stmt.expression;
if (!ts.isBinaryExpression(expr))
continue;
if (expr.operatorToken.kind !== ts.SyntaxKind.EqualsToken)
continue;
const rhs = expr.right;
if (!ts.isCallExpression(rhs))
continue;
if (ts.isIdentifier(rhs.expression) &&
(rhs.expression.text === '__decorate')) {
ts.setSyntheticLeadingComments(stmt, sanitizeDecorateComments(comments));
}
}
return sourceFile;
};
return transformer;
};
}
exports.transformDecoratorJsdoc = transformDecoratorJsdoc;
//# sourceMappingURL=decorators.js.map

@@ -602,32 +602,6 @@ "use strict";

}
const newStmt = createGoogLoadedModulesRegistration(arg.text, ts.createIdentifier('exports'));
const newStmt = transformer_util_1.createGoogLoadedModulesRegistration(arg.text, ts.createIdentifier('exports'));
return ts.setOriginalNode(ts.setTextRange(newStmt, original), original);
}
/**
* Rewrite goog.legacyModule to something that works in a goog.module.
*
* goog.tsMigrationExportShim reexports some of the exports of the local
* TS module under a new goog.module ID. This isn't possible with the
* public APIs, but we can make it work at runtime by writing a record to
* goog.loadedModules_.
*
* This only works at runtime, and would fail if compiled by closure
* compiler, but that's ok because we only transpile JS in development
* mode.
*/
function maybeRewriteTsMigrationExportsShim(original, call) {
if (!transformer_util_1.isAnyTsmesCall(call)) {
return null;
}
if (call.arguments.length !== 2) {
return null;
}
const moduleId = call.arguments[0];
if (!ts.isStringLiteral(moduleId)) {
return null;
}
const newStmt = createGoogLoadedModulesRegistration(moduleId.text, call.arguments[1] || ts.createNull());
return ts.setOriginalNode(ts.setTextRange(newStmt, original), original);
}
/**
* maybeRewriteRequireTslib rewrites a require('tslib') calls to

@@ -884,12 +858,2 @@ * goog.require('tslib'). It returns the input statement untouched if it

}
// Check for declareModuleId.
const legacyModule = maybeRewriteTsMigrationExportsShim(exprStmt, callExpr);
if (legacyModule) {
// Only rewrite tsmes if the output is meant for execution. Just
// delete it if the output is targeting JSCompiler.
if (!host.transformTypesToClosure) {
statements.push(legacyModule);
}
return;
}
// Check for __exportStar, the commonjs version of 'export *'.

@@ -1017,21 +981,2 @@ // export * creates either a pure top-level '__export(require(...))'

}
/**
* Create code like:
*
* goog.loadedModules_['foo.bar'] = {
* exports: exports,
* type: goog.ModuleType.GOOG,
* moduleId: 'foo.bar'
* };
*
* For more info, see `goog.loadModule` in
* https://github.com/google/closure-library/blob/master/closure/goog/base.js
*/
function createGoogLoadedModulesRegistration(moduleId, exports) {
return ts.createStatement(ts.createAssignment(ts.createElementAccess(ts.createPropertyAccess(ts.createIdentifier('goog'), ts.createIdentifier('loadedModules_')), transformer_util_1.createSingleQuoteStringLiteral(moduleId)), ts.createObjectLiteral([
ts.createPropertyAssignment('exports', exports),
ts.createPropertyAssignment('type', ts.createPropertyAccess(ts.createPropertyAccess(ts.createIdentifier('goog'), ts.createIdentifier('ModuleType')), ts.createIdentifier('GOOG'))),
ts.createPropertyAssignment('moduleId', transformer_util_1.createSingleQuoteStringLiteral(moduleId)),
])));
}
//# sourceMappingURL=googmodule.js.map

@@ -45,2 +45,7 @@ /**

/**
* Tags that conflict with \@type in Closure Compiler and must always be
* escaped (e.g. \@param).
*/
export declare const TAGS_CONFLICTING_WITH_TYPE: Set<string>;
/**
* Result of parsing a JSDoc comment. Such comments essentially are built of a list of tags.

@@ -70,4 +75,2 @@ * In addition to the tags, this might also contain warnings to indicate non-fatal problems

export declare function parseContents(commentText: string): ParsedJSDocComment | null;
/** Tags that conflict with \@type in Closure Compiler (e.g. \@param). */
export declare const TAGS_CONFLICTING_WITH_TYPE: Set<string>;
/**

@@ -99,3 +102,3 @@ * A synthesized comment that (possibly) includes the original comment range it was created from.

export declare function suppressLeadingCommentsRecursively(node: ts.Node): void;
export declare function toSynthesizedComment(tags: Tag[], escapeExtraTags?: Set<string>): ts.SynthesizedComment;
export declare function toSynthesizedComment(tags: Tag[], escapeExtraTags?: Set<string>, hasTrailingNewLine?: boolean): ts.SynthesizedComment;
/** Serializes a Comment out to a string, but does not include the start and end comment tokens. */

@@ -102,0 +105,0 @@ export declare function toStringWithoutStartEnd(tags: Tag[], escapeExtraTags?: Set<string>): string;

@@ -10,3 +10,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createGeneratedFromComment = exports.merge = exports.toString = exports.toStringWithoutStartEnd = exports.toSynthesizedComment = exports.suppressLeadingCommentsRecursively = exports.getLeadingCommentRangesSynthesized = exports.synthesizeLeadingComments = exports.TAGS_CONFLICTING_WITH_TYPE = exports.parseContents = exports.normalizeLineEndings = exports.parse = void 0;
exports.createGeneratedFromComment = exports.merge = exports.toString = exports.toStringWithoutStartEnd = exports.toSynthesizedComment = exports.suppressLeadingCommentsRecursively = exports.getLeadingCommentRangesSynthesized = exports.synthesizeLeadingComments = exports.parseContents = exports.normalizeLineEndings = exports.parse = exports.TAGS_CONFLICTING_WITH_TYPE = void 0;
const ts = require("typescript");

@@ -117,2 +117,7 @@ /**

/**
* Tags that conflict with \@type in Closure Compiler and must always be
* escaped (e.g. \@param).
*/
exports.TAGS_CONFLICTING_WITH_TYPE = new Set(['param', 'return']);
/**
* JSDoc \@tags that might include a {type} after them. Specifying a type is forbidden, since it

@@ -126,4 +131,3 @@ * would collide with TypeScript's type information. If a type *is* given, the entire tag will be

'export',
'param',
'return',
...exports.TAGS_CONFLICTING_WITH_TYPE
]);

@@ -297,4 +301,2 @@ /**

const SINGLETON_TAGS = new Set(['deprecated']);
/** Tags that conflict with \@type in Closure Compiler (e.g. \@param). */
exports.TAGS_CONFLICTING_WITH_TYPE = new Set(['param', 'return']);
/**

@@ -348,3 +350,2 @@ * synthesizeLeadingComments parses the leading comments of node, converts them

const originalStart = node.getFullStart();
const actualStart = node.getStart();
function suppressCommentsInternal(node) {

@@ -361,3 +362,3 @@ ts.setEmitFlags(node, ts.EmitFlags.NoLeadingComments);

exports.suppressLeadingCommentsRecursively = suppressLeadingCommentsRecursively;
function toSynthesizedComment(tags, escapeExtraTags) {
function toSynthesizedComment(tags, escapeExtraTags, hasTrailingNewLine = true) {
return {

@@ -368,3 +369,3 @@ kind: ts.SyntaxKind.MultiLineCommentTrivia,

end: -1,
hasTrailingNewLine: true,
hasTrailingNewLine,
};

@@ -371,0 +372,0 @@ }

@@ -145,3 +145,16 @@ "use strict";

}
return this.newTypeTranslator(context).translate(type);
try {
return this.newTypeTranslator(context).translate(type);
}
catch (e) {
if (!(e instanceof Error))
throw e; // should not happen (tm)
const sourceFile = context.getSourceFile();
const { line, character } = context.pos !== -1 ?
sourceFile.getLineAndCharacterOfPosition(context.pos) :
{ line: 0, character: 0 };
e.message = `internal error converting type at ${sourceFile.fileName}:${line}:${character}:\n\n` +
e.message;
throw e;
}
}

@@ -148,0 +161,0 @@ newTypeTranslator(context) {

@@ -141,1 +141,14 @@ /**

export declare function isTsmesShorthandCall(n: ts.Node): n is ts.CallExpression;
/**
* Create code like:
*
* goog.loadedModules_['foo.bar'] = {
* exports: exports,
* type: goog.ModuleType.GOOG,
* moduleId: 'foo.bar'
* };
*
* For more info, see `goog.loadModule` in
* https://github.com/google/closure-library/blob/master/closure/goog/base.js
*/
export declare function createGoogLoadedModulesRegistration(moduleId: string, exports: ts.Expression): ts.Statement;

@@ -10,3 +10,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.isTsmesShorthandCall = exports.isAnyTsmesCall = exports.isGoogCallExpressionOf = exports.getGoogFunctionName = exports.createGoogCall = exports.getAllLeadingComments = exports.reportDiagnostic = exports.reportDebugWarning = exports.createMultiLineComment = exports.createSingleLineComment = exports.createSingleQuoteStringLiteral = exports.isTypeNodeKind = exports.updateSourceFileNode = exports.visitEachChild = exports.createNotEmittedStatement = exports.synthesizeCommentRanges = exports.createNotEmittedStatementWithComments = exports.unescapeName = exports.getEntityNameText = exports.symbolIsValue = exports.getIdentifierText = exports.isDtsFileName = exports.isAmbient = exports.hasModifierFlag = void 0;
exports.createGoogLoadedModulesRegistration = exports.isTsmesShorthandCall = exports.isAnyTsmesCall = exports.isGoogCallExpressionOf = exports.getGoogFunctionName = exports.createGoogCall = exports.getAllLeadingComments = exports.reportDiagnostic = exports.reportDebugWarning = exports.createMultiLineComment = exports.createSingleLineComment = exports.createSingleQuoteStringLiteral = exports.isTypeNodeKind = exports.updateSourceFileNode = exports.visitEachChild = exports.createNotEmittedStatement = exports.synthesizeCommentRanges = exports.createNotEmittedStatementWithComments = exports.unescapeName = exports.getEntityNameText = exports.symbolIsValue = exports.getIdentifierText = exports.isDtsFileName = exports.isAmbient = exports.hasModifierFlag = void 0;
const ts = require("typescript");

@@ -334,2 +334,22 @@ /** @return true if node has the specified modifier flag set. */

exports.isTsmesShorthandCall = isTsmesShorthandCall;
/**
* Create code like:
*
* goog.loadedModules_['foo.bar'] = {
* exports: exports,
* type: goog.ModuleType.GOOG,
* moduleId: 'foo.bar'
* };
*
* For more info, see `goog.loadModule` in
* https://github.com/google/closure-library/blob/master/closure/goog/base.js
*/
function createGoogLoadedModulesRegistration(moduleId, exports) {
return ts.createStatement(ts.createAssignment(ts.createElementAccess(ts.createPropertyAccess(ts.createIdentifier('goog'), ts.createIdentifier('loadedModules_')), createSingleQuoteStringLiteral(moduleId)), ts.createObjectLiteral([
ts.createPropertyAssignment('exports', exports),
ts.createPropertyAssignment('type', ts.createPropertyAccess(ts.createPropertyAccess(ts.createIdentifier('goog'), ts.createIdentifier('ModuleType')), ts.createIdentifier('GOOG'))),
ts.createPropertyAssignment('moduleId', createSingleQuoteStringLiteral(moduleId)),
])));
}
exports.createGoogLoadedModulesRegistration = createGoogLoadedModulesRegistration;
//# sourceMappingURL=transformer_util.js.map
/**
* @fileoverview
* @suppress {untranspilableFeatures} ES2018 feature "RegExp named groups"
* @license

@@ -8,17 +10,8 @@ * Copyright Google Inc. All Rights Reserved.

*/
/**
* Processes goog.tsMigrationExportsShim, goog.tsMigrationDefaultExportsShim,
* and goog.tsMigrationNamedExportsShim statements into
* ".legacy.closure.js" and ".legacy.d.ts" files.
*/
import * as ts from 'typescript';
import { ModulesManifest } from './modules_manifest';
/** Silence linter. */
export interface TsMigrationExportsShimResult {
filename: string;
content: string;
diagnostics: ts.Diagnostic[];
}
/** Provides dependencies for file generation. */
export interface TsMigrationExportsShimProcessorHost {
/** Are tsMigrationExports calls allowed and should shim files be emitted? */
generateTsMigrationExportsShim?: boolean;
/** If true emit .legacy.closure.js file, else emit .legacy.d.ts */

@@ -31,8 +24,23 @@ transformTypesToClosure?: boolean;

}
/** Silence linter. */
export declare function generateTsMigrationExportsShimFile(src: ts.SourceFile, typeChecker: ts.TypeChecker, host: TsMigrationExportsShimProcessorHost, manifest: ModulesManifest): TsMigrationExportsShimResult;
/**
* Does this path have a file extension that supports
* calls to tsmes?
* A map from google3 relative paths to shim file content.
*/
export declare function pathHasSupportedExtension(p: string): boolean;
export declare type TsMigrationExportsShimFileMap = Map<string, string>;
/**
* Creates a transformer that eliminates goog.tsMigration*ExportsShim (tsmes)
* statements and generates appropriate shim file content.
*
* This transformation will always report an error if
* `generateTsMigrationExportsShim` is false.
*
* If `transformTypesToClosure` is true:
* - tsmes calls are deleted
* - a "*.tsmes.closure.js" file is generated containing a goog.module that
* re-exports the specified exports from the input file
* Else:
* - tsmes calls are replaced with insertions into the Closure debug module
* loader
* - a "*.tsmes.d.ts" file is generated containing Clutz-like re-exports of
* the specified exports from the input file
*/
export declare function createTsMigrationExportsShimTransformerFactory(typeChecker: ts.TypeChecker, host: TsMigrationExportsShimProcessorHost, manifest: ModulesManifest, tsickleDiagnostics: ts.Diagnostic[], outputFileMap: TsMigrationExportsShimFileMap): ts.TransformerFactory<ts.SourceFile>;
"use strict";
/**
* @fileoverview
* @suppress {untranspilableFeatures} ES2018 feature "RegExp named groups"
* @license

@@ -10,26 +12,33 @@ * Copyright Google Inc. All Rights Reserved.

Object.defineProperty(exports, "__esModule", { value: true });
exports.pathHasSupportedExtension = exports.generateTsMigrationExportsShimFile = void 0;
/**
* Processes goog.tsMigrationExportsShim, goog.tsMigrationDefaultExportsShim,
* and goog.tsMigrationNamedExportsShim statements into
* ".legacy.closure.js" and ".legacy.d.ts" files.
*/
exports.createTsMigrationExportsShimTransformerFactory = void 0;
const ts = require("typescript");
const transformer_util_1 = require("./transformer_util");
/** Silence linter. */
function generateTsMigrationExportsShimFile(src, typeChecker, host, manifest) {
const srcFilename = host.rootDirsRelative(src.fileName);
const srcModuleId = host.pathToModuleName('', src.fileName);
const srcIds = new FileIdGroup(srcFilename, srcModuleId);
return new Generator(src, typeChecker, host, manifest, srcIds).run();
}
exports.generateTsMigrationExportsShimFile = generateTsMigrationExportsShimFile;
/**
* Does this path have a file extension that supports
* calls to tsmes?
* Creates a transformer that eliminates goog.tsMigration*ExportsShim (tsmes)
* statements and generates appropriate shim file content.
*
* This transformation will always report an error if
* `generateTsMigrationExportsShim` is false.
*
* If `transformTypesToClosure` is true:
* - tsmes calls are deleted
* - a "*.tsmes.closure.js" file is generated containing a goog.module that
* re-exports the specified exports from the input file
* Else:
* - tsmes calls are replaced with insertions into the Closure debug module
* loader
* - a "*.tsmes.d.ts" file is generated containing Clutz-like re-exports of
* the specified exports from the input file
*/
function pathHasSupportedExtension(p) {
return Boolean(p.match(SUPPORTED_EXTENSIONS));
function createTsMigrationExportsShimTransformerFactory(typeChecker, host, manifest, tsickleDiagnostics, outputFileMap) {
return (context) => {
return (src) => {
const result = new Generator(src, typeChecker, host, manifest).run();
outputFileMap.set(result.filename, result.content);
tsickleDiagnostics.push(...result.diagnostics);
return result.transformedSrc;
};
};
}
exports.pathHasSupportedExtension = pathHasSupportedExtension;
exports.createTsMigrationExportsShimTransformerFactory = createTsMigrationExportsShimTransformerFactory;
function stripSupportedExtensions(path) {

@@ -40,12 +49,5 @@ return path.replace(SUPPORTED_EXTENSIONS, '');

const SUPPORTED_EXTENSIONS = /(?<!\.d)\.ts$/;
/**
* A one-time-use object for generating TS Migration Export Shims.
*
* The generator is able to emit two different outputs: .js and .d.ts. Only one
* of thse should be produced for a given src file. The choice of which depends
* on whether tsickle is producing code for downstream typechecking (.d.ts file
* for TS libraries) or optimization (.js files for Closure Compiler).
*/
/** A one-time-use object for running the tranformation. */
class Generator {
constructor(src, typeChecker, host, manifest, srcIds) {
constructor(src, typeChecker, host, manifest) {
this.src = src;

@@ -55,3 +57,2 @@ this.typeChecker = typeChecker;

this.manifest = manifest;
this.srcIds = srcIds;
this.diagnostics = [];

@@ -61,3 +62,20 @@ const moduleSymbol = this.typeChecker.getSymbolAtLocation(this.src);

moduleSymbol ? this.typeChecker.getExportsOfModule(moduleSymbol) : [];
const srcFilename = host.rootDirsRelative(src.fileName);
const srcModuleId = host.pathToModuleName('', src.fileName);
this.srcIds = new FileIdGroup(srcFilename, srcModuleId);
}
/**
* Eliminates goog.tsMigration*ExportsShim (tsmes)
* statements and generates appropriate shim file content.
*
* If `transformTypesToClosure` is true:
* - tsmes calls are deleted
* - a "*.tsmes.closure.js" file is generated containing a goog.module that
* re-exports the specified exports from the input file
* Else:
* - tsmes calls are replaced with insertions into the Closure debug module
* loader
* - a "*.tsmes.d.ts" file is generated containing Clutz-like re-exports of
* the specified exports from the input file
*/
run() {

@@ -67,13 +85,14 @@ const outputFilename = this.srcIds.google3PathWithoutExtension() +

'.tsmes.d.ts');
const tsmessBreakdown = this.extractTsmesStatement();
if (!tsmessBreakdown) {
const tsmesBreakdown = this.extractTsmesStatement();
if (!tsmesBreakdown) {
return {
filename: outputFilename,
content: '',
transformedSrc: this.src,
diagnostics: this.diagnostics,
};
}
this.tsmesBreakdown = tsmesBreakdown;
this.outputIds =
new FileIdGroup(outputFilename, tsmessBreakdown.googModuleId);
this.googExports = tsmessBreakdown.googExports;
new FileIdGroup(outputFilename, tsmesBreakdown.googModuleId.text);
return {

@@ -83,2 +102,3 @@ filename: outputFilename,

this.generateTsmesDts(),
transformedSrc: this.transformSourceFile(),
diagnostics: this.diagnostics,

@@ -95,3 +115,4 @@ };

extractTsmesStatement() {
let tsmesCall = undefined;
const startDiagnosticsCount = this.diagnostics.length;
let tsmesCallStatement = undefined;
for (const statement of this.src.statements) {

@@ -103,5 +124,4 @@ if (!ts.isExpressionStatement(statement) ||

}
const call = statement.expression;
if (tsmesCall) {
this.report(call, 'at most one call to any of goog.tsMigrationExportsShim, ' +
if (tsmesCallStatement) {
this.report(tsmesCallStatement, 'at most one call to any of goog.tsMigrationExportsShim, ' +
'goog.tsMigrationDefaultExportsShim, ' +

@@ -111,8 +131,14 @@ 'goog.tsMigrationNamedExportsShim is allowed per file');

else {
tsmesCall = call;
tsmesCallStatement = statement;
}
}
if (!tsmesCall) {
if (!tsmesCallStatement) {
return undefined;
}
else if (!this.host.generateTsMigrationExportsShim) {
this.report(tsmesCallStatement, 'calls to goog.tsMigration*ExportsShim are not enabled. Did you' +
' remember to set generate_ts_migration_exports_shim?');
return undefined;
}
const tsmesCall = tsmesCallStatement.expression;
if (transformer_util_1.isGoogCallExpressionOf(tsmesCall, 'tsMigrationExportsShim') &&

@@ -160,7 +186,13 @@ tsmesCall.arguments.length !== 2) {

default:
this.report(tsmesCall, `encountered unhandled goog.$fnName: ${fnName}`);
throw new Error();
throw new Error(`encountered unhandled goog.$fnName: ${fnName}`);
}
return googExports === undefined ? undefined : {
googModuleId: moduleId.text,
if (googExports === undefined) {
if (startDiagnosticsCount >= this.diagnostics.length) {
throw new Error('googExports should be defined unless some diagnostic is reported.');
}
return undefined;
}
return {
callStatement: tsmesCallStatement,
googModuleId: moduleId,
googExports,

@@ -280,4 +312,4 @@ };

generateTsmesJs() {
if (!this.outputIds || !this.googExports) {
throw new Error();
if (!this.outputIds || !this.tsmesBreakdown) {
throw new Error('tsmes call must be extracted first');
}

@@ -288,5 +320,6 @@ const mainRequireImports = this.mainExports.map((e) => e.name).join(', ');

let exportsAssignment;
if (this.googExports instanceof Map) {
if (this.tsmesBreakdown.googExports instanceof Map) {
// In the case that tsmes was passed named exports.
const bindings = Array.from(this.googExports).map(([k, v]) => ` ${k}: ${v},`);
const bindings = Array.from(this.tsmesBreakdown.googExports)
.map(([k, v]) => ` ${k}: ${v},`);
exportsAssignment = lines(`exports = {`, ...bindings, `};`);

@@ -296,3 +329,3 @@ }

// In the case that tsmes was passed a default export.
exportsAssignment = `exports = ${this.googExports};`;
exportsAssignment = `exports = ${this.tsmesBreakdown.googExports};`;
}

@@ -315,4 +348,4 @@ this.manifest.addModule(this.outputIds.google3Path, this.outputIds.googModuleId);

generateTsmesDts() {
if (!this.outputIds || !this.googExports) {
throw new Error();
if (!this.outputIds || !this.tsmesBreakdown) {
throw new Error('tsmes call must be extracted first');
}

@@ -323,6 +356,6 @@ const generatedFromComment = '// Generated from ' + this.srcIds.google3Path;

let googColonModuleDeclaration;
if (this.googExports instanceof Map) {
if (this.tsmesBreakdown.googExports instanceof Map) {
// In the case that tsmes was passed named exports.
const clutzNamespace = this.srcIds.clutzNamespace();
const clutzNamespaceReexports = Array.from(this.googExports)
const clutzNamespaceReexports = Array.from(this.tsmesBreakdown.googExports)
.map(([k, v]) => ` export import ${k} = ${clutzNamespace}.${v};`);

@@ -334,3 +367,3 @@ clutzNamespaceDeclaration = lines(generatedFromComment, `declare namespace ${this.outputIds.clutzNamespace()} {`, ...clutzNamespaceReexports, `}`);

// In the case that tsmes was passed a default export.
clutzNamespaceDeclaration = lines(generatedFromComment, `declare namespace ಠ_ಠ.clutz {`, ` export import ${this.outputIds.googModuleRewrittenId()} =`, ` ${this.srcIds.clutzNamespace()}.${this.googExports};`, `}`);
clutzNamespaceDeclaration = lines(generatedFromComment, `declare namespace ಠ_ಠ.clutz {`, ` export import ${this.outputIds.googModuleRewrittenId()} =`, ` ${this.srcIds.clutzNamespace()}.${this.tsmesBreakdown.googExports};`, `}`);
googColonModuleDeclaration = lines(generatedFromComment, `declare module '${this.outputIds.clutzModuleId()}' {`, ` import x = ${this.outputIds.clutzNamespace()};`, ` export default x;`, `}`);

@@ -340,2 +373,43 @@ }

}
/**
* Rewrite the tsmes call into something that works in a goog.module.
*
* tsmes reexports some of the exports of the local TS module under a new
* goog.module ID. This isn't possible with the public APIs, but we can make
* it work at runtime by writing a record to goog.loadedModules_.
*
* This only works at runtime, and would fail if compiled by closure
* compiler, but that's ok because we only transpile JS in development
* mode.
*/
transformSourceFile() {
if (!this.outputIds || !this.tsmesBreakdown) {
throw new Error('tsmes call must be extracted first');
}
const outputStatements = [...this.src.statements];
const tsmesIndex = outputStatements.indexOf(this.tsmesBreakdown.callStatement);
if (tsmesIndex < 0) {
throw new Error('could not find tsmes call in file');
}
if (this.host.transformTypesToClosure) {
// For Closure compilation code, just delete the tsmes call.
outputStatements.splice(tsmesIndex, 1);
}
else {
let exportsObj;
if (this.tsmesBreakdown.googExports instanceof Map) {
// `{PublicName: PrivateName, ...}`
const bindings = Array.from(this.tsmesBreakdown.googExports)
.map(([k, v]) => ts.createPropertyAssignment(ts.createIdentifier(k), ts.createIdentifier(v)));
exportsObj = ts.createObjectLiteral(bindings);
}
else {
exportsObj = ts.createIdentifier(this.tsmesBreakdown.googExports);
}
// For browser executable code, insert an entry for the shim module into
// the debug loader module map.
outputStatements.splice(tsmesIndex, 1, transformer_util_1.createGoogLoadedModulesRegistration(this.outputIds.googModuleId, exportsObj));
}
return ts.updateSourceFileNode(this.src, ts.setTextRange(ts.createNodeArray(outputStatements), this.src.statements));
}
checkIsModuleExport(node, symbol) {

@@ -353,4 +427,4 @@ if (!symbol) {

}
report(node, messageText, textRange, category = ts.DiagnosticCategory.Error) {
transformer_util_1.reportDiagnostic(this.diagnostics, node, messageText, textRange, category);
report(node, messageText) {
transformer_util_1.reportDiagnostic(this.diagnostics, node, messageText, undefined, ts.DiagnosticCategory.Error);
}

@@ -389,4 +463,5 @@ }

function containsAtPintoModule(file) {
return /\s@pintomodule\s/.test(file.getFullText());
const leadingTrivia = file.getFullText().substring(0, file.getLeadingTriviaWidth());
return /\s@pintomodule\s/.test(leadingTrivia);
}
//# sourceMappingURL=ts_migration_exports_shim.js.map

@@ -25,2 +25,4 @@ /**

transformTypesToClosure?: boolean;
/** Are tsMigrationExports calls allowed and should shim files be emitted? */
generateTsMigrationExportsShim?: boolean;
/**

@@ -61,3 +63,3 @@ * Whether to add aliases to the .d.ts files to add the exports to the

*/
tsMigrationExportsShimFiles: Map<string, string>;
tsMigrationExportsShimFiles: tsmes.TsMigrationExportsShimFileMap;
}

@@ -64,0 +66,0 @@ export interface EmitTransformers {

@@ -93,3 +93,6 @@ "use strict";

}
const modulesManifest = new modules_manifest_1.ModulesManifest();
const tsMigrationExportsShimFiles = new Map();
const tsickleSourceTransformers = [];
tsickleSourceTransformers.push(tsmes.createTsMigrationExportsShimTransformerFactory(typeChecker, host, modulesManifest, tsickleDiagnostics, tsMigrationExportsShimFiles));
if (host.transformTypesToClosure) {

@@ -105,3 +108,2 @@ // Only add @suppress {checkTypes} comments when also adding type

}
const modulesManifest = new modules_manifest_1.ModulesManifest();
const tsTransformers = {

@@ -123,2 +125,3 @@ before: [

tsTransformers.after.push(decorators_1.transformDecoratorsOutputForClosurePropertyRenaming(tsickleDiagnostics));
tsTransformers.after.push(decorators_1.transformDecoratorJsdoc());
}

@@ -146,13 +149,2 @@ if (host.addDtsClutzAliases) {

}
const tsMigrationExportsShimFiles = new Map();
{
const sourceFiles = targetSourceFile ? [targetSourceFile] : program.getSourceFiles();
const filteredSourceFiles = sourceFiles.filter((f) => tsmes.pathHasSupportedExtension(f.fileName))
.filter((f) => !host.shouldSkipTsickleProcessing(f.fileName));
for (const f of filteredSourceFiles) {
const result = tsmes.generateTsMigrationExportsShimFile(f, typeChecker, host, modulesManifest);
tsMigrationExportsShimFiles.set(result.filename, result.content);
tsickleDiagnostics.push(...result.diagnostics);
}
}
// All diagnostics (including warnings) are treated as errors.

@@ -159,0 +151,0 @@ // If the host decides to ignore warnings, just discard them.

@@ -116,2 +116,3 @@ /**

private translateUnion;
private translateUnionMembers;
private translateEnumLiteral;

@@ -118,0 +119,0 @@ private translateObject;

@@ -539,6 +539,9 @@ "use strict";

translateUnion(type) {
return this.translateUnionMembers(type.types);
}
translateUnionMembers(types) {
// Union types that include literals (e.g. boolean, enum) can end up repeating the same Closure
// type. For example: true | boolean will be translated to boolean | boolean.
// Remove duplicates to produce types that read better.
const parts = new Set(type.types.map(t => this.translate(t)));
const parts = new Set(types.map(t => this.translate(t)));
// If it's a single element set, return the single member.

@@ -633,4 +636,8 @@ if (parts.size === 1)

// A tuple is a ReferenceType where the target is flagged Tuple and the
// typeArguments are the tuple arguments. Just treat it as a mystery
// array, because Closure doesn't understand tuples.
// typeArguments are the tuple arguments. Closure Compiler does not
// support tuple types, so tsickle emits this as `Array<?>`.
// It would also be possible to emit an Array of the union of the
// constituent types. In experimentation, this however does not seem to
// improve optimization compatibility much, as long as destructuring
// assignments are aliased.
if (referenceType.target.objectFlags & ts.ObjectFlags.Tuple) {

@@ -678,3 +685,2 @@ return '!Array<?>';

TODO(ts2.1): more unhandled object type flags:
Tuple
Mapped

@@ -681,0 +687,0 @@ Instantiated

{
"name": "tsickle",
"version": "0.43.0",
"version": "0.46.0",
"description": "Transpile TypeScript code to JavaScript with Closure annotations.",

@@ -14,3 +14,3 @@ "main": "out/src/tsickle.js",

"peerDependencies": {
"typescript": "~4.3"
"typescript": "h-joo/TypeScript#ts45-no-double-comments"
},

@@ -25,3 +25,3 @@ "devDependencies": {

"glob": "7.1.2",
"google-closure-compiler": "^20190929.0.0",
"google-closure-compiler": "^20211006.0.0",
"jasmine": "^3.7.0",

@@ -33,3 +33,3 @@ "jasmine-node": "^3.0.0",

"tslint": "^6.1.3",
"typescript": "~4.3"
"typescript": "h-joo/TypeScript#ts45-no-double-comments"
},

@@ -36,0 +36,0 @@ "scripts": {

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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

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

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