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

vue-jscodeshift-adapter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-jscodeshift-adapter - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

src/fix-whitespace.js

6

CHANGELOG.md
# Change Log
## [2.2.1] - 2023-10-11
- Fix indent of whitespace-only lines. Thanks to [@nemoDreamer](https://github.com/nemoDreamer).
## [2.2.0] - 2020-10-02
- Preserve indent of `<script>` and `<style>` tags. Thanks to @SevInf
- Preserve indent of `<script>` and `<style>` tags. Thanks to [@SevInf](https://github.com/SevInf)

@@ -7,0 +11,0 @@ ## [2.1.0] - 2020-05-15

2

package.json
{
"name": "vue-jscodeshift-adapter",
"version": "2.2.0",
"version": "2.2.1",
"description": "Run jscodeshift on Vue single file components",

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

# vue-jscodeshift-adapter
[![Build Status](https://travis-ci.org/psalaets/vue-jscodeshift-adapter.svg?branch=master)](https://travis-ci.org/psalaets/vue-jscodeshift-adapter) [![Greenkeeper badge](https://badges.greenkeeper.io/psalaets/vue-jscodeshift-adapter.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/psalaets/vue-jscodeshift-adapter.svg?branch=master)](https://travis-ci.org/psalaets/vue-jscodeshift-adapter)

@@ -5,0 +5,0 @@ Run [jscodeshift](https://github.com/facebook/jscodeshift) on Vue single file components

const descriptorToString = require('vue-sfc-descriptor-to-string');
const parseSfc = require('./parse-sfc');
const fixWhitespace = require('./fix-whitespace');

@@ -13,8 +15,16 @@ module.exports = adapt;

const { sfcDescriptor, indents } = parseSfc(fileInfo.source);
fixWhitespace(sfcDescriptor, indents);
const scriptBlock = sfcDescriptor.script;
if (scriptBlock) {
fileInfo.source = scriptBlock.content;
const newScriptContent = transform(
Object.assign({}, fileInfo, {
source: scriptBlock.content,
}),
api,
options
);
const newScriptContent = transform(fileInfo, api, options);
if (!!newScriptContent) {

@@ -34,2 +44,1 @@ scriptBlock.content = newScriptContent;

}

@@ -25,3 +25,3 @@ const compiler = require('vue-template-compiler');

.split('\n')
.filter(line => line !== '')
.filter(line => !line.match(/^\s*$/))
.map(getLinePadding);

@@ -28,0 +28,0 @@

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