tinybase 8.3.0-beta.2 → 8.3.0-beta.3
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/@types/schematizers/schematizer-arktype/index.d.ts +5 -4
- package/@types/schematizers/schematizer-effect/index.d.ts +7 -7
- package/@types/schematizers/schematizer-typebox/index.d.ts +4 -3
- package/@types/schematizers/schematizer-valibot/index.d.ts +5 -4
- package/@types/schematizers/schematizer-yup/index.d.ts +4 -3
- package/@types/schematizers/schematizer-zod/index.d.ts +6 -5
- package/min/schematizers/schematizer-arktype/index.js +1 -1
- package/min/schematizers/schematizer-arktype/index.js.gz +0 -0
- package/min/schematizers/schematizer-arktype/with-schemas/index.js +1 -1
- package/min/schematizers/schematizer-arktype/with-schemas/index.js.gz +0 -0
- package/min/schematizers/schematizer-effect/index.js +1 -1
- package/min/schematizers/schematizer-effect/index.js.gz +0 -0
- package/min/schematizers/schematizer-effect/with-schemas/index.js +1 -1
- package/min/schematizers/schematizer-effect/with-schemas/index.js.gz +0 -0
- package/min/schematizers/schematizer-typebox/index.js +1 -1
- package/min/schematizers/schematizer-typebox/index.js.gz +0 -0
- package/min/schematizers/schematizer-typebox/with-schemas/index.js +1 -1
- package/min/schematizers/schematizer-typebox/with-schemas/index.js.gz +0 -0
- package/min/schematizers/schematizer-valibot/index.js +1 -1
- package/min/schematizers/schematizer-valibot/index.js.gz +0 -0
- package/min/schematizers/schematizer-valibot/with-schemas/index.js +1 -1
- package/min/schematizers/schematizer-valibot/with-schemas/index.js.gz +0 -0
- package/min/schematizers/schematizer-yup/index.js +1 -1
- package/min/schematizers/schematizer-yup/index.js.gz +0 -0
- package/min/schematizers/schematizer-yup/with-schemas/index.js +1 -1
- package/min/schematizers/schematizer-yup/with-schemas/index.js.gz +0 -0
- package/min/schematizers/schematizer-zod/index.js +1 -1
- package/min/schematizers/schematizer-zod/index.js.gz +0 -0
- package/min/schematizers/schematizer-zod/with-schemas/index.js +1 -1
- package/min/schematizers/schematizer-zod/with-schemas/index.js.gz +0 -0
- package/package.json +3 -3
- package/readme.md +3 -3
- package/releases.md +55 -14
- package/schematizers/schematizer-arktype/index.js +16 -11
- package/schematizers/schematizer-arktype/with-schemas/index.js +16 -11
- package/schematizers/schematizer-effect/index.js +27 -14
- package/schematizers/schematizer-effect/with-schemas/index.js +27 -14
- package/schematizers/schematizer-typebox/index.js +13 -4
- package/schematizers/schematizer-typebox/with-schemas/index.js +13 -4
- package/schematizers/schematizer-valibot/index.js +17 -1
- package/schematizers/schematizer-valibot/with-schemas/index.js +17 -1
- package/schematizers/schematizer-yup/index.js +16 -5
- package/schematizers/schematizer-yup/with-schemas/index.js +16 -5
- package/schematizers/schematizer-zod/index.js +16 -6
- package/schematizers/schematizer-zod/with-schemas/index.js +16 -6
|
@@ -20,8 +20,9 @@ export interface ArkTypeSchematizer extends Schematizer {
|
|
|
20
20
|
* TinyBase TablesSchema.
|
|
21
21
|
*
|
|
22
22
|
* This method extracts basic type information (string, number, boolean),
|
|
23
|
-
* default values, and nullable flags from ArkType schemas.
|
|
24
|
-
* rules like min/max, regex patterns, refinements, and
|
|
23
|
+
* string literals, default values, and nullable flags from ArkType schemas.
|
|
24
|
+
* Complex validation rules like min/max, regex patterns, refinements, and
|
|
25
|
+
* transforms are ignored.
|
|
25
26
|
* @param schemas - A mapping of table IDs to ArkType object schemas.
|
|
26
27
|
* @returns A TinyBase TablesSchema.
|
|
27
28
|
* @example
|
|
@@ -56,8 +57,8 @@ export interface ArkTypeSchematizer extends Schematizer {
|
|
|
56
57
|
* The toValuesSchema method converts a mapping of ArkType schemas into a
|
|
57
58
|
* TinyBase ValuesSchema.
|
|
58
59
|
*
|
|
59
|
-
* This method extracts basic type information and default
|
|
60
|
-
* schemas.
|
|
60
|
+
* This method extracts basic type information, string literals, and default
|
|
61
|
+
* values from ArkType schemas.
|
|
61
62
|
* @param schemas - A mapping of value IDs to ArkType schemas.
|
|
62
63
|
* @returns A TinyBase ValuesSchema.
|
|
63
64
|
* @example
|
|
@@ -20,10 +20,10 @@ export interface EffectSchematizer extends Schematizer {
|
|
|
20
20
|
* into a TinyBase TablesSchema.
|
|
21
21
|
*
|
|
22
22
|
* This method extracts basic type information (string, number, boolean),
|
|
23
|
-
* nullable flags, and optional flags from Effect schemas.
|
|
24
|
-
* not supported as they exist in Effect's runtime
|
|
25
|
-
* schema AST. Complex validation rules,
|
|
26
|
-
* ignored.
|
|
23
|
+
* string literals, nullable flags, and optional flags from Effect schemas.
|
|
24
|
+
* Default values are not supported as they exist in Effect's runtime
|
|
25
|
+
* transformations, not in the schema AST. Complex validation rules,
|
|
26
|
+
* transformations, and refinements are ignored.
|
|
27
27
|
* @param schemas - A mapping of table IDs to Effect Schema struct schemas.
|
|
28
28
|
* @returns A TinyBase TablesSchema.
|
|
29
29
|
* @example
|
|
@@ -59,9 +59,9 @@ export interface EffectSchematizer extends Schematizer {
|
|
|
59
59
|
* TinyBase ValuesSchema.
|
|
60
60
|
*
|
|
61
61
|
* This method extracts basic type information (string, number, boolean),
|
|
62
|
-
* nullable flags, and optional flags from Effect schemas.
|
|
63
|
-
* not supported as they exist in Effect's runtime
|
|
64
|
-
* schema AST.
|
|
62
|
+
* string literals, nullable flags, and optional flags from Effect schemas.
|
|
63
|
+
* Default values are not supported as they exist in Effect's runtime
|
|
64
|
+
* transformations, not in the schema AST.
|
|
65
65
|
* @param schemas - A mapping of value IDs to Effect Schema schemas.
|
|
66
66
|
* @returns A TinyBase ValuesSchema.
|
|
67
67
|
* @example
|
|
@@ -20,8 +20,9 @@ export interface TypeBoxSchematizer extends Schematizer {
|
|
|
20
20
|
* TinyBase TablesSchema.
|
|
21
21
|
*
|
|
22
22
|
* This method extracts basic type information (string, number, boolean),
|
|
23
|
-
* default values, and nullable flags from TypeBox schemas.
|
|
24
|
-
* rules like min/max, patterns, formats, and custom
|
|
23
|
+
* string enums, default values, and nullable flags from TypeBox schemas.
|
|
24
|
+
* Complex validation rules like min/max, patterns, formats, and custom
|
|
25
|
+
* validators are ignored.
|
|
25
26
|
* @param schemas - A mapping of table IDs to TypeBox object schemas.
|
|
26
27
|
* @returns A TinyBase TablesSchema.
|
|
27
28
|
* @example
|
|
@@ -57,7 +58,7 @@ export interface TypeBoxSchematizer extends Schematizer {
|
|
|
57
58
|
* TinyBase ValuesSchema.
|
|
58
59
|
*
|
|
59
60
|
* This method extracts basic type information (string, number, boolean),
|
|
60
|
-
* default values, and nullable flags from TypeBox schemas.
|
|
61
|
+
* string enums, default values, and nullable flags from TypeBox schemas.
|
|
61
62
|
* @param schemas - A mapping of value IDs to TypeBox schemas.
|
|
62
63
|
* @returns A TinyBase ValuesSchema.
|
|
63
64
|
* @example
|
|
@@ -20,8 +20,9 @@ export interface ValibotSchematizer extends Schematizer {
|
|
|
20
20
|
* TinyBase TablesSchema.
|
|
21
21
|
*
|
|
22
22
|
* This method extracts basic type information (string, number, boolean),
|
|
23
|
-
* fallback values, and nullable flags from Valibot schemas.
|
|
24
|
-
* rules like min/max, regex patterns, refinements, and
|
|
23
|
+
* string picklists, fallback values, and nullable flags from Valibot schemas.
|
|
24
|
+
* Complex validation rules like min/max, regex patterns, refinements, and
|
|
25
|
+
* transforms are ignored.
|
|
25
26
|
* @param schemas - A mapping of table IDs to Valibot object schemas.
|
|
26
27
|
* @returns A TinyBase TablesSchema.
|
|
27
28
|
* @example
|
|
@@ -56,8 +57,8 @@ export interface ValibotSchematizer extends Schematizer {
|
|
|
56
57
|
* The toValuesSchema method converts a mapping of Valibot schemas into a
|
|
57
58
|
* TinyBase ValuesSchema.
|
|
58
59
|
*
|
|
59
|
-
* This method extracts basic type information and fallback
|
|
60
|
-
* schemas.
|
|
60
|
+
* This method extracts basic type information, string picklists, and fallback
|
|
61
|
+
* values from Valibot schemas.
|
|
61
62
|
* @param schemas - A mapping of value IDs to Valibot schemas.
|
|
62
63
|
* @returns A TinyBase ValuesSchema.
|
|
63
64
|
* @example
|
|
@@ -19,8 +19,9 @@ export interface YupSchematizer extends Schematizer {
|
|
|
19
19
|
* TinyBase TablesSchema.
|
|
20
20
|
*
|
|
21
21
|
* This method extracts basic type information (string, number, boolean),
|
|
22
|
-
* default values, and nullable flags from Yup schemas. Complex
|
|
23
|
-
* rules like min/max, regex patterns, tests, and transforms are
|
|
22
|
+
* string enums, default values, and nullable flags from Yup schemas. Complex
|
|
23
|
+
* validation rules like min/max, regex patterns, tests, and transforms are
|
|
24
|
+
* ignored.
|
|
24
25
|
* @param schemas - A mapping of table IDs to Yup object schemas.
|
|
25
26
|
* @returns A TinyBase TablesSchema.
|
|
26
27
|
* @example
|
|
@@ -56,7 +57,7 @@ export interface YupSchematizer extends Schematizer {
|
|
|
56
57
|
* ValuesSchema.
|
|
57
58
|
*
|
|
58
59
|
* This method extracts basic type information (string, number, boolean),
|
|
59
|
-
* default values, and nullable flags from Yup schemas.
|
|
60
|
+
* string enums, default values, and nullable flags from Yup schemas.
|
|
60
61
|
* @param schemas - A mapping of value IDs to Yup schemas.
|
|
61
62
|
* @returns A TinyBase ValuesSchema.
|
|
62
63
|
* @example
|
|
@@ -19,8 +19,9 @@ export interface ZodSchematizer extends Schematizer {
|
|
|
19
19
|
* TinyBase TablesSchema.
|
|
20
20
|
*
|
|
21
21
|
* This method extracts basic type information (string, number, boolean),
|
|
22
|
-
* default values, and nullable flags from Zod schemas. Complex
|
|
23
|
-
* rules like min/max, regex patterns, refinements, and transforms
|
|
22
|
+
* string enums, default values, and nullable flags from Zod schemas. Complex
|
|
23
|
+
* validation rules like min/max, regex patterns, refinements, and transforms
|
|
24
|
+
* are ignored.
|
|
24
25
|
* @param schemas - A mapping of table IDs to Zod object schemas.
|
|
25
26
|
* @returns A TinyBase TablesSchema.
|
|
26
27
|
* @example
|
|
@@ -35,7 +36,7 @@ export interface ZodSchematizer extends Schematizer {
|
|
|
35
36
|
*
|
|
36
37
|
* const tablesSchema = schematizer.toTablesSchema({
|
|
37
38
|
* pets: z.object({
|
|
38
|
-
* species: z.
|
|
39
|
+
* species: z.enum(['dog', 'cat']),
|
|
39
40
|
* age: z.number(),
|
|
40
41
|
* sold: z.boolean().default(false),
|
|
41
42
|
* }),
|
|
@@ -55,8 +56,8 @@ export interface ZodSchematizer extends Schematizer {
|
|
|
55
56
|
* The toValuesSchema method converts a mapping of Zod schemas into a TinyBase
|
|
56
57
|
* ValuesSchema.
|
|
57
58
|
*
|
|
58
|
-
* This method extracts basic type information and default
|
|
59
|
-
* schemas.
|
|
59
|
+
* This method extracts basic type information, string enums, and default
|
|
60
|
+
* values from Zod schemas.
|
|
60
61
|
* @param schemas - A mapping of value IDs to Zod schemas.
|
|
61
62
|
* @returns A TinyBase ValuesSchema.
|
|
62
63
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="array",s="type",u="default",c="value",i="optional",a="required",
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="array",s="type",u="default",c="value",i="optional",a="required",f="unit",l=e=>(t,r,n)=>e(t)?n?.():r(t),y=e=>null==e,p=e=>void 0===e,d=e=>null===e,j=l(y),v=l(p),h=r=>e(r)==t,m=e=>Array.isArray(e),b=e=>e.length,k=(e,t)=>e.every(t),g=(e,t)=>e.forEach(t),q=Object,A=e=>q.getPrototypeOf(e),E=q.entries,O=q.keys,S=q.freeze,w=(e=[])=>q.fromEntries(e),x=(e,t)=>g(E(e),([e,r])=>t(r,e)),z=e=>(e=>!y(e)&&j(A(e),e=>e==q.prototype||y(A(e)),()=>!0))(e)&&0==(e=>b(O(e)))(e),N=(e,n,u)=>{const c=e?.json??e;if(m(c)){const e=!k(c,e=>!d(e?.[f])&&!d(e));if(2===b(c)&&(a=c[0]?.[f],!1===a)&&(e=>!0===e)(c[1]?.[f]))return[{[s]:r},n,u??!1];if(k(c,e=>h(e?.[f]??e)))return[{[s]:t},n,u??!1];if(e){const e=(i=e=>!d(e?.[f])&&!d(e)&&"="!==e,c.find(i));if(e)return N(e,n,!0)}}var i,a;return m(c)||p(c?.sequence)?!m(c)&&h(c?.[f])?[{[s]:t},n,u??!1]:[{[s]:c?.domain||c},n,u??!1]:[{[s]:o},n,u??!1]},P=e=>{const t=w(),r=e?.json??e;return r?.[a]&&g(r[a],e=>{t[e.key]=e[c]}),r?.[i]&&g(r[i],e=>{const r=e[c],n=e[u];t[e.key]=p(n)?r:{[c]:r,[u]:n}}),z(t)?void 0:t},T=(e,t,r)=>{if(m(e)&&3===b(e)&&"="===e[1]){const t=e[0]?.json??e[0];return N(t,e[2],r)}return e?.[c]&&!p(e?.[u])?N(e[c],e[u],r):N(e,t,r)},V=()=>((e,c)=>{const i=c=>{const[i,a,f]=e(c),l=i?.type;if(l!==t&&l!==n&&l!==r&&"object"!==l&&l!==o)return;const y={[s]:l};return v(a,e=>{y[u]=e}),f&&(y.allowNull=!0),y};return S({toTablesSchema:e=>{const t=w();return x(e,(e,r)=>{const n=w();v(c(e),e=>x(e,(e,t)=>v(i(e),e=>{n[t]=e}))),z(n)||(t[r]=n)}),t},toValuesSchema:e=>{const t=w();return x(e,(e,r)=>v(i(e),e=>{t[r]=e})),t}})})(T,P);export{V as createArkTypeSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="array",s="type",u="default",c="value",i="optional",a="required",
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="array",s="type",u="default",c="value",i="optional",a="required",f="unit",l=e=>(t,r,n)=>e(t)?n?.():r(t),y=e=>null==e,p=e=>void 0===e,d=e=>null===e,j=l(y),v=l(p),h=r=>e(r)==t,m=e=>Array.isArray(e),b=e=>e.length,k=(e,t)=>e.every(t),g=(e,t)=>e.forEach(t),q=Object,A=e=>q.getPrototypeOf(e),E=q.entries,O=q.keys,S=q.freeze,w=(e=[])=>q.fromEntries(e),x=(e,t)=>g(E(e),([e,r])=>t(r,e)),z=e=>(e=>!y(e)&&j(A(e),e=>e==q.prototype||y(A(e)),()=>!0))(e)&&0==(e=>b(O(e)))(e),N=(e,n,u)=>{const c=e?.json??e;if(m(c)){const e=!k(c,e=>!d(e?.[f])&&!d(e));if(2===b(c)&&(a=c[0]?.[f],!1===a)&&(e=>!0===e)(c[1]?.[f]))return[{[s]:r},n,u??!1];if(k(c,e=>h(e?.[f]??e)))return[{[s]:t},n,u??!1];if(e){const e=(i=e=>!d(e?.[f])&&!d(e)&&"="!==e,c.find(i));if(e)return N(e,n,!0)}}var i,a;return m(c)||p(c?.sequence)?!m(c)&&h(c?.[f])?[{[s]:t},n,u??!1]:[{[s]:c?.domain||c},n,u??!1]:[{[s]:o},n,u??!1]},P=e=>{const t=w(),r=e?.json??e;return r?.[a]&&g(r[a],e=>{t[e.key]=e[c]}),r?.[i]&&g(r[i],e=>{const r=e[c],n=e[u];t[e.key]=p(n)?r:{[c]:r,[u]:n}}),z(t)?void 0:t},T=(e,t,r)=>{if(m(e)&&3===b(e)&&"="===e[1]){const t=e[0]?.json??e[0];return N(t,e[2],r)}return e?.[c]&&!p(e?.[u])?N(e[c],e[u],r):N(e,t,r)},V=()=>((e,c)=>{const i=c=>{const[i,a,f]=e(c),l=i?.type;if(l!==t&&l!==n&&l!==r&&"object"!==l&&l!==o)return;const y={[s]:l};return v(a,e=>{y[u]=e}),f&&(y.allowNull=!0),y};return S({toTablesSchema:e=>{const t=w();return x(e,(e,r)=>{const n=w();v(c(e),e=>x(e,(e,t)=>v(i(e),e=>{n[t]=e}))),z(n)||(t[r]=n)}),t},toValuesSchema:e=>{const t=w();return x(e,(e,r)=>v(i(e),e=>{t[r]=e})),t}})})(T,P);export{V as createArkTypeSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=t=>typeof t,e=t(""),r=t(!0),o=t(0),n="object",a="array",
|
|
1
|
+
const t=t=>typeof t,e=t(""),r=t(!0),o=t(0),n="object",a="array",l="type",s="Literal",c="TypeLiteral",u=t=>(e,r,o)=>t(e)?o?.():r(e),i=t=>null==t,y=t=>null===t,p=u(i),f=u(t=>void 0===t),g=(t,e)=>t.find(e),d=Object,h=t=>d.getPrototypeOf(t),m=d.entries,_=d.keys,b=d.freeze,w=(t=[])=>d.fromEntries(t),S=(t,e)=>((t,e)=>t.forEach(e))(m(t),([t,r])=>e(r,t)),T=(t,e,r)=>{const o=t.ast||t;if("Union"===o._tag){const t=o.types,n=g(t,t=>!(t._tag===s&&y(t.literal)));return[{[l]:E(n)},e,r||!!g(t,t=>t._tag===s&&y(t.literal))]}return[{[l]:E(o)},e,r||!1]},E=t=>{const l=t?._tag,u=typeof t?.literal;return l===s?u===e||u===o||u===r?u:"":"StringKeyword"===l?e:"NumberKeyword"===l?o:"BooleanKeyword"===l?r:"TupleType"===l?a:l===c?n:""},K=t=>{const e=t.ast;if(e._tag===c){const t=e.propertySignatures;if(t){const e={};return t.forEach(t=>{e[t.name]=t.type}),e}}},j=()=>((t,s)=>{const c=s=>{const[c,u,i]=t(s),y=c?.type;if(y!==e&&y!==o&&y!==r&&y!==n&&y!==a)return;const p={[l]:y};return f(u,t=>{p.default=t}),i&&(p.allowNull=!0),p};return b({toTablesSchema:t=>{const e=w();return S(t,(t,r)=>{const o=w();var n;f(s(t),t=>S(t,(t,e)=>f(c(t),t=>{o[e]=t}))),(t=>!i(t)&&p(h(t),t=>t==d.prototype||i(h(t)),()=>!0))(n=o)&&0==(t=>_(t).length)(n)||(e[r]=o)}),e},toValuesSchema:t=>{const e=w();return S(t,(t,r)=>f(c(t),t=>{e[r]=t})),e}})})(T,K);export{j as createEffectSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=t=>typeof t,e=t(""),r=t(!0),o=t(0),n="object",a="array",
|
|
1
|
+
const t=t=>typeof t,e=t(""),r=t(!0),o=t(0),n="object",a="array",l="type",s="Literal",c="TypeLiteral",u=t=>(e,r,o)=>t(e)?o?.():r(e),i=t=>null==t,y=t=>null===t,p=u(i),f=u(t=>void 0===t),g=(t,e)=>t.find(e),d=Object,h=t=>d.getPrototypeOf(t),m=d.entries,_=d.keys,b=d.freeze,w=(t=[])=>d.fromEntries(t),S=(t,e)=>((t,e)=>t.forEach(e))(m(t),([t,r])=>e(r,t)),T=(t,e,r)=>{const o=t.ast||t;if("Union"===o._tag){const t=o.types,n=g(t,t=>!(t._tag===s&&y(t.literal)));return[{[l]:E(n)},e,r||!!g(t,t=>t._tag===s&&y(t.literal))]}return[{[l]:E(o)},e,r||!1]},E=t=>{const l=t?._tag,u=typeof t?.literal;return l===s?u===e||u===o||u===r?u:"":"StringKeyword"===l?e:"NumberKeyword"===l?o:"BooleanKeyword"===l?r:"TupleType"===l?a:l===c?n:""},K=t=>{const e=t.ast;if(e._tag===c){const t=e.propertySignatures;if(t){const e={};return t.forEach(t=>{e[t.name]=t.type}),e}}},j=()=>((t,s)=>{const c=s=>{const[c,u,i]=t(s),y=c?.type;if(y!==e&&y!==o&&y!==r&&y!==n&&y!==a)return;const p={[l]:y};return f(u,t=>{p.default=t}),i&&(p.allowNull=!0),p};return b({toTablesSchema:t=>{const e=w();return S(t,(t,r)=>{const o=w();var n;f(s(t),t=>S(t,(t,e)=>f(c(t),t=>{o[e]=t}))),(t=>!i(t)&&p(h(t),t=>t==d.prototype||i(h(t)),()=>!0))(n=o)&&0==(t=>_(t).length)(n)||(e[r]=o)}),e},toValuesSchema:t=>{const e=w();return S(t,(t,r)=>f(c(t),t=>{e[r]=t})),e}})})(T,K);export{j as createEffectSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="type",s="default",c="null",l="anyOf",p=e=>(t,r,o)=>e(t)?o?.():r(t),y=e=>null==e,a=p(y),u=p(e=>void 0===e),f=Object,i=e=>f.getPrototypeOf(e),h=f.entries,m=f.keys,v=f.freeze,b=(e=[])=>f.fromEntries(e),O=(e,t)=>((e,t)=>e.forEach(t))(h(e),([e,r])=>t(r,e)),d=(e,t,r)=>{if(e?.[l]){const n=e[l],p=n.some(e=>e?.type===c),y=(o=e=>e?.type!==c,n.filter(o)),a=y[0];if(a&&y.every(e=>e?.type===a.type))return d(a,t??e?.[s],p||r)}var o;return[e,t??e?.[s],r??!1]},g=e=>e?.properties,j=()=>((e,c)=>{const l=c=>{const[l,p,y]=e(c),a=l?.type;if(a!==t&&a!==o&&a!==r&&"object"!==a&&"array"!==a)return;const f={[n]:a};return u(p,e=>{f[s]=e}),y&&(f.allowNull=!0),f};return v({toTablesSchema:e=>{const t=b();return O(e,(e,r)=>{const o=b();var n;u(c(e),e=>O(e,(e,t)=>u(l(e),e=>{o[t]=e}))),(e=>!y(e)&&a(i(e),e=>e==f.prototype||y(i(e)),()=>!0))(n=o)&&0==(e=>m(e).length)(n)||(t[r]=o)}),t},toValuesSchema:e=>{const t=b();return O(e,(e,r)=>u(l(e),e=>{t[r]=e})),t}})})(d,g);export{j as createTypeBoxSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="type",s="default",c="null",l="anyOf",p=e=>(t,r,o)=>e(t)?o?.():r(t),y=e=>null==e,a=p(y),u=p(e=>void 0===e),f=Object,i=e=>f.getPrototypeOf(e),h=f.entries,m=f.keys,v=f.freeze,b=(e=[])=>f.fromEntries(e),O=(e,t)=>((e,t)=>e.forEach(t))(h(e),([e,r])=>t(r,e)),d=(e,t,r)=>{if(e?.[l]){const n=e[l],p=n.some(e=>e?.type===c),y=(o=e=>e?.type!==c,n.filter(o)),a=y[0];if(a&&y.every(e=>e?.type===a.type))return d(a,t??e?.[s],p||r)}var o;return[e,t??e?.[s],r??!1]},g=e=>e?.properties,j=()=>((e,c)=>{const l=c=>{const[l,p,y]=e(c),a=l?.type;if(a!==t&&a!==o&&a!==r&&"object"!==a&&"array"!==a)return;const f={[n]:a};return u(p,e=>{f[s]=e}),y&&(f.allowNull=!0),f};return v({toTablesSchema:e=>{const t=b();return O(e,(e,r)=>{const o=b();var n;u(c(e),e=>O(e,(e,t)=>u(l(e),e=>{o[t]=e}))),(e=>!y(e)&&a(i(e),e=>e==f.prototype||y(i(e)),()=>!0))(n=o)&&0==(e=>m(e).length)(n)||(t[r]=o)}),t},toValuesSchema:e=>{const t=b();return O(e,(e,r)=>u(l(e),e=>{t[r]=e})),t}})})(d,g);export{j as createTypeBoxSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="object",l="type",a="fallback",c="wrapped",s=e=>(t,r,o)=>e(t)?o?.():r(t),p=e=>null==e,
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="object",l="type",a="fallback",c="wrapped",s=e=>(t,r,o)=>e(t)?o?.():r(t),p=e=>null==e,i=s(p),u=s(e=>void 0===e),y=r=>e(r)==t,f=Object,b=e=>f.getPrototypeOf(e),d=f.entries,h=f.keys,v=f.freeze,k=(e=[])=>f.fromEntries(e),m=(e,t)=>((e,t)=>e.forEach(t))(d(e),([e,r])=>t(r,e)),g=(e,r,o)=>{const s=e?.type;return"optional"===s?g(e[c],r,o):"nullable"===s?g(e[c],r,!0):"record"===s?[{type:n},r??e?.[a],o??!1]:"picklist"===s&&(p=e.options,i=y,p.every(i))?[{[l]:t},r??e?.[a],o??!1]:"literal"===s&&y(e.literal)?[{[l]:t},r??e?.[a],o??!1]:[e,r??e?.[a],o??!1];var p,i},j=e=>e?.entries,w=()=>((e,a)=>{const c=a=>{const[c,s,p]=e(a),i=c?.type;if(i!==t&&i!==o&&i!==r&&i!==n&&"array"!==i)return;const y={[l]:i};return u(s,e=>{y.default=e}),p&&(y.allowNull=!0),y};return v({toTablesSchema:e=>{const t=k();return m(e,(e,r)=>{const o=k();var n;u(a(e),e=>m(e,(e,t)=>u(c(e),e=>{o[t]=e}))),(e=>!p(e)&&i(b(e),e=>e==f.prototype||p(b(e)),()=>!0))(n=o)&&0==(e=>h(e).length)(n)||(t[r]=o)}),t},toValuesSchema:e=>{const t=k();return m(e,(e,r)=>u(c(e),e=>{t[r]=e})),t}})})(g,j);export{w as createValibotSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="object",l="type",a="fallback",c="wrapped",s=e=>(t,r,o)=>e(t)?o?.():r(t),p=e=>null==e,
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="object",l="type",a="fallback",c="wrapped",s=e=>(t,r,o)=>e(t)?o?.():r(t),p=e=>null==e,i=s(p),u=s(e=>void 0===e),y=r=>e(r)==t,f=Object,b=e=>f.getPrototypeOf(e),d=f.entries,h=f.keys,v=f.freeze,k=(e=[])=>f.fromEntries(e),m=(e,t)=>((e,t)=>e.forEach(t))(d(e),([e,r])=>t(r,e)),g=(e,r,o)=>{const s=e?.type;return"optional"===s?g(e[c],r,o):"nullable"===s?g(e[c],r,!0):"record"===s?[{type:n},r??e?.[a],o??!1]:"picklist"===s&&(p=e.options,i=y,p.every(i))?[{[l]:t},r??e?.[a],o??!1]:"literal"===s&&y(e.literal)?[{[l]:t},r??e?.[a],o??!1]:[e,r??e?.[a],o??!1];var p,i},j=e=>e?.entries,w=()=>((e,a)=>{const c=a=>{const[c,s,p]=e(a),i=c?.type;if(i!==t&&i!==o&&i!==r&&i!==n&&"array"!==i)return;const y={[l]:i};return u(s,e=>{y.default=e}),p&&(y.allowNull=!0),y};return v({toTablesSchema:e=>{const t=k();return m(e,(e,r)=>{const o=k();var n;u(a(e),e=>m(e,(e,t)=>u(c(e),e=>{o[t]=e}))),(e=>!p(e)&&i(b(e),e=>e==f.prototype||p(b(e)),()=>!0))(n=o)&&0==(e=>h(e).length)(n)||(t[r]=o)}),t},toValuesSchema:e=>{const t=k();return m(e,(e,r)=>u(c(e),e=>{t[r]=e})),t}})})(g,j);export{w as createValibotSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="type",s="default",
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="type",s="default",l=e=>(t,r,o)=>e(t)?o?.():r(t),c=e=>null==e,a=l(c),p=l(e=>void 0===e),u=r=>e(r)==t,y=e=>e.length,i=Object,f=e=>i.getPrototypeOf(e),h=i.entries,m=i.keys,b=i.freeze,d=(e=[])=>i.fromEntries(e),v=(e,t)=>((e,t)=>e.forEach(t))(h(e),([e,r])=>t(r,e)),w=(e,r,o)=>{const l=e?._whitelist?Array.from(e._whitelist):[];return[{[n]:"mixed"===e?.type&&y(l)>0&&(c=l,a=u,c.every(a))?t:e?.type},r??e?.spec?.[s],o||e?.spec?.nullable||!1];var c,a},g=e=>e?.fields,j=()=>((e,l)=>{const u=l=>{const[c,a,u]=e(l),y=c?.type;if(y!==t&&y!==o&&y!==r&&"object"!==y&&"array"!==y)return;const i={[n]:y};return p(a,e=>{i[s]=e}),u&&(i.allowNull=!0),i};return b({toTablesSchema:e=>{const t=d();return v(e,(e,r)=>{const o=d();var n;p(l(e),e=>v(e,(e,t)=>p(u(e),e=>{o[t]=e}))),(e=>!c(e)&&a(f(e),e=>e==i.prototype||c(f(e)),()=>!0))(n=o)&&0==(e=>y(m(e)))(n)||(t[r]=o)}),t},toValuesSchema:e=>{const t=d();return v(e,(e,r)=>p(u(e),e=>{t[r]=e})),t}})})(w,g);export{j as createYupSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="type",s="default",
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),o=e(0),n="type",s="default",l=e=>(t,r,o)=>e(t)?o?.():r(t),c=e=>null==e,a=l(c),p=l(e=>void 0===e),u=r=>e(r)==t,y=e=>e.length,i=Object,f=e=>i.getPrototypeOf(e),h=i.entries,m=i.keys,b=i.freeze,d=(e=[])=>i.fromEntries(e),v=(e,t)=>((e,t)=>e.forEach(t))(h(e),([e,r])=>t(r,e)),w=(e,r,o)=>{const l=e?._whitelist?Array.from(e._whitelist):[];return[{[n]:"mixed"===e?.type&&y(l)>0&&(c=l,a=u,c.every(a))?t:e?.type},r??e?.spec?.[s],o||e?.spec?.nullable||!1];var c,a},g=e=>e?.fields,j=()=>((e,l)=>{const u=l=>{const[c,a,u]=e(l),y=c?.type;if(y!==t&&y!==o&&y!==r&&"object"!==y&&"array"!==y)return;const i={[n]:y};return p(a,e=>{i[s]=e}),u&&(i.allowNull=!0),i};return b({toTablesSchema:e=>{const t=d();return v(e,(e,r)=>{const o=d();var n;p(l(e),e=>v(e,(e,t)=>p(u(e),e=>{o[t]=e}))),(e=>!c(e)&&a(f(e),e=>e==i.prototype||c(f(e)),()=>!0))(n=o)&&0==(e=>y(m(e)))(n)||(t[r]=o)}),t},toValuesSchema:e=>{const t=d();return v(e,(e,r)=>p(u(e),e=>{t[r]=e})),t}})})(w,g);export{j as createYupSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="object",l="type",a="default",
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="object",l="type",a="default",s=e=>(t,r,n)=>e(t)?n?.():r(t),u=e=>null==e,c=s(u),p=s(e=>void 0===e),y=r=>e(r)==t,f=Object,i=e=>f.getPrototypeOf(e),d=f.entries,h=f.keys,v=f.freeze,b=(e=[])=>f.fromEntries(e),m=(e,t)=>((e,t)=>e.forEach(t))(d(e),([e,r])=>t(r,e)),T=e=>e?.def??e?._zod?.def,g=(e,r,n)=>{const s=T(e),u=s?.type;return"optional"===u?g(s.innerType,r,n):"nullable"===u?g(s.innerType,r,!0):u===a?g(s.innerType,s.defaultValue,n):"record"===u?[{type:o},r,n??!1]:"enum"===u?[{[l]:t},r,n??!1]:"literal"===u&&(c=s.values,p=y,c.every(p))?[{[l]:t},r,n??!1]:[e,r,n??!1];var c,p},j=e=>T(e)?.shape,z=()=>((e,s)=>{const y=s=>{const[u,c,y]=e(s),f=u?.type;if(f!==t&&f!==n&&f!==r&&f!==o&&"array"!==f)return;const i={[l]:f};return p(c,e=>{i[a]=e}),y&&(i.allowNull=!0),i};return v({toTablesSchema:e=>{const t=b();return m(e,(e,r)=>{const n=b();var o;p(s(e),e=>m(e,(e,t)=>p(y(e),e=>{n[t]=e}))),(e=>!u(e)&&c(i(e),e=>e==f.prototype||u(i(e)),()=>!0))(o=n)&&0==(e=>h(e).length)(o)||(t[r]=n)}),t},toValuesSchema:e=>{const t=b();return m(e,(e,r)=>p(y(e),e=>{t[r]=e})),t}})})(g,j);export{z as createZodSchematizer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="object",l="type",a="default",
|
|
1
|
+
const e=e=>typeof e,t=e(""),r=e(!0),n=e(0),o="object",l="type",a="default",s=e=>(t,r,n)=>e(t)?n?.():r(t),u=e=>null==e,c=s(u),p=s(e=>void 0===e),y=r=>e(r)==t,f=Object,i=e=>f.getPrototypeOf(e),d=f.entries,h=f.keys,v=f.freeze,b=(e=[])=>f.fromEntries(e),m=(e,t)=>((e,t)=>e.forEach(t))(d(e),([e,r])=>t(r,e)),T=e=>e?.def??e?._zod?.def,g=(e,r,n)=>{const s=T(e),u=s?.type;return"optional"===u?g(s.innerType,r,n):"nullable"===u?g(s.innerType,r,!0):u===a?g(s.innerType,s.defaultValue,n):"record"===u?[{type:o},r,n??!1]:"enum"===u?[{[l]:t},r,n??!1]:"literal"===u&&(c=s.values,p=y,c.every(p))?[{[l]:t},r,n??!1]:[e,r,n??!1];var c,p},j=e=>T(e)?.shape,z=()=>((e,s)=>{const y=s=>{const[u,c,y]=e(s),f=u?.type;if(f!==t&&f!==n&&f!==r&&f!==o&&"array"!==f)return;const i={[l]:f};return p(c,e=>{i[a]=e}),y&&(i.allowNull=!0),i};return v({toTablesSchema:e=>{const t=b();return m(e,(e,r)=>{const n=b();var o;p(s(e),e=>m(e,(e,t)=>p(y(e),e=>{n[t]=e}))),(e=>!u(e)&&c(i(e),e=>e==f.prototype||u(i(e)),()=>!0))(o=n)&&0==(e=>h(e).length)(o)||(t[r]=n)}),t},toValuesSchema:e=>{const t=b();return m(e,(e,r)=>p(y(e),e=>{t[r]=e})),t}})})(g,j);export{z as createZodSchematizer};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "8.3.0-beta.
|
|
3
|
+
"version": "8.3.0-beta.3",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"partykit": "^0.0.115",
|
|
39
39
|
"partysocket": "^1.1.18",
|
|
40
40
|
"postgres": "^3.4.9",
|
|
41
|
-
"react": "^19.2.
|
|
42
|
-
"react-dom": "^19.2.
|
|
41
|
+
"react": "^19.2.6",
|
|
42
|
+
"react-dom": "^19.2.6",
|
|
43
43
|
"react-native-mmkv": "4.3.1",
|
|
44
44
|
"react-native-sqlite-storage": "^6.0.1",
|
|
45
45
|
"solid-js": "^1.9.12",
|