vue-inbrowser-compiler-utils
Advanced tools
Comparing version 4.45.0 to 4.46.0
# Change Log | ||
## 4.46.0 | ||
### Minor Changes | ||
- [#1359](https://github.com/vue-styleguidist/vue-styleguidist/pull/1359) [`6c9e7d50`](https://github.com/vue-styleguidist/vue-styleguidist/commit/6c9e7d50b59887c19c5ea536a99d05211c14cf71) Thanks [@elevatebart](https://github.com/elevatebart)! - Allow PrismJs Editor to render typescript in JSX AND in SFC | ||
## 4.45.0 | ||
@@ -4,0 +10,0 @@ |
@@ -244,3 +244,3 @@ 'use strict'; | ||
function parseComponent(code) { | ||
// reinintialize regexp after each tour | ||
// reinitialize regexp after each tour | ||
var partsRE = PARTS.reduce(function (ret, part) { | ||
@@ -247,0 +247,0 @@ ret[part] = new RegExp("<".concat(part, "[^>]*>((.|\\n|\\r)+)</").concat(part, ">"), 'g'); |
@@ -237,3 +237,3 @@ import { resolveComponent, isVue3 } from 'vue-inbrowser-compiler-demi'; | ||
function parseComponent(code) { | ||
// reinintialize regexp after each tour | ||
// reinitialize regexp after each tour | ||
var partsRE = PARTS.reduce(function (ret, part) { | ||
@@ -240,0 +240,0 @@ ret[part] = new RegExp("<".concat(part, "[^>]*>((.|\\n|\\r)+)</").concat(part, ">"), 'g'); |
{ | ||
"name": "vue-inbrowser-compiler-utils", | ||
"version": "4.45.0", | ||
"version": "4.46.0", | ||
"description": "use this with vue-inbrowser-compiler to allow jsx compilation", | ||
@@ -13,3 +13,2 @@ "module": "lib/vue-inbrowser-compiler-utils.esm.js", | ||
"browser", | ||
"buble", | ||
"acorn" | ||
@@ -16,0 +15,0 @@ ], |
@@ -166,2 +166,30 @@ import parseComponent from './parseComponent' | ||
}) | ||
it('should parse simplest code properly', () => { | ||
const comp = parseComponent(` | ||
<template> | ||
<div @click="foo()">bar</div> | ||
</template> | ||
<script lang="ts"> | ||
import type { Vue } from 'vue' | ||
function foo(param: Vue) : { one: number, two: boolean } { | ||
return 'bar' | ||
} | ||
</script>`) | ||
expect(comp.template).toMatch(/<div/) | ||
expect(comp.script).toMatchInlineSnapshot(` | ||
" | ||
import type { Vue } from 'vue' | ||
function foo(param: Vue) : { one: number, two: boolean } { | ||
return 'bar' | ||
} | ||
" | ||
`) | ||
}) | ||
}) |
@@ -14,3 +14,3 @@ interface VsgSFCDescriptorSimple { | ||
export default function parseComponent(code: string): VsgSFCDescriptor { | ||
// reinintialize regexp after each tour | ||
// reinitialize regexp after each tour | ||
const partsRE: { [partName: string]: RegExp } = PARTS.reduce( | ||
@@ -17,0 +17,0 @@ (ret: { [partName: string]: RegExp }, part: string) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70413
1735