jsonapi-resources-anchor 2.5.0 → 2.6.0
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/anchor/config.rb +3 -1
- data/lib/anchor/type_script/serializer.rb +1 -1
- data/lib/anchor/version.rb +1 -1
- 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: 8bbb91066034b7aecb90bd6c7a686b4cc7d183c4dbd188cb972d51ef1e4f2a82
|
4
|
+
data.tar.gz: 3adb33a6252da68c2117a1fc3aa394d752e753e75ffc58ac5b8b906d3f6adefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a3e8bce509f345e491494bf0abe46f20bd011a00c4d380603e1c8553e9c899f673dbd48fec8d14d0286ab68115c7683ec76cc7a1a1e5372203e5e3a3bbe5834
|
7
|
+
data.tar.gz: 54bd4102d201a62e8d2a6ab3888a523779ecb4f3aa30cb89005c07ac442da9b0755368830742df20eaff530fe62dd47486496733d6358f203eebb174c4824937
|
data/lib/anchor/config.rb
CHANGED
@@ -7,7 +7,8 @@ module Anchor
|
|
7
7
|
:infer_nullable_relationships_as_optional,
|
8
8
|
:empty_relationship_type,
|
9
9
|
:use_type_as_schema_name,
|
10
|
-
:maybe_as_union
|
10
|
+
:maybe_as_union,
|
11
|
+
:array_bracket_notation
|
11
12
|
|
12
13
|
def initialize
|
13
14
|
@ar_column_to_type = nil
|
@@ -18,6 +19,7 @@ module Anchor
|
|
18
19
|
@empty_relationship_type = nil
|
19
20
|
@use_type_as_schema_name = nil
|
20
21
|
@maybe_as_union = nil
|
22
|
+
@array_bracket_notation = nil
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -12,7 +12,7 @@ module Anchor::TypeScript
|
|
12
12
|
when Anchor::Types::Record, Anchor::Types::Record.singleton_class then "Record<string, #{type_string(type.try(:value_type) || Anchor::Types::Unknown)}>"
|
13
13
|
when Anchor::Types::Union then type.types.map { |type| type_string(type, depth) }.join(" | ")
|
14
14
|
when Anchor::Types::Maybe then Anchor.config.maybe_as_union ? type_string(Anchor::Types::Union.new([type.type, Anchor::Types::Null]), depth) : "Maybe<#{type_string(type.type, depth)}>"
|
15
|
-
when Anchor::Types::Array then "Array<#{type_string(type.type, depth)}>"
|
15
|
+
when Anchor::Types::Array then Anchor.config.array_bracket_notation ? "#{type_string(type.type, depth)}[]" : "Array<#{type_string(type.type, depth)}>"
|
16
16
|
when Anchor::Types::Literal then serialize_literal(type.value)
|
17
17
|
when Anchor::Types::Reference then type.name
|
18
18
|
when Anchor::Types::Object, Anchor::Types::Object.singleton_class then serialize_object(type, depth)
|
data/lib/anchor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-resources-anchor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-resources
|