sorbet-runtime 0.5.6210 → 0.5.6229

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d96f573100aca25efc082a55332ac9e77dcf77000bbb55d206ecbe6f8cd8b1c7
4
- data.tar.gz: 9e3584c586f9e22667438159bc536b8f59041c353a89ca47de8b798be37aba9a
3
+ metadata.gz: b502e1602055bd3d9f75671c0261e4dd1544aa4faefd5750bdff385843cfbac9
4
+ data.tar.gz: 2b9b067b20641e5a881c8e14350053a6a63578a5abd956f2bd6b072914f804c5
5
5
  SHA512:
6
- metadata.gz: 5b06839aa494f0897fa17cea0ace23ca79f58ba380733af919e9c9a3940094d2500c80bfe337c89af38b4576f0293f2fc317a0fe8f273927f6668eb2f99d4d56
7
- data.tar.gz: 8257fec1635756b18390b4ab858f1e62ec863f4d1d224ffd3457d5797e1e2e7299ded450e3bc0ae3d6a3a9c27feefc08014ff3250c16818871cc389102f22ab5
6
+ metadata.gz: 3cdff26a4225bef4e61323f4b7b45d5866585af11309ec1ffe34175b387aa35f76e1f26150cc59db28d7f55958e90bf91820070c11b779341e1895cbbaf7e8f5
7
+ data.tar.gz: 0032ed7d97c722066dedfbb790a3c45edf8ba03942ebd2c513b0aefcb4b78dc24f3b4982f649a424774a0ba0e9e9a8aae2d4279c82462962a4786f4ce948acca
@@ -99,18 +99,21 @@ module T::Props
99
99
  else
100
100
  "#{varname}.nil? ? nil : #{inner}"
101
101
  end
102
- elsif type.types.all? {|t| generate(t, mode, varname).nil?}
103
- # Handle, e.g., T::Boolean
104
- nil
105
102
  else
106
- # We currently deep_clone_object if the type was T.any(Integer, Float).
107
- # When we get better support for union types (maybe this specific
108
- # union type, because it would be a replacement for
109
- # Chalk::ODM::DeprecatedNumemric), we could opt to special case
110
- # this union to have no specific serde transform (the only reason
111
- # why Float has a special case is because round tripping through
112
- # JSON might normalize Floats to Integers)
113
- "T::Props::Utils.deep_clone_object(#{varname})"
103
+ inners = type.types.map {|t| generate(t, mode, varname)}.uniq
104
+ if inners.length <= 1
105
+ # Handle, e.g., T::Boolean
106
+ inners.first
107
+ else
108
+ # We currently deep_clone_object if the type was T.any(Integer, Float).
109
+ # When we get better support for union types (maybe this specific
110
+ # union type, because it would be a replacement for
111
+ # Chalk::ODM::DeprecatedNumemric), we could opt to special case
112
+ # this union to have no specific serde transform (the only reason
113
+ # why Float has a special case is because round tripping through
114
+ # JSON might normalize Floats to Integers)
115
+ "T::Props::Utils.deep_clone_object(#{varname})"
116
+ end
114
117
  end
115
118
  when T::Types::Intersection
116
119
  dynamic_fallback = "T::Props::Utils.deep_clone_object(#{varname})"
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.5.6210
4
+ version: 0.5.6229
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest