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

@cldcvr/custom-elements-manifest-to-types

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cldcvr/custom-elements-manifest-to-types - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

18

dist/index.js

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

const moduleName = modulePath || "./src"; //module.path.slice(0, -3);
const extractedTypes = new Set();
(_a = module.declarations) === null || _a === void 0 ? void 0 : _a.forEach((declaration) => {

@@ -202,3 +203,2 @@ if (!("customElement" in declaration) || !declaration.customElement) {

if (declaration.attributes) {
const extractedTypes = new Set();
declaration.attributes.forEach((attribute) => {

@@ -215,12 +215,12 @@ var _a;

});
if (extractedTypes.size > 0) {
let importStatement = `import type { `;
Array.from(extractedTypes).forEach((et, idx) => {
importStatement += `${et}${idx < extractedTypes.size - 1 ? "," : ""}`;
});
importStatement += `} from '${moduleName}';`;
moduleTypeImports.push(importStatement);
}
}
});
if (extractedTypes.size > 0) {
let importStatement = `import type { `;
Array.from(extractedTypes).forEach((et, idx) => {
importStatement += `${et}${idx < extractedTypes.size - 1 ? "," : ""}`;
});
importStatement += `} from '${moduleName}';`;
moduleTypeImports.push(importStatement);
}
});

@@ -227,0 +227,0 @@ return moduleTypeImports;

@@ -220,2 +220,3 @@ import { Declaration, Package, PropertyLike } from "custom-elements-manifest/schema";

const moduleName = modulePath || "./src"; //module.path.slice(0, -3);
const extractedTypes: Set<string> = new Set();
module.declarations?.forEach((declaration) => {

@@ -227,3 +228,2 @@ if (!("customElement" in declaration) || !declaration.customElement) {

if (declaration.attributes) {
const extractedTypes: Set<string> = new Set();
declaration.attributes.forEach((attribute) => {

@@ -239,13 +239,12 @@ if (attribute.type?.text) {

});
if (extractedTypes.size > 0) {
let importStatement = `import type { `;
Array.from(extractedTypes).forEach((et, idx) => {
importStatement += `${et}${idx < extractedTypes.size - 1 ? "," : ""}`;
});
importStatement += `} from '${moduleName}';`;
moduleTypeImports.push(importStatement);
}
}
});
if (extractedTypes.size > 0) {
let importStatement = `import type { `;
Array.from(extractedTypes).forEach((et, idx) => {
importStatement += `${et}${idx < extractedTypes.size - 1 ? "," : ""}`;
});
importStatement += `} from '${moduleName}';`;
moduleTypeImports.push(importStatement);
}
});

@@ -252,0 +251,0 @@

{
"name": "@cldcvr/custom-elements-manifest-to-types",
"version": "1.0.4",
"version": "1.0.5",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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