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

ts-pkg-installer

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-pkg-installer - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

bin/ts-pkg-installer.d.ts

27

bin/ts-pkg-installer.js

@@ -49,2 +49,3 @@ // ts-pkg-installer.ts

this.secondaryDeclarations = config.secondaryDeclarations || [];
this.noWrap = config.noWrap || false;
this.moduleName = config.moduleName;

@@ -278,2 +279,6 @@ this.localTypingsDir = config.localTypingsDir || 'typings';

var state = 0 /* Header */;
// We may not be wrapping the main declaration in an ambient external module declaration.
if (this.config.noWrap) {
dlog('Main ambient external module declaration disabled');
}
var reducer = function (wrapped, line) {

@@ -297,3 +302,5 @@ if (state === 0 /* Header */) {

// Transitioning out of header state, so emit the module declaration.
wrapped.push(_this.moduleDeclaration());
if (!(_this.config.noWrap)) {
wrapped.push(_this.moduleDeclaration());
}
state = 1 /* Body */;

@@ -303,3 +310,3 @@ }

}
if (state === 1 /* Body */) {
if (state === 1 /* Body */ && !(_this.config.noWrap)) {
// See if we have a declaration of some sort.

@@ -320,10 +327,12 @@ var declarationMatches = line.match(declarationRegex);

return BluePromise.reduce(lines, reducer, []).then(function (wrapped) {
// If we're still in the header (i.e. we had no body lines), then emit the module declaration now.
if (state === 0 /* Header */) {
wrapped.push(_this.moduleDeclaration());
state = 1 /* Body */;
if (!(_this.config.noWrap)) {
// If we're still in the header (i.e. we had no body lines), then emit the module declaration now.
if (state === 0 /* Header */) {
wrapped.push(_this.moduleDeclaration());
state = 1 /* Body */;
}
// End by closing the module declaration
wrapped.push('}');
wrapped.push('');
}
// End by closing the module declaration
wrapped.push('}');
wrapped.push('');
return wrapped.join('\n');

@@ -330,0 +339,0 @@ });

@@ -76,2 +76,6 @@ // ts-pkg-installer.ts

// Disable wrapping of main declaration in its own ambient external module declaration. This is appropriate for
// processing declaration files that already contain ambient external module declarations.
noWrap: boolean;
// Name of the module as specified in the wrapped declaration file. By default, this is the name of the NPM package.

@@ -103,2 +107,3 @@ moduleName: string;

this.secondaryDeclarations = config.secondaryDeclarations || [];
this.noWrap = config.noWrap || false;
this.moduleName = config.moduleName;

@@ -404,2 +409,7 @@ this.localTypingsDir = config.localTypingsDir || 'typings';

// We may not be wrapping the main declaration in an ambient external module declaration.
if (this.config.noWrap) {
dlog('Main ambient external module declaration disabled');
}
var reducer = (wrapped: string[], line: string): string[] => {

@@ -426,3 +436,5 @@

// Transitioning out of header state, so emit the module declaration.
wrapped.push(this.moduleDeclaration());
if (!(this.config.noWrap)) {
wrapped.push(this.moduleDeclaration());
}
state = DeclarationFileState.Body;

@@ -433,3 +445,3 @@ }

if (state === DeclarationFileState.Body) {
if (state === DeclarationFileState.Body && !(this.config.noWrap)) {
// See if we have a declaration of some sort.

@@ -454,12 +466,14 @@ var declarationMatches: string[] = line.match(declarationRegex);

// If we're still in the header (i.e. we had no body lines), then emit the module declaration now.
if (state === DeclarationFileState.Header) {
wrapped.push(this.moduleDeclaration());
state = DeclarationFileState.Body;
if (!(this.config.noWrap)) {
// If we're still in the header (i.e. we had no body lines), then emit the module declaration now.
if (state === DeclarationFileState.Header) {
wrapped.push(this.moduleDeclaration());
state = DeclarationFileState.Body;
}
// End by closing the module declaration
wrapped.push('}');
wrapped.push('');
}
// End by closing the module declaration
wrapped.push('}');
wrapped.push('');
return wrapped.join('\n');

@@ -466,0 +480,0 @@ });

{
"name": "ts-pkg-installer",
"version": "1.0.12",
"version": "1.0.13",
"description": "TypeScript package installer",

@@ -5,0 +5,0 @@ "main": "bin/ts-pkg-installer.js",

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