@@ -44,48 +44,48 @@ export function cssBlockError(message: string, node: AST.Node, templatePath: str
44
44
} ) ;
45
45
}
46
46
47
- export function isStringLiteral ( value : AST . Node | undefined ) : value is AST . StringLiteral {
48
- return value !== undefined && value . type === "StringLiteral" ;
47
+ export function isStringLiteral ( value : AST . Node | undefined | null ) : value is AST . StringLiteral {
48
+ return value !== undefined && value !== null && value . type === "StringLiteral" ;
49
49
}
50
- export function isConcatStatement ( value : AST . Node | undefined ) : value is AST . ConcatStatement {
50
+ export function isConcatStatement ( value : AST . Node | undefined | null ) : value is AST . ConcatStatement {
51
51
return ! ! value && value . type === "ConcatStatement" ;
52
52
}
53
- export function isTextNode ( value : AST . Node | undefined ) : value is AST . TextNode {
53
+ export function isTextNode ( value : AST . Node | undefined | null ) : value is AST . TextNode {
54
54
return ! ! value && value . type === "TextNode" ;
55
55
}
56
- export function isBooleanLiteral ( value : AST . Node | undefined ) : value is AST . BooleanLiteral {
56
+ export function isBooleanLiteral ( value : AST . Node | undefined | null ) : value is AST . BooleanLiteral {
57
57
return ! ! value && value . type === "BooleanLiteral" ;
58
58
}
59
- export function isMustacheStatement ( value : AST . Node | undefined ) : value is AST . MustacheStatement {
59
+ export function isMustacheStatement ( value : AST . Node | undefined | null ) : value is AST . MustacheStatement {
60
60
return ! ! value && value . type === "MustacheStatement" ;
61
61
}
62
- export function isBlockStatement ( value : AST . Node | undefined ) : value is AST . BlockStatement {
62
+ export function isBlockStatement ( value : AST . Node | undefined | null ) : value is AST . BlockStatement {
63
63
return ! ! value && value . type === "BlockStatement" ;
64
64
}
65
- export function isSubExpression ( value : AST . Node | undefined ) : value is AST . SubExpression {
65
+ export function isSubExpression ( value : AST . Node | undefined | null ) : value is AST . SubExpression {
66
66
return ! ! value && value . type === "SubExpression" ;
67
67
}
68
- export function isElementNode ( value : AST . Node | undefined ) : value is AST . ElementNode {
68
+ export function isElementNode ( value : AST . Node | undefined | null ) : value is AST . ElementNode {
69
69
return ! ! value && value . type === "ElementNode" ;
70
70
}
71
- export function isNumberLiteral ( value : AST . Node | undefined ) : value is AST . NumberLiteral {
71
+ export function isNumberLiteral ( value : AST . Node | undefined | null ) : value is AST . NumberLiteral {
72
72
return ! ! value && value . type === "NumberLiteral" ;
73
73
}
74
- export function isNullLiteral ( value : AST . Node | undefined ) : value is AST . NullLiteral {
74
+ export function isNullLiteral ( value : AST . Node | undefined | null ) : value is AST . NullLiteral {
75
75
return ! ! value && value . type === "NullLiteral" ;
76
76
}
77
- export function isUndefinedLiteral ( value : AST . Node | undefined ) : value is AST . UndefinedLiteral {
77
+ export function isUndefinedLiteral ( value : AST . Node | undefined | null ) : value is AST . UndefinedLiteral {
78
78
return ! ! value && value . type === "UndefinedLiteral" ;
79
79
}
80
- export function isPathExpression ( value : AST . Node | undefined ) : value is AST . PathExpression {
80
+ export function isPathExpression ( value : AST . Node | undefined | null ) : value is AST . PathExpression {
81
81
return ! ! value && value . type === "PathExpression" ;
82
82
}
83
- export function isHashPair ( value : AST . Node | undefined ) : value is AST . HashPair {
83
+ export function isHashPair ( value : AST . Node | undefined | null ) : value is AST . HashPair {
84
84
return ! ! value && value . type === "HashPair" ;
85
85
}
86
- export function isAttrNode ( value : AST . Node | undefined ) : value is AST . AttrNode {
86
+ export function isAttrNode ( value : AST . Node | undefined | null ) : value is AST . AttrNode {
87
87
return ! ! value && value . type === "AttrNode" ;
88
88
}
89
- export function isAnalyzableProperty ( value : AST . Node | undefined ) : value is AnalyzableProperty {
89
+ export function isAnalyzableProperty ( value : AST . Node | undefined | null ) : value is AnalyzableProperty {
90
90
return ! ! value && ( isAttrNode ( value ) || isHashPair ( value ) || isPathExpression ( value ) ) ;
91
91
}
0 commit comments