@vue/language-core 1.8.24 → 1.8.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -859,6 +859,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, template, shouldGener
|
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
861
|
codes.push(`}, `);
|
|
862
|
+
const canCamelize = !nativeTags.has(node.tag) || node.tagType === 1 /* CompilerDOM.ElementTypes.COMPONENT */;
|
|
862
863
|
for (const prop of props) {
|
|
863
864
|
if (prop.type === 7 /* CompilerDOM.NodeTypes.DIRECTIVE */
|
|
864
865
|
&& (prop.name === 'bind' || prop.name === 'model')
|
|
@@ -884,9 +885,9 @@ function generate(ts, compilerOptions, vueCompilerOptions, template, shouldGener
|
|
|
884
885
|
continue;
|
|
885
886
|
}
|
|
886
887
|
let camelized = false;
|
|
887
|
-
if (
|
|
888
|
+
if (canCamelize
|
|
889
|
+
&& (!prop.arg || (prop.arg.type === 4 /* CompilerDOM.NodeTypes.SIMPLE_EXPRESSION */ && prop.arg.isStatic)) // isStatic
|
|
888
890
|
&& (0, shared_2.hyphenateAttr)(attrNameText) === attrNameText
|
|
889
|
-
&& !nativeTags.has(node.tag)
|
|
890
891
|
&& !vueCompilerOptions.htmlAttributes.some(pattern => (0, minimatch_1.minimatch)(attrNameText, pattern))) {
|
|
891
892
|
attrNameText = (0, shared_1.camelize)(attrNameText);
|
|
892
893
|
camelized = true;
|
|
@@ -963,8 +964,8 @@ function generate(ts, compilerOptions, vueCompilerOptions, template, shouldGener
|
|
|
963
964
|
continue;
|
|
964
965
|
}
|
|
965
966
|
let camelized = false;
|
|
966
|
-
if (
|
|
967
|
-
&&
|
|
967
|
+
if (canCamelize
|
|
968
|
+
&& (0, shared_2.hyphenateAttr)(prop.name) === prop.name
|
|
968
969
|
&& !vueCompilerOptions.htmlAttributes.some(pattern => (0, minimatch_1.minimatch)(attrNameText, pattern))) {
|
|
969
970
|
attrNameText = (0, shared_1.camelize)(prop.name);
|
|
970
971
|
camelized = true;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Code, CodeAndStack, VueCodeInformation } from '../types';
|
|
2
|
+
export declare function withStack(code: Code): CodeAndStack;
|
|
3
|
+
export declare function getStack(): string;
|
|
4
|
+
export declare function disableAllFeatures(override: Partial<VueCodeInformation>): VueCodeInformation;
|
|
5
|
+
export declare function enableAllFeatures(override: Partial<VueCodeInformation>): VueCodeInformation;
|
|
6
|
+
export declare function mergeFeatureSettings(base: VueCodeInformation, ...others: Partial<VueCodeInformation>[]): VueCodeInformation;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeFeatureSettings = exports.enableAllFeatures = exports.disableAllFeatures = exports.getStack = exports.withStack = void 0;
|
|
4
|
+
function withStack(code) {
|
|
5
|
+
return [code, getStack()];
|
|
6
|
+
}
|
|
7
|
+
exports.withStack = withStack;
|
|
8
|
+
// TODO: import from muggle-string
|
|
9
|
+
function getStack() {
|
|
10
|
+
const stack = new Error().stack;
|
|
11
|
+
let source = stack.split('\n')[3].trim();
|
|
12
|
+
if (source.endsWith(')')) {
|
|
13
|
+
source = source.slice(source.lastIndexOf('(') + 1, -1);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
source = source.slice(source.lastIndexOf(' ') + 1);
|
|
17
|
+
}
|
|
18
|
+
return source;
|
|
19
|
+
}
|
|
20
|
+
exports.getStack = getStack;
|
|
21
|
+
function disableAllFeatures(override) {
|
|
22
|
+
return {
|
|
23
|
+
verification: false,
|
|
24
|
+
completion: false,
|
|
25
|
+
semantic: false,
|
|
26
|
+
navigation: false,
|
|
27
|
+
structure: false,
|
|
28
|
+
format: false,
|
|
29
|
+
...override,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.disableAllFeatures = disableAllFeatures;
|
|
33
|
+
function enableAllFeatures(override) {
|
|
34
|
+
return {
|
|
35
|
+
verification: true,
|
|
36
|
+
completion: true,
|
|
37
|
+
semantic: true,
|
|
38
|
+
navigation: true,
|
|
39
|
+
structure: true,
|
|
40
|
+
format: true,
|
|
41
|
+
...override,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
exports.enableAllFeatures = enableAllFeatures;
|
|
45
|
+
function mergeFeatureSettings(base, ...others) {
|
|
46
|
+
const result = { ...base };
|
|
47
|
+
for (const info of others) {
|
|
48
|
+
for (const key in info) {
|
|
49
|
+
const value = info[key];
|
|
50
|
+
if (value) {
|
|
51
|
+
result[key] = value;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
exports.mergeFeatureSettings = mergeFeatureSettings;
|
|
58
|
+
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-core",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.26",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"optional": true
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "5849cada166bbd3faa03f21efd4d3cc2a2836d11"
|
|
41
41
|
}
|