sorbet-runtime 0.5.6212 → 0.5.6231

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: dc3d3100960728c03bc0190d8f2ef6d4e7a3fc3d7298ccf204bb2ea9e7e46af8
4
- data.tar.gz: 60ec983b6982fbf5d6c97e0255b66fe3fa7d8ebe566073f9790e5d91f99a2c09
3
+ metadata.gz: '069f84b31f876abc14790f30b37c3337d70393af4f11cd4c7f9987305650c491'
4
+ data.tar.gz: 4dd443f8e4aea9a6e6cdc85dfeb58d19b6ce726358829cde193fc1222b3bfbc0
5
5
  SHA512:
6
- metadata.gz: 1cec14c68d752556a949253e4f536c5abc35c80e1403dbe460aa189a1daf612f7c5d93f2687a3d6577240806b8baff101ee8399ee4cafb3998b081c34cc73e39
7
- data.tar.gz: 034c5591fa0bfa38a22e1ef2e03b0eff26ddc05f6186a9bd5bb788612f1db8b68ce538774d6cf8cb9e568286f04999f6f4951b3c4876dbc6ba0173b457547a12
6
+ metadata.gz: 389800bfb22d64bc1c76de006d5336c49b145e240e525773592c6dcb1394f9db4833e54d29b6b46297db6507ae30dee4a9a6ae02b7886025c8100ae325452b34
7
+ data.tar.gz: 5701e97e74c4036a1e6252f30450584b473b7e83e0623eda56265ca3923b94f3b4e1d5d9a5bdc5754682a1d4f231dd5770a31da11aa4851672980e46c7fce4ea
@@ -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.6212
4
+ version: 0.5.6231
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-15 00:00:00.000000000 Z
11
+ date: 2021-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest