diff --git a/src/api.jl b/src/api.jl index b2c8d96e..6028b727 100644 --- a/src/api.jl +++ b/src/api.jl @@ -77,8 +77,8 @@ Data(; format=nothing, ) = DataSpec(_remove_empty(;url, format, name)) function Data(generator::SymbolOrString; kw...) - kw = isempty(kw) ? true : kw - Data(NamedTuple{(generator,)}((NamedTuple(kw), ))) + kw = isempty(kw) ? true : NamedTuple(kw) + Data(NamedTuple{(generator,)}((kw, ))) end Data(key::SymbolOrString, value::SymbolOrString) = Data(NamedTuple{(key,)}((value, ))) diff --git a/test/test_api.jl b/test/test_api.jl index 38ace1c8..5b3c8ad1 100644 --- a/test/test_api.jl +++ b/test/test_api.jl @@ -61,7 +61,8 @@ end @test rawspec(Data(3)) == 3 @test Data(url="url") isa Deneb.DataSpec @test Data(url="url").data == (;url="url") - @test Data(:graticule, step=[15, 15]).data == (graticule = (step = [15, 15],),) + @test Data(:graticule, step=[15, 15]).data == (;graticule = (;step = [15, 15])) + @test Data(:sphere).data == (;sphere = true) @test Data(:name, :nodes).data == (;name=:nodes) end