sorbet-runtime 0.5.12155 → 0.6.12632
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.
- checksums.yaml +4 -4
- data/lib/types/_types.rb +1 -1
- data/lib/types/boolean.rb +1 -1
- data/lib/types/configuration.rb +4 -14
- data/lib/types/enum.rb +35 -35
- data/lib/types/non_forcing_constants.rb +1 -1
- data/lib/types/private/abstract/data.rb +1 -1
- data/lib/types/private/methods/_methods.rb +21 -5
- data/lib/types/private/methods/call_validation.rb +3 -16
- data/lib/types/private/methods/decl_builder.rb +6 -1
- data/lib/types/private/methods/signature.rb +8 -8
- data/lib/types/private/methods/signature_validation.rb +42 -3
- data/lib/types/private/mixins/mixins.rb +1 -1
- data/lib/types/private/runtime_levels.rb +1 -1
- data/lib/types/private/sealed.rb +5 -5
- data/lib/types/props/_props.rb +6 -9
- data/lib/types/props/constructor.rb +1 -1
- data/lib/types/props/custom_type.rb +5 -5
- data/lib/types/props/decorator.rb +127 -64
- data/lib/types/props/generated_code_validation.rb +4 -4
- data/lib/types/props/has_lazily_specialized_methods.rb +13 -13
- data/lib/types/props/optional.rb +2 -2
- data/lib/types/props/pretty_printable.rb +6 -6
- data/lib/types/props/private/apply_default.rb +15 -15
- data/lib/types/props/private/deserializer_generator.rb +10 -6
- data/lib/types/props/private/serde_transform.rb +8 -8
- data/lib/types/props/private/serializer_generator.rb +9 -5
- data/lib/types/props/private/setter_factory.rb +4 -4
- data/lib/types/props/serializable.rb +14 -19
- data/lib/types/props/type_validation.rb +5 -5
- data/lib/types/props/utils.rb +1 -1
- data/lib/types/props/weak_constructor.rb +3 -3
- data/lib/types/sig.rb +2 -2
- data/lib/types/struct.rb +2 -2
- data/lib/types/types/base.rb +6 -6
- data/lib/types/types/fixed_array.rb +1 -1
- data/lib/types/types/fixed_hash.rb +6 -6
- data/lib/types/types/intersection.rb +2 -2
- data/lib/types/types/t_enum.rb +2 -0
- data/lib/types/types/union.rb +7 -7
- metadata +3 -3
data/lib/types/types/union.rb
CHANGED
@@ -44,11 +44,11 @@ module T::Types
|
|
44
44
|
nilable = T::Utils.coerce(NilClass)
|
45
45
|
trueclass = T::Utils.coerce(TrueClass)
|
46
46
|
falseclass = T::Utils.coerce(FalseClass)
|
47
|
-
if types.any? {|t| t == nilable}
|
48
|
-
remaining_types = types.reject {|t| t == nilable}
|
47
|
+
if types.any? { |t| t == nilable }
|
48
|
+
remaining_types = types.reject { |t| t == nilable }
|
49
49
|
"T.nilable(#{type_shortcuts(remaining_types)})"
|
50
|
-
elsif types.any? {|t| t == trueclass} && types.any? {|t| t == falseclass}
|
51
|
-
remaining_types = types.reject {|t| t == trueclass || t == falseclass}
|
50
|
+
elsif types.any? { |t| t == trueclass } && types.any? { |t| t == falseclass }
|
51
|
+
remaining_types = types.reject { |t| t == trueclass || t == falseclass }
|
52
52
|
type_shortcuts([T::Private::Types::StringHolder.new("T::Boolean")] + remaining_types)
|
53
53
|
else
|
54
54
|
names = types.map(&:name).compact.sort
|
@@ -58,12 +58,12 @@ module T::Types
|
|
58
58
|
|
59
59
|
# overrides Base
|
60
60
|
def recursively_valid?(obj)
|
61
|
-
types.any? {|type| type.recursively_valid?(obj)}
|
61
|
+
types.any? { |type| type.recursively_valid?(obj) }
|
62
62
|
end
|
63
63
|
|
64
64
|
# overrides Base
|
65
65
|
def valid?(obj)
|
66
|
-
types.any? {|type| type.valid?(obj)}
|
66
|
+
types.any? { |type| type.valid?(obj) }
|
67
67
|
end
|
68
68
|
|
69
69
|
# overrides Base
|
@@ -72,7 +72,7 @@ module T::Types
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def unwrap_nilable
|
75
|
-
non_nil_types = types.reject {|t| t == T::Utils::Nilable::NIL_TYPE}
|
75
|
+
non_nil_types = types.reject { |t| t == T::Utils::Nilable::NIL_TYPE }
|
76
76
|
return nil if types.length == non_nil_types.length
|
77
77
|
case non_nil_types.length
|
78
78
|
when 0 then nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorbet-runtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.12632
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -256,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
256
|
requirements:
|
257
257
|
- - ">="
|
258
258
|
- !ruby/object:Gem::Version
|
259
|
-
version:
|
259
|
+
version: 3.0.0
|
260
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
262
|
- - ">="
|