sorbet-runtime 0.5.6212 → 0.5.6216
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/props/private/serde_transform.rb +14 -11
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e109cf89106c735e4b0ab1feacc562c4af2da892289e55de42c11497a69293b1
|
|
4
|
+
data.tar.gz: '025058f9f1e2c039d788392a903114646658d9d035b8015ed0dc11a0c220d564'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5531bd7114e93124796a138db0acc9560b0bea76088b85f14d6c32feb2173b34898820cc92d567ef2f273c746e9633090fec7ad542fe71c95e77449cffb6a0ce
|
|
7
|
+
data.tar.gz: e193049ac7c4101841c3ba25b817738aa99b0f6065ab44c592ab3bc8b8298260be2ce41ca4a8bd132665b923939f230c0d358c615d1d35dce32c179a378ad24a
|
|
@@ -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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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.
|
|
4
|
+
version: 0.5.6216
|
|
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-
|
|
11
|
+
date: 2021-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|