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

prettier-plugin-svelte

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-svelte - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

2

package.json
{
"name": "prettier-plugin-svelte",
"version": "0.4.1",
"version": "0.4.2",
"description": "Svelte plugin for prettier",

@@ -5,0 +5,0 @@ "main": "plugin.js",

@@ -61,11 +61,7 @@ 'use strict';

const parts = [];
if (n.css) {
n.css.type = 'Style';
n.css.content.type = 'StyleProgram';
parts.push(path.call(print, 'css'));
if (n.module) {
n.module.type = 'Script';
n.module.attributes = extractAttributes(getText(n.module, options));
parts.push(path.call(print, 'module'));
}
if (n.js) {
n.js.type = 'Script';
parts.push(path.call(print, 'js'));
}
if (n.instance) {

@@ -76,6 +72,6 @@ n.instance.type = 'Script';

}
if (n.module) {
n.module.type = 'Script';
n.module.attributes = extractAttributes(getText(n.module, options));
parts.push(path.call(print, 'module'));
if (n.css) {
n.css.type = 'Style';
n.css.content.type = 'StyleProgram';
parts.push(path.call(print, 'css'));
}

@@ -460,6 +456,9 @@ parts.push(path.call(print, 'html'));

const regex = new RegExp(`<${tagName}([^]*?)>([^]*?)<\/${tagName}>`, 'gi');
return source.replace(regex, (_, attributes, content) => {
const tags = [];
const text = source.replace(regex, (_, attributes, content) => {
const encodedContext = Buffer.from(content).toString('base64');
return `<${tagName}${attributes} ✂prettier:content✂="${encodedContext}">${placeholder}</${tagName}>`;
tags.push(`<${tagName}${attributes} ✂prettier:content✂="${encodedContext}">${placeholder}</${tagName}>`);
return '';
});
return [text, tags];
}

@@ -486,5 +485,7 @@

preprocess: text => {
text = snipTagContent('style', text);
text = snipTagContent('script', text, '{}');
return text;
let styles = [];
let scripts = [];
[text, styles] = snipTagContent('style', text);
[text, scripts] = snipTagContent('script', text, '{}');
return [text.trim(), ...styles, ...scripts].join('');
},

@@ -491,0 +492,0 @@ locStart,

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