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

typescript-svelte-plugin

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-svelte-plugin - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

22

dist/src/svelte-snapshots.js

@@ -232,3 +232,23 @@ "use strict";

this.projectService.host.readFile = (path) => {
if ((0, utils_1.isSvelteFilePath)(path) && this.configManager.getConfig().enable) {
// The following (very hacky) first two checks make sure that the ambient module definitions
// that tell TS "every import ending with .svelte is a valid module" are removed.
// They exist in svelte2tsx and svelte to make sure that people don't
// get errors in their TS files when importing Svelte files and not using our TS plugin.
// If someone wants to get back the behavior they can add an ambient module definition
// on their own.
const normalizedPath = path.replace(/\\/g, '/');
if (normalizedPath.endsWith('node_modules/svelte/types/runtime/ambient.d.ts')) {
return '';
}
else if (normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts')) {
let originalText = readFile(path) || '';
if (!originalText.includes('// -- start svelte-ls-remove --')) {
return originalText; // uses an older version of svelte2tsx
}
originalText =
originalText.substring(0, originalText.indexOf('// -- start svelte-ls-remove --')) +
originalText.substring(originalText.indexOf('// -- end svelte-ls-remove --'));
return originalText;
}
else if ((0, utils_1.isSvelteFilePath)(path) && this.configManager.getConfig().enable) {
this.logger.debug('Read Svelte file:', path);

@@ -235,0 +255,0 @@ const svelteCode = readFile(path) || '';

2

package.json
{
"name": "typescript-svelte-plugin",
"version": "0.3.1",
"version": "0.3.2",
"description": "A TypeScript Plugin providing Svelte intellisense",

@@ -5,0 +5,0 @@ "main": "dist/src/index.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