flatlint 1.40.0 → 1.41.0
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.
package/ChangeLog
CHANGED
package/lib/runner/path.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
isKeyword,
|
|
5
5
|
isPunctuator,
|
|
6
6
|
isWhiteSpace,
|
|
7
|
+
isTemplateTail,
|
|
7
8
|
} from '#types';
|
|
8
9
|
|
|
9
10
|
const {isArray} = Array;
|
|
@@ -33,6 +34,10 @@ export const createPath = ({tokens, start, end}) => ({
|
|
|
33
34
|
tokens,
|
|
34
35
|
end,
|
|
35
36
|
}),
|
|
37
|
+
isNextTemplateTail: createIsNextTemplateTail({
|
|
38
|
+
tokens,
|
|
39
|
+
end,
|
|
40
|
+
}),
|
|
36
41
|
isNext: createIsNext({
|
|
37
42
|
tokens,
|
|
38
43
|
end,
|
|
@@ -103,6 +108,15 @@ const createIsNextIdentifier = ({tokens, end}) => (value) => {
|
|
|
103
108
|
return isIdentifier(current, value);
|
|
104
109
|
};
|
|
105
110
|
|
|
111
|
+
const createIsNextTemplateTail = ({tokens, end}) => () => {
|
|
112
|
+
const current = next({
|
|
113
|
+
tokens,
|
|
114
|
+
end,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return isTemplateTail(current);
|
|
118
|
+
};
|
|
119
|
+
|
|
106
120
|
const createIsNextKeyword = ({tokens, end}) => () => {
|
|
107
121
|
const current = next({
|
|
108
122
|
tokens,
|
package/lib/types/types.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const {isArray} = Array;
|
|
2
|
-
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
3
1
|
const isString = (a) => typeof a === 'string';
|
|
4
2
|
|
|
3
|
+
export const isTemplateTail = (a) => a?.type === 'TemplateTail';
|
|
5
4
|
export const isWhiteSpace = ({type}) => type === 'WhiteSpace';
|
|
6
5
|
export const isIdentifier = (token, value = token.value) => {
|
|
7
6
|
const {type} = token;
|
|
@@ -126,4 +125,3 @@ export const quote = Punctuator(`'`);
|
|
|
126
125
|
|
|
127
126
|
export const OK = true;
|
|
128
127
|
export const NOT_OK = false;
|
|
129
|
-
|