@arrirpc/schema 0.45.3 → 0.45.5

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/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const timestamp = require('./shared/schema.34cb5fb7.cjs');
3
+ const timestamp = require('./shared/schema.7caa5c59.cjs');
4
4
  const jtdUtils = require('jtd-utils');
5
5
  const scule = require('scule');
6
6
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { u as uint8Max, a as uint8Min, b as uint16Max, c as uint16Min, d as uint32Max, e as uint32Min, i as int8Max, f as int8Min, g as int16Max, h as int16Min, j as int32Max, k as int32Min, l as isAScalarSchema, m as isAObjectSchema, n as isAStringEnumSchema, o as isAAraySchema, p as isARecordSchema, q as isADiscriminatorSchema, r as isARefSchema, s as errors, V as ValidationError, t as any, v as array, w as boolean, x as clone, y as coerce, z as discriminator, A as enumerator, B as extend, C as float32, D as float64, E as int16, F as int32, G as int64, H as int8, I as nullable, J as number, K as object, L as omit, M as optional, N as parse, O as partial, P as pick, Q as record, R as recursive, S as safeCoerce, T as safeParse, U as serialize, W as string, X as stringEnum, Y as timestamp, Z as uint16, _ as uint32, $ as uint64, a0 as uint8, a1 as validate, a2 as isASchema, a3 as SCHEMA_METADATA } from './shared/schema.66772201.mjs';
2
- export { ae as NumberTypeValues, a5 as int64Max, a4 as int64Min, af as isObject, ad as isValidationError, a8 as parseObjectSchema, ac as sanitizeJson, aa as serializeObject, ab as serializeSmallString, a7 as uint64Max, a6 as uint64Min, a9 as validateObjectSchema } from './shared/schema.66772201.mjs';
1
+ import { u as uint8Max, a as uint8Min, b as uint16Max, c as uint16Min, d as uint32Max, e as uint32Min, i as int8Max, f as int8Min, g as int16Max, h as int16Min, j as int32Max, k as int32Min, l as isAScalarSchema, m as isAObjectSchema, n as isAStringEnumSchema, o as isAAraySchema, p as isARecordSchema, q as isADiscriminatorSchema, r as isARefSchema, s as errors, V as ValidationError, t as any, v as array, w as boolean, x as clone, y as coerce, z as discriminator, A as enumerator, B as extend, C as float32, D as float64, E as int16, F as int32, G as int64, H as int8, I as nullable, J as number, K as object, L as omit, M as optional, N as parse, O as partial, P as pick, Q as record, R as recursive, S as safeCoerce, T as safeParse, U as serialize, W as string, X as stringEnum, Y as timestamp, Z as uint16, _ as uint32, $ as uint64, a0 as uint8, a1 as validate, a2 as isASchema, a3 as SCHEMA_METADATA } from './shared/schema.36d754fd.mjs';
2
+ export { ae as NumberTypeValues, a5 as int64Max, a4 as int64Min, af as isObject, ad as isValidationError, a8 as parseObjectSchema, ac as sanitizeJson, aa as serializeObject, ab as serializeSmallString, a7 as uint64Max, a6 as uint64Min, a9 as validateObjectSchema } from './shared/schema.36d754fd.mjs';
3
3
  import { isSchemaFormProperties, isSchemaFormValues, isSchemaFormElements, isSchemaFormDiscriminator, isSchemaFormEmpty, isSchemaFormType, isSchemaFormEnum, isSchemaFormRef } from 'jtd-utils';
4
4
  import { camelCase } from 'scule';
5
5
 
@@ -520,20 +520,20 @@ function discriminatorMappingError(discriminatorVal, data) {
520
520
 
521
521
  const stringEnum = enumerator;
522
522
  function enumerator(paramA, paramB) {
523
+ const isIdShorthand = typeof paramA === "string";
524
+ const enumVal = isIdShorthand ? paramB : paramA;
525
+ const meta = isIdShorthand ? { id: paramA } : paramB;
523
526
  const isType = (input) => {
524
527
  if (typeof input !== "string") {
525
528
  return false;
526
529
  }
527
- for (const val of paramA) {
530
+ for (const val of enumVal) {
528
531
  if (val === input) {
529
532
  return true;
530
533
  }
531
534
  }
532
535
  return false;
533
536
  };
534
- const isIdShorthand = typeof paramA === "string";
535
- const enumVal = isIdShorthand ? paramB : paramA;
536
- const meta = isIdShorthand ? { id: paramA } : paramB;
537
537
  return {
538
538
  enum: enumVal,
539
539
  metadata: {
@@ -725,14 +725,14 @@ function coerceNumber(input, options) {
725
725
  return parseNumber(input, options);
726
726
  }
727
727
  function float32(opts = {}) {
728
- return numberScalarType("float32", opts, (input) => {
728
+ return numberScalarType("float32", opts, () => {
729
729
  return {
730
730
  success: true
731
731
  };
732
732
  });
733
733
  }
734
734
  function float64(opts = {}) {
735
- return numberScalarType("float64", opts, (input) => {
735
+ return numberScalarType("float64", opts, () => {
736
736
  return {
737
737
  success: true
738
738
  };
@@ -940,7 +940,7 @@ function validateNumber(input) {
940
940
  function validateInt(input, minVal, maxValue) {
941
941
  return Number.isInteger(input) && input >= minVal && input <= maxValue;
942
942
  }
943
- function serializeNumber(input, data) {
943
+ function serializeNumber(input, _data) {
944
944
  return input.toString();
945
945
  }
946
946
  function parseNumber(input, options) {
@@ -522,20 +522,20 @@ function discriminatorMappingError(discriminatorVal, data) {
522
522
 
523
523
  const stringEnum = enumerator;
524
524
  function enumerator(paramA, paramB) {
525
+ const isIdShorthand = typeof paramA === "string";
526
+ const enumVal = isIdShorthand ? paramB : paramA;
527
+ const meta = isIdShorthand ? { id: paramA } : paramB;
525
528
  const isType = (input) => {
526
529
  if (typeof input !== "string") {
527
530
  return false;
528
531
  }
529
- for (const val of paramA) {
532
+ for (const val of enumVal) {
530
533
  if (val === input) {
531
534
  return true;
532
535
  }
533
536
  }
534
537
  return false;
535
538
  };
536
- const isIdShorthand = typeof paramA === "string";
537
- const enumVal = isIdShorthand ? paramB : paramA;
538
- const meta = isIdShorthand ? { id: paramA } : paramB;
539
539
  return {
540
540
  enum: enumVal,
541
541
  metadata: {
@@ -727,14 +727,14 @@ function coerceNumber(input, options) {
727
727
  return parseNumber(input, options);
728
728
  }
729
729
  function float32(opts = {}) {
730
- return numberScalarType("float32", opts, (input) => {
730
+ return numberScalarType("float32", opts, () => {
731
731
  return {
732
732
  success: true
733
733
  };
734
734
  });
735
735
  }
736
736
  function float64(opts = {}) {
737
- return numberScalarType("float64", opts, (input) => {
737
+ return numberScalarType("float64", opts, () => {
738
738
  return {
739
739
  success: true
740
740
  };
@@ -942,7 +942,7 @@ function validateNumber(input) {
942
942
  function validateInt(input, minVal, maxValue) {
943
943
  return Number.isInteger(input) && input >= minVal && input <= maxValue;
944
944
  }
945
- function serializeNumber(input, data) {
945
+ function serializeNumber(input, _data) {
946
946
  return input.toString();
947
947
  }
948
948
  function parseNumber(input, options) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const timestamp = require('./shared/schema.34cb5fb7.cjs');
3
+ const timestamp = require('./shared/schema.7caa5c59.cjs');
4
4
  require('jtd-utils');
5
5
  require('scule');
6
6
 
@@ -1,4 +1,4 @@
1
- import { K as object, W as string, M as optional, I as nullable, F as int32, z as discriminator, w as boolean, X as stringEnum, v as array, Y as timestamp, _ as uint32, t as any, J as number, Q as record, R as recursive, D as float64, C as float32, G as int64, E as int16, Z as uint16, H as int8, a0 as uint8, O as partial, $ as uint64, P as pick, A as enumerator } from './shared/schema.66772201.mjs';
1
+ import { K as object, W as string, M as optional, I as nullable, F as int32, z as discriminator, w as boolean, X as stringEnum, v as array, Y as timestamp, _ as uint32, t as any, J as number, Q as record, R as recursive, D as float64, C as float32, G as int64, E as int16, Z as uint16, H as int8, a0 as uint8, O as partial, $ as uint64, P as pick, A as enumerator } from './shared/schema.36d754fd.mjs';
2
2
  import 'jtd-utils';
3
3
  import 'scule';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrirpc/schema",
3
- "version": "0.45.3",
3
+ "version": "0.45.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "scule": "^1.3.0",
26
26
  "uncrypto": "^0.1.3",
27
- "jtd-utils": "0.45.3"
27
+ "jtd-utils": "0.45.5"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@faker-js/faker": "^8.4.1",