@biblioteksentralen/marc 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -103,4 +103,5 @@ const result = validate(record.toJSON());
103
103
 
104
104
  ## Changelog
105
105
 
106
+ - 0.3.0: Upgrade to Zod 4
106
107
  - 0.2.0: Removed the logger argument from `MarcRecord.fromJSON()`.
package/dist/index.d.cts CHANGED
@@ -139,77 +139,19 @@ declare function parseMarcXml(input: string | XmlElement, options?: MarcXmlOptio
139
139
  declare const marcRecordZodSchema: z.ZodObject<{
140
140
  format: z.ZodOptional<z.ZodString>;
141
141
  leader: z.ZodString;
142
- fields: z.ZodArray<z.ZodUnion<[z.ZodObject<{
142
+ fields: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
143
143
  tag: z.ZodString;
144
144
  value: z.ZodString;
145
- }, "strip", z.ZodTypeAny, {
146
- tag: string;
147
- value: string;
148
- }, {
149
- tag: string;
150
- value: string;
151
- }>, z.ZodObject<{
145
+ }, z.core.$strip>, z.ZodObject<{
152
146
  tag: z.ZodString;
153
147
  ind1: z.ZodOptional<z.ZodString>;
154
148
  ind2: z.ZodOptional<z.ZodString>;
155
149
  subfields: z.ZodArray<z.ZodObject<{
156
150
  code: z.ZodString;
157
151
  value: z.ZodString;
158
- }, "strip", z.ZodTypeAny, {
159
- value: string;
160
- code: string;
161
- }, {
162
- value: string;
163
- code: string;
164
- }>, "many">;
165
- }, "strip", z.ZodTypeAny, {
166
- tag: string;
167
- subfields: {
168
- value: string;
169
- code: string;
170
- }[];
171
- ind1?: string | undefined;
172
- ind2?: string | undefined;
173
- }, {
174
- tag: string;
175
- subfields: {
176
- value: string;
177
- code: string;
178
- }[];
179
- ind1?: string | undefined;
180
- ind2?: string | undefined;
181
- }>]>, "many">;
182
- }, "strip", z.ZodTypeAny, {
183
- fields: ({
184
- tag: string;
185
- value: string;
186
- } | {
187
- tag: string;
188
- subfields: {
189
- value: string;
190
- code: string;
191
- }[];
192
- ind1?: string | undefined;
193
- ind2?: string | undefined;
194
- })[];
195
- leader: string;
196
- format?: string | undefined;
197
- }, {
198
- fields: ({
199
- tag: string;
200
- value: string;
201
- } | {
202
- tag: string;
203
- subfields: {
204
- value: string;
205
- code: string;
206
- }[];
207
- ind1?: string | undefined;
208
- ind2?: string | undefined;
209
- })[];
210
- leader: string;
211
- format?: string | undefined;
212
- }>;
152
+ }, z.core.$strip>>;
153
+ }, z.core.$strip>]>>;
154
+ }, z.core.$strip>;
213
155
 
214
156
  declare function serializeLineMarc(input: MarcRecord): string;
215
157
 
package/dist/index.d.ts CHANGED
@@ -139,77 +139,19 @@ declare function parseMarcXml(input: string | XmlElement, options?: MarcXmlOptio
139
139
  declare const marcRecordZodSchema: z.ZodObject<{
140
140
  format: z.ZodOptional<z.ZodString>;
141
141
  leader: z.ZodString;
142
- fields: z.ZodArray<z.ZodUnion<[z.ZodObject<{
142
+ fields: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
143
143
  tag: z.ZodString;
144
144
  value: z.ZodString;
145
- }, "strip", z.ZodTypeAny, {
146
- tag: string;
147
- value: string;
148
- }, {
149
- tag: string;
150
- value: string;
151
- }>, z.ZodObject<{
145
+ }, z.core.$strip>, z.ZodObject<{
152
146
  tag: z.ZodString;
153
147
  ind1: z.ZodOptional<z.ZodString>;
154
148
  ind2: z.ZodOptional<z.ZodString>;
155
149
  subfields: z.ZodArray<z.ZodObject<{
156
150
  code: z.ZodString;
157
151
  value: z.ZodString;
158
- }, "strip", z.ZodTypeAny, {
159
- value: string;
160
- code: string;
161
- }, {
162
- value: string;
163
- code: string;
164
- }>, "many">;
165
- }, "strip", z.ZodTypeAny, {
166
- tag: string;
167
- subfields: {
168
- value: string;
169
- code: string;
170
- }[];
171
- ind1?: string | undefined;
172
- ind2?: string | undefined;
173
- }, {
174
- tag: string;
175
- subfields: {
176
- value: string;
177
- code: string;
178
- }[];
179
- ind1?: string | undefined;
180
- ind2?: string | undefined;
181
- }>]>, "many">;
182
- }, "strip", z.ZodTypeAny, {
183
- fields: ({
184
- tag: string;
185
- value: string;
186
- } | {
187
- tag: string;
188
- subfields: {
189
- value: string;
190
- code: string;
191
- }[];
192
- ind1?: string | undefined;
193
- ind2?: string | undefined;
194
- })[];
195
- leader: string;
196
- format?: string | undefined;
197
- }, {
198
- fields: ({
199
- tag: string;
200
- value: string;
201
- } | {
202
- tag: string;
203
- subfields: {
204
- value: string;
205
- code: string;
206
- }[];
207
- ind1?: string | undefined;
208
- ind2?: string | undefined;
209
- })[];
210
- leader: string;
211
- format?: string | undefined;
212
- }>;
152
+ }, z.core.$strip>>;
153
+ }, z.core.$strip>]>>;
154
+ }, z.core.$strip>;
213
155
 
214
156
  declare function serializeLineMarc(input: MarcRecord): string;
215
157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biblioteksentralen/marc",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "MARC record parser and serializer",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "ajv": "^8.17.1",
29
- "zod": "^3.23.8",
29
+ "zod": "^4.3.6",
30
30
  "@biblioteksentralen/xml-utils": "^0.0.3"
31
31
  },
32
32
  "devDependencies": {