Socket
Socket
Sign inDemoInstall

@databases/shared-print-types

Package Overview
Dependencies
4
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0-canary-1685

2

lib/PrintContext.d.ts

@@ -8,2 +8,3 @@ import PrintOptions from './PrintOptions';

export interface FileExport {
mode: 'type' | 'value';
file: FileName;

@@ -19,2 +20,3 @@ isDefaultExport: () => boolean;

pushTypeDeclaration(id: TypeID, declaration: (identifier: IdentifierName, imp: FileContext) => string[]): FileExport;
pushReExport(id: TypeID, from: FileExport): void;
pushValueDeclaration(id: TypeID, declaration: (identifier: IdentifierName, imp: FileContext) => string[]): FileExport;

@@ -21,0 +23,0 @@ getFiles(): {

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

this._declarations = [];
this._reExports = { type: [], value: [] };
this.file = file;

@@ -92,2 +93,3 @@ this._options = options;

return {
mode,
file: this.file,

@@ -98,2 +100,14 @@ isDefaultExport: () => this.getDefaultName() === identifierName,

}
pushReExport(dest, source) {
const identifierName = (0, PrintOptions_1.resolveExportName)(dest, this._options);
if (this._declarationNames.has(identifierName)) {
return;
}
const importedName = this._getImportState(source.file).getImport(source);
this._declarationNames.add(identifierName);
this._reExports[source.mode].push({
source: importedName,
dest: identifierName,
});
}
getContent() {

@@ -113,2 +127,20 @@ return ([

...this._declarations.map((v) => v().join('\n')),
...(this._reExports.type.length
? [
`export type {\n${this._reExports.type
.map((t) => t.source === t.dest
? ` ${t.source},`
: ` ${t.source} as ${t.dest},`)
.join(`\n`)}\n}`,
]
: []),
...(this._reExports.value.length
? [
`export {\n${this._reExports.value
.map((t) => t.source === t.dest
? ` ${t.source},`
: ` ${t.source} as ${t.dest},`)
.join(`\n`)}\n}`,
]
: []),
].join('\n\n') + '\n');

@@ -130,2 +162,7 @@ }

}
pushReExport(id, from) {
const file = (0, PrintOptions_1.resolveFilename)(id, this.options);
const fileContent = mapGetOrSet(this._files, file, () => new FileContent(file, this.options));
fileContent.pushReExport(id, from);
}
pushValueDeclaration(id, declaration) {

@@ -132,0 +169,0 @@ return this._pushDeclaration(id, 'value', declaration);

2

package.json
{
"name": "@databases/shared-print-types",
"version": "1.0.0",
"version": "1.1.0-canary-1685",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc