@tbela99/css-parser 1.1.1 → 1.2.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.md +6 -0
- package/README.md +53 -6
- package/dist/index-umd-web.js +4195 -3363
- package/dist/index.cjs +4199 -3367
- package/dist/index.d.ts +42 -31
- package/dist/lib/ast/expand.js +81 -65
- package/dist/lib/ast/features/calc.js +37 -35
- package/dist/lib/ast/features/inlinecssvariables.js +25 -17
- package/dist/lib/ast/features/prefix.js +22 -19
- package/dist/lib/ast/features/shorthand.js +1 -1
- package/dist/lib/ast/features/transform.js +17 -2
- package/dist/lib/ast/math/expression.js +184 -159
- package/dist/lib/ast/math/math.js +22 -20
- package/dist/lib/ast/minify.js +249 -199
- package/dist/lib/ast/transform/compute.js +48 -38
- package/dist/lib/ast/transform/matrix.js +6 -5
- package/dist/lib/ast/transform/minify.js +31 -34
- package/dist/lib/ast/transform/utils.js +76 -16
- package/dist/lib/ast/types.js +32 -1
- package/dist/lib/fs/resolve.js +1 -14
- package/dist/lib/parser/declaration/list.js +1 -1
- package/dist/lib/parser/declaration/map.js +1 -1
- package/dist/lib/parser/declaration/set.js +1 -1
- package/dist/lib/parser/parse.js +19 -95
- package/dist/lib/parser/tokenize.js +1 -13
- package/dist/lib/parser/utils/declaration.js +1 -1
- package/dist/lib/parser/utils/type.js +1 -1
- package/dist/lib/renderer/render.js +44 -168
- package/dist/lib/{renderer → syntax}/color/a98rgb.js +2 -2
- package/dist/lib/syntax/color/cmyk.js +104 -0
- package/dist/lib/{renderer → syntax}/color/color-mix.js +20 -21
- package/dist/lib/syntax/color/color.js +581 -0
- package/dist/lib/syntax/color/hex.js +179 -0
- package/dist/lib/syntax/color/hsl.js +201 -0
- package/dist/lib/syntax/color/hwb.js +185 -0
- package/dist/lib/syntax/color/lab.js +262 -0
- package/dist/lib/syntax/color/lch.js +194 -0
- package/dist/lib/syntax/color/oklab.js +237 -0
- package/dist/lib/syntax/color/oklch.js +166 -0
- package/dist/lib/{renderer → syntax}/color/p3.js +3 -3
- package/dist/lib/{renderer → syntax}/color/rec2020.js +11 -11
- package/dist/lib/{renderer → syntax}/color/relativecolor.js +53 -40
- package/dist/lib/syntax/color/rgb.js +140 -0
- package/dist/lib/{renderer → syntax}/color/srgb.js +58 -46
- package/dist/lib/{renderer → syntax}/color/utils/components.js +7 -7
- package/dist/lib/{renderer → syntax}/color/utils/constants.js +6 -33
- package/dist/lib/syntax/color/utils/distance.js +30 -0
- package/dist/lib/{renderer → syntax}/color/xyz.js +27 -14
- package/dist/lib/{renderer → syntax}/color/xyzd50.js +8 -8
- package/dist/lib/syntax/syntax.js +77 -67
- package/dist/lib/syntax/utils.js +70 -0
- package/dist/lib/validation/at-rules/container.js +1 -1
- package/dist/lib/validation/at-rules/counter-style.js +1 -1
- package/dist/lib/validation/at-rules/custom-media.js +1 -1
- package/dist/lib/validation/at-rules/document.js +1 -1
- package/dist/lib/validation/at-rules/font-feature-values.js +2 -2
- package/dist/lib/validation/at-rules/import.js +1 -1
- package/dist/lib/validation/at-rules/keyframes.js +14 -13
- package/dist/lib/validation/at-rules/layer.js +1 -1
- package/dist/lib/validation/at-rules/media.js +1 -1
- package/dist/lib/validation/at-rules/namespace.js +1 -1
- package/dist/lib/validation/at-rules/page-margin-box.js +1 -1
- package/dist/lib/validation/at-rules/page.js +1 -1
- package/dist/lib/validation/at-rules/supports.js +1 -1
- package/dist/lib/validation/at-rules/when.js +1 -1
- package/dist/lib/validation/atrule.js +2 -2
- package/dist/lib/validation/config.js +4 -3
- package/dist/lib/validation/config.json.js +1 -1
- package/dist/lib/validation/parser/parse.js +12 -7
- package/dist/lib/validation/selector.js +9 -8
- package/dist/lib/validation/syntax.js +170 -120
- package/dist/lib/validation/syntaxes/complex-selector-list.js +13 -19
- package/dist/lib/validation/syntaxes/complex-selector.js +1 -1
- package/dist/lib/validation/syntaxes/compound-selector.js +5 -24
- package/dist/lib/validation/syntaxes/family-name.js +36 -39
- package/dist/lib/validation/syntaxes/keyframe-selector.js +14 -22
- package/dist/lib/validation/syntaxes/layer-name.js +1 -1
- package/dist/lib/validation/syntaxes/relative-selector-list.js +27 -25
- package/dist/lib/validation/syntaxes/relative-selector.js +1 -1
- package/dist/lib/validation/syntaxes/url.js +35 -33
- package/dist/lib/validation/utils/list.js +10 -9
- package/dist/lib/validation/utils/whitespace.js +1 -1
- package/dist/node/index.js +4 -2
- package/dist/web/index.js +4 -2
- package/package.json +4 -4
- package/.editorconfig +0 -484
- package/dist/lib/ast/transform/convert.js +0 -33
- package/dist/lib/ast/utils/utils.js +0 -104
- package/dist/lib/renderer/color/color.js +0 -654
- package/dist/lib/renderer/color/hex.js +0 -105
- package/dist/lib/renderer/color/hsl.js +0 -125
- package/dist/lib/renderer/color/hwb.js +0 -103
- package/dist/lib/renderer/color/lab.js +0 -148
- package/dist/lib/renderer/color/lch.js +0 -90
- package/dist/lib/renderer/color/oklab.js +0 -131
- package/dist/lib/renderer/color/oklch.js +0 -75
- package/dist/lib/renderer/color/rgb.js +0 -50
- package/dist/lib/validation/syntaxes/keyframe-block-list.js +0 -28
- package/dist/lib/{renderer → syntax}/color/hsv.js +0 -0
- package/dist/lib/{renderer → syntax}/color/prophotorgb.js +1 -1
- /package/dist/lib/{renderer → syntax}/color/utils/matrix.js +0 -0
package/.editorconfig
DELETED
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
[*]
|
|
2
|
-
charset = utf-8
|
|
3
|
-
end_of_line = lf
|
|
4
|
-
indent_size = 4
|
|
5
|
-
indent_style = space
|
|
6
|
-
insert_final_newline = false
|
|
7
|
-
max_line_length = 120
|
|
8
|
-
tab_width = 4
|
|
9
|
-
ij_continuation_indent_size = 8
|
|
10
|
-
ij_formatter_off_tag = @formatter:off
|
|
11
|
-
ij_formatter_on_tag = @formatter:on
|
|
12
|
-
ij_formatter_tags_enabled = true
|
|
13
|
-
ij_smart_tabs = false
|
|
14
|
-
ij_visual_guides =
|
|
15
|
-
ij_wrap_on_typing = false
|
|
16
|
-
|
|
17
|
-
[*.css]
|
|
18
|
-
ij_css_align_closing_brace_with_properties = false
|
|
19
|
-
ij_css_blank_lines_around_nested_selector = 1
|
|
20
|
-
ij_css_blank_lines_between_blocks = 1
|
|
21
|
-
ij_css_block_comment_add_space = false
|
|
22
|
-
ij_css_brace_placement = end_of_line
|
|
23
|
-
ij_css_enforce_quotes_on_format = false
|
|
24
|
-
ij_css_hex_color_long_format = false
|
|
25
|
-
ij_css_hex_color_lower_case = false
|
|
26
|
-
ij_css_hex_color_short_format = false
|
|
27
|
-
ij_css_hex_color_upper_case = false
|
|
28
|
-
ij_css_keep_blank_lines_in_code = 2
|
|
29
|
-
ij_css_keep_indents_on_empty_lines = false
|
|
30
|
-
ij_css_keep_single_line_blocks = false
|
|
31
|
-
ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
|
32
|
-
ij_css_space_after_colon = true
|
|
33
|
-
ij_css_space_before_opening_brace = true
|
|
34
|
-
ij_css_use_double_quotes = true
|
|
35
|
-
ij_css_value_alignment = do_not_align
|
|
36
|
-
|
|
37
|
-
[.editorconfig]
|
|
38
|
-
ij_editorconfig_align_group_field_declarations = false
|
|
39
|
-
ij_editorconfig_space_after_colon = false
|
|
40
|
-
ij_editorconfig_space_after_comma = true
|
|
41
|
-
ij_editorconfig_space_before_colon = false
|
|
42
|
-
ij_editorconfig_space_before_comma = false
|
|
43
|
-
ij_editorconfig_spaces_around_assignment_operators = true
|
|
44
|
-
|
|
45
|
-
[{*.ats,*.cts,*.mts,*.ts}]
|
|
46
|
-
ij_continuation_indent_size = 4
|
|
47
|
-
ij_typescript_align_imports = false
|
|
48
|
-
ij_typescript_align_multiline_array_initializer_expression = false
|
|
49
|
-
ij_typescript_align_multiline_binary_operation = false
|
|
50
|
-
ij_typescript_align_multiline_chained_methods = false
|
|
51
|
-
ij_typescript_align_multiline_extends_list = false
|
|
52
|
-
ij_typescript_align_multiline_for = true
|
|
53
|
-
ij_typescript_align_multiline_parameters = true
|
|
54
|
-
ij_typescript_align_multiline_parameters_in_calls = false
|
|
55
|
-
ij_typescript_align_multiline_ternary_operation = false
|
|
56
|
-
ij_typescript_align_object_properties = 0
|
|
57
|
-
ij_typescript_align_union_types = false
|
|
58
|
-
ij_typescript_align_var_statements = 0
|
|
59
|
-
ij_typescript_array_initializer_new_line_after_left_brace = false
|
|
60
|
-
ij_typescript_array_initializer_right_brace_on_new_line = false
|
|
61
|
-
ij_typescript_array_initializer_wrap = off
|
|
62
|
-
ij_typescript_assignment_wrap = off
|
|
63
|
-
ij_typescript_binary_operation_sign_on_next_line = false
|
|
64
|
-
ij_typescript_binary_operation_wrap = off
|
|
65
|
-
ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
|
66
|
-
ij_typescript_blank_lines_after_imports = 1
|
|
67
|
-
ij_typescript_blank_lines_around_class = 1
|
|
68
|
-
ij_typescript_blank_lines_around_field = 0
|
|
69
|
-
ij_typescript_blank_lines_around_field_in_interface = 0
|
|
70
|
-
ij_typescript_blank_lines_around_function = 1
|
|
71
|
-
ij_typescript_blank_lines_around_method = 1
|
|
72
|
-
ij_typescript_blank_lines_around_method_in_interface = 1
|
|
73
|
-
ij_typescript_block_brace_style = end_of_line
|
|
74
|
-
ij_typescript_block_comment_add_space = false
|
|
75
|
-
ij_typescript_block_comment_at_first_column = true
|
|
76
|
-
ij_typescript_call_parameters_new_line_after_left_paren = false
|
|
77
|
-
ij_typescript_call_parameters_right_paren_on_new_line = false
|
|
78
|
-
ij_typescript_call_parameters_wrap = off
|
|
79
|
-
ij_typescript_catch_on_new_line = false
|
|
80
|
-
ij_typescript_chained_call_dot_on_new_line = true
|
|
81
|
-
ij_typescript_class_brace_style = end_of_line
|
|
82
|
-
ij_typescript_class_decorator_wrap = split_into_lines
|
|
83
|
-
ij_typescript_class_field_decorator_wrap = off
|
|
84
|
-
ij_typescript_class_method_decorator_wrap = off
|
|
85
|
-
ij_typescript_comma_on_new_line = false
|
|
86
|
-
ij_typescript_do_while_brace_force = never
|
|
87
|
-
ij_typescript_else_on_new_line = false
|
|
88
|
-
ij_typescript_enforce_trailing_comma = keep
|
|
89
|
-
ij_typescript_enum_constants_wrap = on_every_item
|
|
90
|
-
ij_typescript_extends_keyword_wrap = off
|
|
91
|
-
ij_typescript_extends_list_wrap = off
|
|
92
|
-
ij_typescript_field_prefix = _
|
|
93
|
-
ij_typescript_file_name_style = relaxed
|
|
94
|
-
ij_typescript_finally_on_new_line = false
|
|
95
|
-
ij_typescript_for_brace_force = never
|
|
96
|
-
ij_typescript_for_statement_new_line_after_left_paren = false
|
|
97
|
-
ij_typescript_for_statement_right_paren_on_new_line = false
|
|
98
|
-
ij_typescript_for_statement_wrap = off
|
|
99
|
-
ij_typescript_force_quote_style = false
|
|
100
|
-
ij_typescript_force_semicolon_style = false
|
|
101
|
-
ij_typescript_function_expression_brace_style = end_of_line
|
|
102
|
-
ij_typescript_function_parameter_decorator_wrap = off
|
|
103
|
-
ij_typescript_if_brace_force = never
|
|
104
|
-
ij_typescript_import_merge_members = global
|
|
105
|
-
ij_typescript_import_prefer_absolute_path = global
|
|
106
|
-
ij_typescript_import_sort_members = true
|
|
107
|
-
ij_typescript_import_sort_module_name = false
|
|
108
|
-
ij_typescript_import_use_node_resolution = true
|
|
109
|
-
ij_typescript_imports_wrap = on_every_item
|
|
110
|
-
ij_typescript_indent_case_from_switch = true
|
|
111
|
-
ij_typescript_indent_chained_calls = true
|
|
112
|
-
ij_typescript_indent_package_children = 0
|
|
113
|
-
ij_typescript_jsdoc_include_types = false
|
|
114
|
-
ij_typescript_jsx_attribute_value = braces
|
|
115
|
-
ij_typescript_keep_blank_lines_in_code = 2
|
|
116
|
-
ij_typescript_keep_first_column_comment = true
|
|
117
|
-
ij_typescript_keep_indents_on_empty_lines = false
|
|
118
|
-
ij_typescript_keep_line_breaks = true
|
|
119
|
-
ij_typescript_keep_simple_blocks_in_one_line = false
|
|
120
|
-
ij_typescript_keep_simple_methods_in_one_line = false
|
|
121
|
-
ij_typescript_line_comment_add_space = true
|
|
122
|
-
ij_typescript_line_comment_at_first_column = false
|
|
123
|
-
ij_typescript_method_brace_style = end_of_line
|
|
124
|
-
ij_typescript_method_call_chain_wrap = off
|
|
125
|
-
ij_typescript_method_parameters_new_line_after_left_paren = false
|
|
126
|
-
ij_typescript_method_parameters_right_paren_on_new_line = false
|
|
127
|
-
ij_typescript_method_parameters_wrap = off
|
|
128
|
-
ij_typescript_object_literal_wrap = on_every_item
|
|
129
|
-
ij_typescript_object_types_wrap = on_every_item
|
|
130
|
-
ij_typescript_parentheses_expression_new_line_after_left_paren = false
|
|
131
|
-
ij_typescript_parentheses_expression_right_paren_on_new_line = false
|
|
132
|
-
ij_typescript_place_assignment_sign_on_next_line = false
|
|
133
|
-
ij_typescript_prefer_as_type_cast = false
|
|
134
|
-
ij_typescript_prefer_explicit_types_function_expression_returns = false
|
|
135
|
-
ij_typescript_prefer_explicit_types_function_returns = false
|
|
136
|
-
ij_typescript_prefer_explicit_types_vars_fields = false
|
|
137
|
-
ij_typescript_prefer_parameters_wrap = false
|
|
138
|
-
ij_typescript_property_prefix =
|
|
139
|
-
ij_typescript_reformat_c_style_comments = false
|
|
140
|
-
ij_typescript_space_after_colon = true
|
|
141
|
-
ij_typescript_space_after_comma = true
|
|
142
|
-
ij_typescript_space_after_dots_in_rest_parameter = false
|
|
143
|
-
ij_typescript_space_after_generator_mult = true
|
|
144
|
-
ij_typescript_space_after_property_colon = true
|
|
145
|
-
ij_typescript_space_after_quest = true
|
|
146
|
-
ij_typescript_space_after_type_colon = true
|
|
147
|
-
ij_typescript_space_after_unary_not = false
|
|
148
|
-
ij_typescript_space_before_async_arrow_lparen = true
|
|
149
|
-
ij_typescript_space_before_catch_keyword = true
|
|
150
|
-
ij_typescript_space_before_catch_left_brace = true
|
|
151
|
-
ij_typescript_space_before_catch_parentheses = true
|
|
152
|
-
ij_typescript_space_before_class_lbrace = true
|
|
153
|
-
ij_typescript_space_before_class_left_brace = true
|
|
154
|
-
ij_typescript_space_before_colon = true
|
|
155
|
-
ij_typescript_space_before_comma = false
|
|
156
|
-
ij_typescript_space_before_do_left_brace = true
|
|
157
|
-
ij_typescript_space_before_else_keyword = true
|
|
158
|
-
ij_typescript_space_before_else_left_brace = true
|
|
159
|
-
ij_typescript_space_before_finally_keyword = true
|
|
160
|
-
ij_typescript_space_before_finally_left_brace = true
|
|
161
|
-
ij_typescript_space_before_for_left_brace = true
|
|
162
|
-
ij_typescript_space_before_for_parentheses = true
|
|
163
|
-
ij_typescript_space_before_for_semicolon = false
|
|
164
|
-
ij_typescript_space_before_function_left_parenth = true
|
|
165
|
-
ij_typescript_space_before_generator_mult = false
|
|
166
|
-
ij_typescript_space_before_if_left_brace = true
|
|
167
|
-
ij_typescript_space_before_if_parentheses = true
|
|
168
|
-
ij_typescript_space_before_method_call_parentheses = false
|
|
169
|
-
ij_typescript_space_before_method_left_brace = true
|
|
170
|
-
ij_typescript_space_before_method_parentheses = false
|
|
171
|
-
ij_typescript_space_before_property_colon = false
|
|
172
|
-
ij_typescript_space_before_quest = true
|
|
173
|
-
ij_typescript_space_before_switch_left_brace = true
|
|
174
|
-
ij_typescript_space_before_switch_parentheses = true
|
|
175
|
-
ij_typescript_space_before_try_left_brace = true
|
|
176
|
-
ij_typescript_space_before_type_colon = false
|
|
177
|
-
ij_typescript_space_before_unary_not = false
|
|
178
|
-
ij_typescript_space_before_while_keyword = true
|
|
179
|
-
ij_typescript_space_before_while_left_brace = true
|
|
180
|
-
ij_typescript_space_before_while_parentheses = true
|
|
181
|
-
ij_typescript_spaces_around_additive_operators = true
|
|
182
|
-
ij_typescript_spaces_around_arrow_function_operator = true
|
|
183
|
-
ij_typescript_spaces_around_assignment_operators = true
|
|
184
|
-
ij_typescript_spaces_around_bitwise_operators = true
|
|
185
|
-
ij_typescript_spaces_around_equality_operators = true
|
|
186
|
-
ij_typescript_spaces_around_logical_operators = true
|
|
187
|
-
ij_typescript_spaces_around_multiplicative_operators = true
|
|
188
|
-
ij_typescript_spaces_around_relational_operators = true
|
|
189
|
-
ij_typescript_spaces_around_shift_operators = true
|
|
190
|
-
ij_typescript_spaces_around_unary_operator = false
|
|
191
|
-
ij_typescript_spaces_within_array_initializer_brackets = false
|
|
192
|
-
ij_typescript_spaces_within_brackets = false
|
|
193
|
-
ij_typescript_spaces_within_catch_parentheses = false
|
|
194
|
-
ij_typescript_spaces_within_for_parentheses = false
|
|
195
|
-
ij_typescript_spaces_within_if_parentheses = false
|
|
196
|
-
ij_typescript_spaces_within_imports = false
|
|
197
|
-
ij_typescript_spaces_within_interpolation_expressions = false
|
|
198
|
-
ij_typescript_spaces_within_method_call_parentheses = false
|
|
199
|
-
ij_typescript_spaces_within_method_parentheses = false
|
|
200
|
-
ij_typescript_spaces_within_object_literal_braces = false
|
|
201
|
-
ij_typescript_spaces_within_object_type_braces = true
|
|
202
|
-
ij_typescript_spaces_within_parentheses = false
|
|
203
|
-
ij_typescript_spaces_within_switch_parentheses = false
|
|
204
|
-
ij_typescript_spaces_within_type_assertion = false
|
|
205
|
-
ij_typescript_spaces_within_union_types = true
|
|
206
|
-
ij_typescript_spaces_within_while_parentheses = false
|
|
207
|
-
ij_typescript_special_else_if_treatment = true
|
|
208
|
-
ij_typescript_ternary_operation_signs_on_next_line = false
|
|
209
|
-
ij_typescript_ternary_operation_wrap = off
|
|
210
|
-
ij_typescript_union_types_wrap = on_every_item
|
|
211
|
-
ij_typescript_use_chained_calls_group_indents = false
|
|
212
|
-
ij_typescript_use_double_quotes = true
|
|
213
|
-
ij_typescript_use_explicit_js_extension = auto
|
|
214
|
-
ij_typescript_use_import_type = auto
|
|
215
|
-
ij_typescript_use_path_mapping = always
|
|
216
|
-
ij_typescript_use_public_modifier = false
|
|
217
|
-
ij_typescript_use_semicolon_after_statement = true
|
|
218
|
-
ij_typescript_var_declaration_wrap = normal
|
|
219
|
-
ij_typescript_while_brace_force = never
|
|
220
|
-
ij_typescript_while_on_new_line = false
|
|
221
|
-
ij_typescript_wrap_comments = false
|
|
222
|
-
|
|
223
|
-
[{*.bash,*.sh,*.zsh}]
|
|
224
|
-
indent_size = 2
|
|
225
|
-
tab_width = 2
|
|
226
|
-
ij_shell_binary_ops_start_line = false
|
|
227
|
-
ij_shell_keep_column_alignment_padding = false
|
|
228
|
-
ij_shell_minify_program = false
|
|
229
|
-
ij_shell_redirect_followed_by_space = false
|
|
230
|
-
ij_shell_switch_cases_indented = false
|
|
231
|
-
ij_shell_use_unix_line_separator = true
|
|
232
|
-
|
|
233
|
-
[{*.cjs,*.es6,*.js,*.mjs}]
|
|
234
|
-
ij_continuation_indent_size = 4
|
|
235
|
-
ij_javascript_align_imports = false
|
|
236
|
-
ij_javascript_align_multiline_array_initializer_expression = false
|
|
237
|
-
ij_javascript_align_multiline_binary_operation = false
|
|
238
|
-
ij_javascript_align_multiline_chained_methods = false
|
|
239
|
-
ij_javascript_align_multiline_extends_list = false
|
|
240
|
-
ij_javascript_align_multiline_for = true
|
|
241
|
-
ij_javascript_align_multiline_parameters = true
|
|
242
|
-
ij_javascript_align_multiline_parameters_in_calls = false
|
|
243
|
-
ij_javascript_align_multiline_ternary_operation = false
|
|
244
|
-
ij_javascript_align_object_properties = 0
|
|
245
|
-
ij_javascript_align_union_types = false
|
|
246
|
-
ij_javascript_align_var_statements = 0
|
|
247
|
-
ij_javascript_array_initializer_new_line_after_left_brace = false
|
|
248
|
-
ij_javascript_array_initializer_right_brace_on_new_line = false
|
|
249
|
-
ij_javascript_array_initializer_wrap = off
|
|
250
|
-
ij_javascript_assignment_wrap = off
|
|
251
|
-
ij_javascript_binary_operation_sign_on_next_line = false
|
|
252
|
-
ij_javascript_binary_operation_wrap = off
|
|
253
|
-
ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
|
254
|
-
ij_javascript_blank_lines_after_imports = 1
|
|
255
|
-
ij_javascript_blank_lines_around_class = 1
|
|
256
|
-
ij_javascript_blank_lines_around_field = 0
|
|
257
|
-
ij_javascript_blank_lines_around_function = 1
|
|
258
|
-
ij_javascript_blank_lines_around_method = 1
|
|
259
|
-
ij_javascript_block_brace_style = end_of_line
|
|
260
|
-
ij_javascript_block_comment_add_space = false
|
|
261
|
-
ij_javascript_block_comment_at_first_column = true
|
|
262
|
-
ij_javascript_call_parameters_new_line_after_left_paren = false
|
|
263
|
-
ij_javascript_call_parameters_right_paren_on_new_line = false
|
|
264
|
-
ij_javascript_call_parameters_wrap = off
|
|
265
|
-
ij_javascript_catch_on_new_line = false
|
|
266
|
-
ij_javascript_chained_call_dot_on_new_line = true
|
|
267
|
-
ij_javascript_class_brace_style = end_of_line
|
|
268
|
-
ij_javascript_class_decorator_wrap = split_into_lines
|
|
269
|
-
ij_javascript_class_field_decorator_wrap = off
|
|
270
|
-
ij_javascript_class_method_decorator_wrap = off
|
|
271
|
-
ij_javascript_comma_on_new_line = false
|
|
272
|
-
ij_javascript_do_while_brace_force = never
|
|
273
|
-
ij_javascript_else_on_new_line = false
|
|
274
|
-
ij_javascript_enforce_trailing_comma = keep
|
|
275
|
-
ij_javascript_extends_keyword_wrap = off
|
|
276
|
-
ij_javascript_extends_list_wrap = off
|
|
277
|
-
ij_javascript_field_prefix = _
|
|
278
|
-
ij_javascript_file_name_style = relaxed
|
|
279
|
-
ij_javascript_finally_on_new_line = false
|
|
280
|
-
ij_javascript_for_brace_force = never
|
|
281
|
-
ij_javascript_for_statement_new_line_after_left_paren = false
|
|
282
|
-
ij_javascript_for_statement_right_paren_on_new_line = false
|
|
283
|
-
ij_javascript_for_statement_wrap = off
|
|
284
|
-
ij_javascript_force_quote_style = false
|
|
285
|
-
ij_javascript_force_semicolon_style = false
|
|
286
|
-
ij_javascript_function_expression_brace_style = end_of_line
|
|
287
|
-
ij_javascript_function_parameter_decorator_wrap = off
|
|
288
|
-
ij_javascript_if_brace_force = never
|
|
289
|
-
ij_javascript_import_merge_members = global
|
|
290
|
-
ij_javascript_import_prefer_absolute_path = global
|
|
291
|
-
ij_javascript_import_sort_members = true
|
|
292
|
-
ij_javascript_import_sort_module_name = false
|
|
293
|
-
ij_javascript_import_use_node_resolution = true
|
|
294
|
-
ij_javascript_imports_wrap = on_every_item
|
|
295
|
-
ij_javascript_indent_case_from_switch = true
|
|
296
|
-
ij_javascript_indent_chained_calls = true
|
|
297
|
-
ij_javascript_indent_package_children = 0
|
|
298
|
-
ij_javascript_jsx_attribute_value = braces
|
|
299
|
-
ij_javascript_keep_blank_lines_in_code = 2
|
|
300
|
-
ij_javascript_keep_first_column_comment = true
|
|
301
|
-
ij_javascript_keep_indents_on_empty_lines = false
|
|
302
|
-
ij_javascript_keep_line_breaks = true
|
|
303
|
-
ij_javascript_keep_simple_blocks_in_one_line = false
|
|
304
|
-
ij_javascript_keep_simple_methods_in_one_line = false
|
|
305
|
-
ij_javascript_line_comment_add_space = true
|
|
306
|
-
ij_javascript_line_comment_at_first_column = false
|
|
307
|
-
ij_javascript_method_brace_style = end_of_line
|
|
308
|
-
ij_javascript_method_call_chain_wrap = off
|
|
309
|
-
ij_javascript_method_parameters_new_line_after_left_paren = false
|
|
310
|
-
ij_javascript_method_parameters_right_paren_on_new_line = false
|
|
311
|
-
ij_javascript_method_parameters_wrap = off
|
|
312
|
-
ij_javascript_object_literal_wrap = on_every_item
|
|
313
|
-
ij_javascript_object_types_wrap = on_every_item
|
|
314
|
-
ij_javascript_parentheses_expression_new_line_after_left_paren = false
|
|
315
|
-
ij_javascript_parentheses_expression_right_paren_on_new_line = false
|
|
316
|
-
ij_javascript_place_assignment_sign_on_next_line = false
|
|
317
|
-
ij_javascript_prefer_as_type_cast = false
|
|
318
|
-
ij_javascript_prefer_explicit_types_function_expression_returns = false
|
|
319
|
-
ij_javascript_prefer_explicit_types_function_returns = false
|
|
320
|
-
ij_javascript_prefer_explicit_types_vars_fields = false
|
|
321
|
-
ij_javascript_prefer_parameters_wrap = false
|
|
322
|
-
ij_javascript_property_prefix =
|
|
323
|
-
ij_javascript_reformat_c_style_comments = false
|
|
324
|
-
ij_javascript_space_after_colon = true
|
|
325
|
-
ij_javascript_space_after_comma = true
|
|
326
|
-
ij_javascript_space_after_dots_in_rest_parameter = false
|
|
327
|
-
ij_javascript_space_after_generator_mult = true
|
|
328
|
-
ij_javascript_space_after_property_colon = true
|
|
329
|
-
ij_javascript_space_after_quest = true
|
|
330
|
-
ij_javascript_space_after_type_colon = true
|
|
331
|
-
ij_javascript_space_after_unary_not = false
|
|
332
|
-
ij_javascript_space_before_async_arrow_lparen = true
|
|
333
|
-
ij_javascript_space_before_catch_keyword = true
|
|
334
|
-
ij_javascript_space_before_catch_left_brace = true
|
|
335
|
-
ij_javascript_space_before_catch_parentheses = true
|
|
336
|
-
ij_javascript_space_before_class_lbrace = true
|
|
337
|
-
ij_javascript_space_before_class_left_brace = true
|
|
338
|
-
ij_javascript_space_before_colon = true
|
|
339
|
-
ij_javascript_space_before_comma = false
|
|
340
|
-
ij_javascript_space_before_do_left_brace = true
|
|
341
|
-
ij_javascript_space_before_else_keyword = true
|
|
342
|
-
ij_javascript_space_before_else_left_brace = true
|
|
343
|
-
ij_javascript_space_before_finally_keyword = true
|
|
344
|
-
ij_javascript_space_before_finally_left_brace = true
|
|
345
|
-
ij_javascript_space_before_for_left_brace = true
|
|
346
|
-
ij_javascript_space_before_for_parentheses = true
|
|
347
|
-
ij_javascript_space_before_for_semicolon = false
|
|
348
|
-
ij_javascript_space_before_function_left_parenth = true
|
|
349
|
-
ij_javascript_space_before_generator_mult = false
|
|
350
|
-
ij_javascript_space_before_if_left_brace = true
|
|
351
|
-
ij_javascript_space_before_if_parentheses = true
|
|
352
|
-
ij_javascript_space_before_method_call_parentheses = false
|
|
353
|
-
ij_javascript_space_before_method_left_brace = true
|
|
354
|
-
ij_javascript_space_before_method_parentheses = false
|
|
355
|
-
ij_javascript_space_before_property_colon = false
|
|
356
|
-
ij_javascript_space_before_quest = true
|
|
357
|
-
ij_javascript_space_before_switch_left_brace = true
|
|
358
|
-
ij_javascript_space_before_switch_parentheses = true
|
|
359
|
-
ij_javascript_space_before_try_left_brace = true
|
|
360
|
-
ij_javascript_space_before_type_colon = false
|
|
361
|
-
ij_javascript_space_before_unary_not = false
|
|
362
|
-
ij_javascript_space_before_while_keyword = true
|
|
363
|
-
ij_javascript_space_before_while_left_brace = true
|
|
364
|
-
ij_javascript_space_before_while_parentheses = true
|
|
365
|
-
ij_javascript_spaces_around_additive_operators = true
|
|
366
|
-
ij_javascript_spaces_around_arrow_function_operator = true
|
|
367
|
-
ij_javascript_spaces_around_assignment_operators = true
|
|
368
|
-
ij_javascript_spaces_around_bitwise_operators = true
|
|
369
|
-
ij_javascript_spaces_around_equality_operators = true
|
|
370
|
-
ij_javascript_spaces_around_logical_operators = true
|
|
371
|
-
ij_javascript_spaces_around_multiplicative_operators = true
|
|
372
|
-
ij_javascript_spaces_around_relational_operators = true
|
|
373
|
-
ij_javascript_spaces_around_shift_operators = true
|
|
374
|
-
ij_javascript_spaces_around_unary_operator = false
|
|
375
|
-
ij_javascript_spaces_within_array_initializer_brackets = false
|
|
376
|
-
ij_javascript_spaces_within_brackets = false
|
|
377
|
-
ij_javascript_spaces_within_catch_parentheses = false
|
|
378
|
-
ij_javascript_spaces_within_for_parentheses = false
|
|
379
|
-
ij_javascript_spaces_within_if_parentheses = false
|
|
380
|
-
ij_javascript_spaces_within_imports = false
|
|
381
|
-
ij_javascript_spaces_within_interpolation_expressions = false
|
|
382
|
-
ij_javascript_spaces_within_method_call_parentheses = false
|
|
383
|
-
ij_javascript_spaces_within_method_parentheses = false
|
|
384
|
-
ij_javascript_spaces_within_object_literal_braces = false
|
|
385
|
-
ij_javascript_spaces_within_object_type_braces = true
|
|
386
|
-
ij_javascript_spaces_within_parentheses = false
|
|
387
|
-
ij_javascript_spaces_within_switch_parentheses = false
|
|
388
|
-
ij_javascript_spaces_within_type_assertion = false
|
|
389
|
-
ij_javascript_spaces_within_union_types = true
|
|
390
|
-
ij_javascript_spaces_within_while_parentheses = false
|
|
391
|
-
ij_javascript_special_else_if_treatment = true
|
|
392
|
-
ij_javascript_ternary_operation_signs_on_next_line = false
|
|
393
|
-
ij_javascript_ternary_operation_wrap = off
|
|
394
|
-
ij_javascript_union_types_wrap = on_every_item
|
|
395
|
-
ij_javascript_use_chained_calls_group_indents = false
|
|
396
|
-
ij_javascript_use_double_quotes = true
|
|
397
|
-
ij_javascript_use_explicit_js_extension = auto
|
|
398
|
-
ij_javascript_use_import_type = auto
|
|
399
|
-
ij_javascript_use_path_mapping = always
|
|
400
|
-
ij_javascript_use_public_modifier = false
|
|
401
|
-
ij_javascript_use_semicolon_after_statement = true
|
|
402
|
-
ij_javascript_var_declaration_wrap = normal
|
|
403
|
-
ij_javascript_while_brace_force = never
|
|
404
|
-
ij_javascript_while_on_new_line = false
|
|
405
|
-
ij_javascript_wrap_comments = false
|
|
406
|
-
|
|
407
|
-
[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,jest.config}]
|
|
408
|
-
indent_size = 2
|
|
409
|
-
ij_json_array_wrapping = split_into_lines
|
|
410
|
-
ij_json_keep_blank_lines_in_code = 0
|
|
411
|
-
ij_json_keep_indents_on_empty_lines = false
|
|
412
|
-
ij_json_keep_line_breaks = true
|
|
413
|
-
ij_json_keep_trailing_comma = false
|
|
414
|
-
ij_json_object_wrapping = split_into_lines
|
|
415
|
-
ij_json_property_alignment = do_not_align
|
|
416
|
-
ij_json_space_after_colon = true
|
|
417
|
-
ij_json_space_after_comma = true
|
|
418
|
-
ij_json_space_before_colon = false
|
|
419
|
-
ij_json_space_before_comma = false
|
|
420
|
-
ij_json_spaces_within_braces = false
|
|
421
|
-
ij_json_spaces_within_brackets = false
|
|
422
|
-
ij_json_wrap_long_lines = false
|
|
423
|
-
|
|
424
|
-
[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
|
|
425
|
-
ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
|
|
426
|
-
ij_html_align_attributes = true
|
|
427
|
-
ij_html_align_text = false
|
|
428
|
-
ij_html_attribute_wrap = normal
|
|
429
|
-
ij_html_block_comment_add_space = false
|
|
430
|
-
ij_html_block_comment_at_first_column = true
|
|
431
|
-
ij_html_do_not_align_children_of_min_lines = 0
|
|
432
|
-
ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
|
|
433
|
-
ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
|
|
434
|
-
ij_html_enforce_quotes = false
|
|
435
|
-
ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
|
|
436
|
-
ij_html_keep_blank_lines = 2
|
|
437
|
-
ij_html_keep_indents_on_empty_lines = false
|
|
438
|
-
ij_html_keep_line_breaks = true
|
|
439
|
-
ij_html_keep_line_breaks_in_text = true
|
|
440
|
-
ij_html_keep_whitespaces = false
|
|
441
|
-
ij_html_keep_whitespaces_inside = span,pre,textarea
|
|
442
|
-
ij_html_line_comment_at_first_column = true
|
|
443
|
-
ij_html_new_line_after_last_attribute = never
|
|
444
|
-
ij_html_new_line_before_first_attribute = never
|
|
445
|
-
ij_html_quote_style = double
|
|
446
|
-
ij_html_remove_new_line_before_tags = br
|
|
447
|
-
ij_html_space_after_tag_name = false
|
|
448
|
-
ij_html_space_around_equality_in_attribute = false
|
|
449
|
-
ij_html_space_inside_empty_tag = false
|
|
450
|
-
ij_html_text_wrap = normal
|
|
451
|
-
|
|
452
|
-
[{*.markdown,*.md}]
|
|
453
|
-
ij_markdown_force_one_space_after_blockquote_symbol = true
|
|
454
|
-
ij_markdown_force_one_space_after_header_symbol = true
|
|
455
|
-
ij_markdown_force_one_space_after_list_bullet = true
|
|
456
|
-
ij_markdown_force_one_space_between_words = true
|
|
457
|
-
ij_markdown_format_tables = true
|
|
458
|
-
ij_markdown_insert_quote_arrows_on_wrap = true
|
|
459
|
-
ij_markdown_keep_indents_on_empty_lines = false
|
|
460
|
-
ij_markdown_keep_line_breaks_inside_text_blocks = true
|
|
461
|
-
ij_markdown_max_lines_around_block_elements = 1
|
|
462
|
-
ij_markdown_max_lines_around_header = 1
|
|
463
|
-
ij_markdown_max_lines_between_paragraphs = 1
|
|
464
|
-
ij_markdown_min_lines_around_block_elements = 1
|
|
465
|
-
ij_markdown_min_lines_around_header = 1
|
|
466
|
-
ij_markdown_min_lines_between_paragraphs = 1
|
|
467
|
-
ij_markdown_wrap_text_if_long = true
|
|
468
|
-
ij_markdown_wrap_text_inside_blockquotes = true
|
|
469
|
-
|
|
470
|
-
[{*.yaml,*.yml}]
|
|
471
|
-
indent_size = 2
|
|
472
|
-
ij_yaml_align_values_properties = do_not_align
|
|
473
|
-
ij_yaml_autoinsert_sequence_marker = true
|
|
474
|
-
ij_yaml_block_mapping_on_new_line = false
|
|
475
|
-
ij_yaml_indent_sequence_value = true
|
|
476
|
-
ij_yaml_keep_indents_on_empty_lines = false
|
|
477
|
-
ij_yaml_keep_line_breaks = true
|
|
478
|
-
ij_yaml_line_comment_add_space = false
|
|
479
|
-
ij_yaml_line_comment_add_space_on_reformat = false
|
|
480
|
-
ij_yaml_line_comment_at_first_column = true
|
|
481
|
-
ij_yaml_sequence_on_new_line = false
|
|
482
|
-
ij_yaml_space_before_colon = false
|
|
483
|
-
ij_yaml_spaces_within_braces = true
|
|
484
|
-
ij_yaml_spaces_within_brackets = true
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { EnumToken } from '../types.js';
|
|
2
|
-
|
|
3
|
-
// https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Values_and_units#absolute_length_units
|
|
4
|
-
function length2Px(value) {
|
|
5
|
-
if (value.typ == EnumToken.NumberTokenType) {
|
|
6
|
-
return +value.val;
|
|
7
|
-
}
|
|
8
|
-
switch (value.unit) {
|
|
9
|
-
case 'cm':
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
return value.val * 37.8;
|
|
12
|
-
case 'mm':
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
return value.val * 3.78;
|
|
15
|
-
case 'Q':
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
return value.val * 37.8 / 40;
|
|
18
|
-
case 'in':
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
return value.val / 96;
|
|
21
|
-
case 'pc':
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
return value.val / 16;
|
|
24
|
-
case 'pt':
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
return value.val * 4 / 3;
|
|
27
|
-
case 'px':
|
|
28
|
-
return +value.val;
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { length2Px };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { funcLike, ColorKind } from '../../renderer/color/utils/constants.js';
|
|
2
|
-
import { EnumToken } from '../types.js';
|
|
3
|
-
import '../minify.js';
|
|
4
|
-
import '../walk.js';
|
|
5
|
-
import '../../parser/parse.js';
|
|
6
|
-
import '../../parser/tokenize.js';
|
|
7
|
-
import '../../parser/utils/config.js';
|
|
8
|
-
import '../../renderer/sourcemap/lib/encode.js';
|
|
9
|
-
import { minmax } from '../../renderer/color/color.js';
|
|
10
|
-
|
|
11
|
-
function reduceNumber(val) {
|
|
12
|
-
val = String(+val);
|
|
13
|
-
if (val === '0') {
|
|
14
|
-
return '0';
|
|
15
|
-
}
|
|
16
|
-
const chr = val.charAt(0);
|
|
17
|
-
if (chr == '-') {
|
|
18
|
-
const slice = val.slice(0, 2);
|
|
19
|
-
if (slice == '-0') {
|
|
20
|
-
return val.length == 2 ? '0' : '-' + val.slice(2);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (chr == '0') {
|
|
24
|
-
return val.slice(1);
|
|
25
|
-
}
|
|
26
|
-
return val;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* clamp color values
|
|
30
|
-
* @param token
|
|
31
|
-
*/
|
|
32
|
-
function clamp(token) {
|
|
33
|
-
if (token.kin == ColorKind.RGB || token.kin == ColorKind.RGBA) {
|
|
34
|
-
token.chi.filter((token) => ![EnumToken.LiteralTokenType, EnumToken.CommaTokenType, EnumToken.WhitespaceTokenType].includes(token.typ)).forEach((token, index) => {
|
|
35
|
-
if (index <= 2) {
|
|
36
|
-
if (token.typ == EnumToken.NumberTokenType) {
|
|
37
|
-
token.val = String(minmax(+token.val, 0, 255));
|
|
38
|
-
}
|
|
39
|
-
else if (token.typ == EnumToken.PercentageTokenType) {
|
|
40
|
-
token.val = String(minmax(+token.val, 0, 100));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
if (token.typ == EnumToken.NumberTokenType) {
|
|
45
|
-
token.val = String(minmax(+token.val, 0, 1));
|
|
46
|
-
}
|
|
47
|
-
else if (token.typ == EnumToken.PercentageTokenType) {
|
|
48
|
-
token.val = String(minmax(+token.val, 0, 100));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return token;
|
|
54
|
-
}
|
|
55
|
-
function getNumber(token) {
|
|
56
|
-
if (token.typ == EnumToken.IdenTokenType && token.val == 'none') {
|
|
57
|
-
return 0;
|
|
58
|
-
}
|
|
59
|
-
// @ts-ignore
|
|
60
|
-
return token.typ == EnumToken.PercentageTokenType ? token.val / 100 : +token.val;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* convert angle to turn
|
|
64
|
-
* @param token
|
|
65
|
-
*/
|
|
66
|
-
function getAngle(token) {
|
|
67
|
-
if (token.typ == EnumToken.IdenTokenType) {
|
|
68
|
-
if (token.val == 'none') {
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (token.typ == EnumToken.AngleTokenType) {
|
|
73
|
-
switch (token.unit) {
|
|
74
|
-
case 'deg':
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
return token.val / 360;
|
|
77
|
-
case 'rad':
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
return token.val / (2 * Math.PI);
|
|
80
|
-
case 'grad':
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
return token.val / 400;
|
|
83
|
-
case 'turn':
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
return +token.val;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// @ts-ignore
|
|
89
|
-
return token.val / 360;
|
|
90
|
-
}
|
|
91
|
-
function filterValues(values) {
|
|
92
|
-
let i = 0;
|
|
93
|
-
for (; i < values.length; i++) {
|
|
94
|
-
if (values[i].typ == EnumToken.ImportantTokenType && values[i - 1]?.typ == EnumToken.WhitespaceTokenType) {
|
|
95
|
-
values.splice(i - 1, 1);
|
|
96
|
-
}
|
|
97
|
-
else if (funcLike.includes(values[i].typ) && !['var', 'calc'].includes(values[i].val) && values[i + 1]?.typ == EnumToken.WhitespaceTokenType) {
|
|
98
|
-
values.splice(i + 1, 1);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return values;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export { clamp, filterValues, getAngle, getNumber, reduceNumber };
|