File tree Expand file tree Collapse file tree 6 files changed +7
-3
lines changed Expand file tree Collapse file tree 6 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ The `tailwind_merge` config is an object with several keys:
189
189
tailwind_merge_config = {
190
190
# ↓ *Optional* Define how many values should be stored in cache.
191
191
cache_size: 500,
192
+ # ↓ *Optional* Enable or disable caching nil values.
193
+ ignore_empty_cache: true,
192
194
# ↓ *Optional* modifier separator from Tailwind config
193
195
separator: ":",
194
196
# ↓ *Optional* prefix from Tailwind config
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def initialize(config: {})
26
26
end
27
27
28
28
@class_utils = TailwindMerge ::ClassUtils . new ( @config )
29
- @cache = LruRedux ::Cache . new ( @config [ :cache_size ] )
29
+ @cache = LruRedux ::Cache . new ( @config [ :cache_size ] , @config [ :ignore_empty_cache ] )
30
30
end
31
31
32
32
def merge ( classes )
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ module Config
84
84
85
85
DEFAULTS = {
86
86
cache_size : 500 ,
87
+ ignore_empty_cache : true ,
87
88
separator : ":" ,
88
89
theme : {
89
90
"colors" => [ IS_ANY ] ,
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
module TailwindMerge
4
- VERSION = "0.14 .0"
4
+ VERSION = "0.15 .0"
5
5
end
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
spec . executables = spec . files . grep ( %r{\A exe/} ) { |f | File . basename ( f ) }
36
36
spec . require_paths = [ "lib" ]
37
37
38
- spec . add_dependency ( "lru_redux " , "~> 1.1 " )
38
+ spec . add_dependency ( "sin_lru_redux " , "~> 2.5 " )
39
39
40
40
spec . add_development_dependency ( "minitest" , "~> 5.6" )
41
41
spec . add_development_dependency ( "minitest-focus" , "~> 1.1" )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ def test_default_config_has_correct_types
7
7
config = TailwindMerge ::Config ::DEFAULTS
8
8
9
9
assert_equal ( 500 , config [ :cache_size ] )
10
+ assert ( config [ :ignore_empty_cache ] )
10
11
refute ( config [ :nonexistent ] )
11
12
assert_equal ( "block" , config [ :class_groups ] [ "display" ] . first )
12
13
assert_equal ( "auto" , config [ :class_groups ] [ "overflow" ] . first [ "overflow" ] . first )
You can’t perform that action at this time.
0 commit comments