File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
name = " DataAPI"
2
2
uuid = " 9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
3
3
authors = [
" quinnj <[email protected] >" ]
4
- version = " 1.5.1 "
4
+ version = " 1.6.0 "
5
5
6
6
[compat ]
7
7
julia = " 1"
Original file line number Diff line number Diff line change @@ -169,4 +169,18 @@ struct Cols{T<:Tuple}
169
169
Cols (args... ) = new {typeof(args)} (args)
170
170
end
171
171
172
+ """
173
+ unwrap(x)
174
+
175
+ For a given scalar argument `x`, potentially "unwrap" it to return the base wrapped value.
176
+ Useful as a generic API for wrapper types when the original value is needed.
177
+
178
+ The default definition just returns `x` itself, i.e. no unwrapping is performned.
179
+
180
+ This generic function is owned by DataAPI.jl itself, which is the sole provider of the
181
+ default definition.
182
+ """
183
+ function unwrap end
184
+ unwrap (x) = x
185
+
172
186
end # module
Original file line number Diff line number Diff line change 85
85
86
86
end
87
87
88
+ @testset " unwrap" begin
89
+ @test DataAPI. unwrap (1 ) === 1
90
+ @test DataAPI. unwrap (missing ) === missing
91
+ end
92
+
88
93
end # @testset "DataAPI"
You can’t perform that action at this time.
0 commit comments