effect 3.11.9 → 3.11.10
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/cjs/FiberHandle.js +1 -5
- package/dist/cjs/FiberHandle.js.map +1 -1
- package/dist/cjs/FiberMap.js +1 -5
- package/dist/cjs/FiberMap.js.map +1 -1
- package/dist/cjs/FiberSet.js +2 -2
- package/dist/cjs/FiberSet.js.map +1 -1
- package/dist/cjs/JSONSchema.js +3 -30
- package/dist/cjs/JSONSchema.js.map +1 -1
- package/dist/cjs/Micro.js +1 -1
- package/dist/cjs/ParseResult.js +15 -2
- package/dist/cjs/ParseResult.js.map +1 -1
- package/dist/cjs/Schema.js +276 -191
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/SchemaAST.js +55 -17
- package/dist/cjs/SchemaAST.js.map +1 -1
- package/dist/cjs/Stream.js +6 -5
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/internal/core-effect.js +1 -1
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/core.js +4 -5
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/doNotation.js.map +1 -1
- package/dist/cjs/internal/fiberRuntime.js +1 -1
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/mailbox.js.map +1 -1
- package/dist/cjs/internal/redacted.js +1 -1
- package/dist/cjs/internal/redacted.js.map +1 -1
- package/dist/cjs/internal/runtime.js +1 -1
- package/dist/cjs/internal/runtime.js.map +1 -1
- package/dist/cjs/internal/schema/errors.js +10 -10
- package/dist/cjs/internal/schema/errors.js.map +1 -1
- package/dist/cjs/internal/schema/util.js +2 -2
- package/dist/cjs/internal/schema/util.js.map +1 -1
- package/dist/cjs/internal/stm/core.js +2 -3
- package/dist/cjs/internal/stm/core.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/FiberHandle.d.ts +2 -2
- package/dist/dts/FiberHandle.d.ts.map +1 -1
- package/dist/dts/FiberMap.d.ts +2 -2
- package/dist/dts/FiberMap.d.ts.map +1 -1
- package/dist/dts/FiberSet.d.ts +3 -6
- package/dist/dts/FiberSet.d.ts.map +1 -1
- package/dist/dts/ParseResult.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +17 -7
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/SchemaAST.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +6 -5
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/internal/core-effect.d.ts.map +1 -1
- package/dist/dts/internal/core.d.ts.map +1 -1
- package/dist/dts/internal/fiberRuntime.d.ts.map +1 -1
- package/dist/esm/FiberHandle.js +1 -4
- package/dist/esm/FiberHandle.js.map +1 -1
- package/dist/esm/FiberMap.js +1 -4
- package/dist/esm/FiberMap.js.map +1 -1
- package/dist/esm/FiberSet.js +2 -2
- package/dist/esm/FiberSet.js.map +1 -1
- package/dist/esm/JSONSchema.js +3 -30
- package/dist/esm/JSONSchema.js.map +1 -1
- package/dist/esm/Micro.js +1 -1
- package/dist/esm/Micro.js.map +1 -1
- package/dist/esm/ParseResult.js +12 -1
- package/dist/esm/ParseResult.js.map +1 -1
- package/dist/esm/Schema.js +271 -186
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/SchemaAST.js +53 -16
- package/dist/esm/SchemaAST.js.map +1 -1
- package/dist/esm/Stream.js +6 -5
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/internal/core-effect.js +1 -1
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/core.js +1 -2
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/doNotation.js.map +1 -1
- package/dist/esm/internal/fiberRuntime.js +1 -1
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/mailbox.js.map +1 -1
- package/dist/esm/internal/redacted.js +1 -1
- package/dist/esm/internal/redacted.js.map +1 -1
- package/dist/esm/internal/runtime.js +1 -1
- package/dist/esm/internal/runtime.js.map +1 -1
- package/dist/esm/internal/schema/errors.js +5 -5
- package/dist/esm/internal/schema/errors.js.map +1 -1
- package/dist/esm/internal/schema/util.js +2 -2
- package/dist/esm/internal/schema/util.js.map +1 -1
- package/dist/esm/internal/stm/core.js +1 -2
- package/dist/esm/internal/stm/core.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +1 -1
- package/src/FiberHandle.ts +2 -2
- package/src/FiberMap.ts +2 -2
- package/src/FiberSet.ts +3 -3
- package/src/JSONSchema.ts +3 -29
- package/src/Micro.ts +1 -1
- package/src/ParseResult.ts +19 -3
- package/src/Schema.ts +211 -142
- package/src/SchemaAST.ts +65 -18
- package/src/Stream.ts +6 -5
- package/src/internal/core-effect.ts +2 -2
- package/src/internal/core.ts +1 -2
- package/src/internal/doNotation.ts +1 -1
- package/src/internal/fiberRuntime.ts +1 -1
- package/src/internal/mailbox.ts +1 -1
- package/src/internal/pool.ts +1 -1
- package/src/internal/redacted.ts +1 -1
- package/src/internal/runtime.ts +1 -1
- package/src/internal/schema/errors.ts +6 -5
- package/src/internal/schema/util.ts +2 -2
- package/src/internal/stm/core.ts +1 -2
- package/src/internal/version.ts +1 -1
package/dist/esm/Schema.js
CHANGED
|
@@ -921,6 +921,12 @@ const applyDefaultValue = (o, defaultValue) => option_.match(o, {
|
|
|
921
921
|
onNone: () => option_.some(defaultValue()),
|
|
922
922
|
onSome: value => option_.some(value === undefined ? defaultValue() : value)
|
|
923
923
|
});
|
|
924
|
+
const pruneUndefined = ast => AST.pruneUndefined(ast, pruneUndefined, ast => {
|
|
925
|
+
const pruned = pruneUndefined(ast.to);
|
|
926
|
+
if (pruned) {
|
|
927
|
+
return new AST.Transformation(ast.from, pruned, ast.transformation);
|
|
928
|
+
}
|
|
929
|
+
});
|
|
924
930
|
/**
|
|
925
931
|
* Enhances a property signature with a default decoding value.
|
|
926
932
|
*
|
|
@@ -931,9 +937,15 @@ export const withDecodingDefault = /*#__PURE__*/dual(2, (self, defaultValue) =>
|
|
|
931
937
|
const ast = self.ast;
|
|
932
938
|
switch (ast._tag) {
|
|
933
939
|
case "PropertySignatureDeclaration":
|
|
934
|
-
|
|
940
|
+
{
|
|
941
|
+
const to = AST.typeAST(ast.type);
|
|
942
|
+
return makePropertySignature(new PropertySignatureTransformation(new FromPropertySignature(ast.type, ast.isOptional, ast.isReadonly, ast.annotations), new ToPropertySignature(pruneUndefined(to) ?? to, false, true, {}, ast.defaultValue), o => applyDefaultValue(o, defaultValue), identity));
|
|
943
|
+
}
|
|
935
944
|
case "PropertySignatureTransformation":
|
|
936
|
-
|
|
945
|
+
{
|
|
946
|
+
const to = ast.to.type;
|
|
947
|
+
return makePropertySignature(new PropertySignatureTransformation(ast.from, new ToPropertySignature(pruneUndefined(to) ?? to, false, ast.to.isReadonly, ast.to.annotations, ast.to.defaultValue), o => applyDefaultValue(ast.decode(o), defaultValue), ast.encode));
|
|
948
|
+
}
|
|
937
949
|
}
|
|
938
950
|
});
|
|
939
951
|
/**
|
|
@@ -1361,10 +1373,8 @@ export const brand = (brand, annotations) => self => {
|
|
|
1361
1373
|
onSome: brands => [...brands, brand]
|
|
1362
1374
|
});
|
|
1363
1375
|
const ast = AST.annotations(self.ast, toASTAnnotations({
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
...annotations,
|
|
1367
|
-
[AST.BrandAnnotationId]: annotation
|
|
1376
|
+
[AST.BrandAnnotationId]: annotation,
|
|
1377
|
+
...annotations
|
|
1368
1378
|
}));
|
|
1369
1379
|
return makeBrandClass(ast);
|
|
1370
1380
|
};
|
|
@@ -1751,6 +1761,7 @@ export const TrimmedSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Trimmed"
|
|
|
1751
1761
|
*/
|
|
1752
1762
|
export const trimmed = annotations => self => self.pipe(filter(a => a === a.trim(), {
|
|
1753
1763
|
schemaId: TrimmedSchemaId,
|
|
1764
|
+
title: "trimmed",
|
|
1754
1765
|
description: "a string with no leading or trailing whitespace",
|
|
1755
1766
|
jsonSchema: {
|
|
1756
1767
|
pattern: "^\\S[\\s\\S]*\\S$|^\\S$|^$"
|
|
@@ -1768,6 +1779,7 @@ export const MaxLengthSchemaId = schemaId_.MaxLengthSchemaId;
|
|
|
1768
1779
|
*/
|
|
1769
1780
|
export const maxLength = (maxLength, annotations) => self => self.pipe(filter(a => a.length <= maxLength, {
|
|
1770
1781
|
schemaId: MaxLengthSchemaId,
|
|
1782
|
+
title: `maxLength(${maxLength})`,
|
|
1771
1783
|
description: `a string at most ${maxLength} character(s) long`,
|
|
1772
1784
|
jsonSchema: {
|
|
1773
1785
|
maxLength
|
|
@@ -1785,6 +1797,7 @@ export const MinLengthSchemaId = schemaId_.MinLengthSchemaId;
|
|
|
1785
1797
|
*/
|
|
1786
1798
|
export const minLength = (minLength, annotations) => self => self.pipe(filter(a => a.length >= minLength, {
|
|
1787
1799
|
schemaId: MinLengthSchemaId,
|
|
1800
|
+
title: `minLength(${minLength})`,
|
|
1788
1801
|
description: `a string at least ${minLength} character(s) long`,
|
|
1789
1802
|
jsonSchema: {
|
|
1790
1803
|
minLength
|
|
@@ -1801,7 +1814,7 @@ export const PatternSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Pattern"
|
|
|
1801
1814
|
* @since 3.10.0
|
|
1802
1815
|
*/
|
|
1803
1816
|
export const pattern = (regex, annotations) => self => {
|
|
1804
|
-
const
|
|
1817
|
+
const source = regex.source;
|
|
1805
1818
|
return self.pipe(filter(a => {
|
|
1806
1819
|
// The following line ensures that `lastIndex` is reset to `0` in case the user has specified the `g` flag
|
|
1807
1820
|
regex.lastIndex = 0;
|
|
@@ -1811,9 +1824,10 @@ export const pattern = (regex, annotations) => self => {
|
|
|
1811
1824
|
[PatternSchemaId]: {
|
|
1812
1825
|
regex
|
|
1813
1826
|
},
|
|
1814
|
-
|
|
1827
|
+
// title: `pattern(/${source}/)`, // avoiding this because it can be very long
|
|
1828
|
+
description: `a string matching the pattern ${source}`,
|
|
1815
1829
|
jsonSchema: {
|
|
1816
|
-
pattern
|
|
1830
|
+
pattern: source
|
|
1817
1831
|
},
|
|
1818
1832
|
...annotations
|
|
1819
1833
|
}));
|
|
@@ -1827,17 +1841,21 @@ export const StartsWithSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Start
|
|
|
1827
1841
|
* @category string filters
|
|
1828
1842
|
* @since 3.10.0
|
|
1829
1843
|
*/
|
|
1830
|
-
export const startsWith = (startsWith, annotations) => self =>
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
}
|
|
1844
|
+
export const startsWith = (startsWith, annotations) => self => {
|
|
1845
|
+
const formatted = JSON.stringify(startsWith);
|
|
1846
|
+
return self.pipe(filter(a => a.startsWith(startsWith), {
|
|
1847
|
+
schemaId: StartsWithSchemaId,
|
|
1848
|
+
[StartsWithSchemaId]: {
|
|
1849
|
+
startsWith
|
|
1850
|
+
},
|
|
1851
|
+
title: `startsWith(${formatted})`,
|
|
1852
|
+
description: `a string starting with ${formatted}`,
|
|
1853
|
+
jsonSchema: {
|
|
1854
|
+
pattern: `^${startsWith}`
|
|
1855
|
+
},
|
|
1856
|
+
...annotations
|
|
1857
|
+
}));
|
|
1858
|
+
};
|
|
1841
1859
|
/**
|
|
1842
1860
|
* @category schema id
|
|
1843
1861
|
* @since 3.10.0
|
|
@@ -1847,17 +1865,21 @@ export const EndsWithSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/EndsWit
|
|
|
1847
1865
|
* @category string filters
|
|
1848
1866
|
* @since 3.10.0
|
|
1849
1867
|
*/
|
|
1850
|
-
export const endsWith = (endsWith, annotations) => self =>
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
}
|
|
1868
|
+
export const endsWith = (endsWith, annotations) => self => {
|
|
1869
|
+
const formatted = JSON.stringify(endsWith);
|
|
1870
|
+
return self.pipe(filter(a => a.endsWith(endsWith), {
|
|
1871
|
+
schemaId: EndsWithSchemaId,
|
|
1872
|
+
[EndsWithSchemaId]: {
|
|
1873
|
+
endsWith
|
|
1874
|
+
},
|
|
1875
|
+
title: `endsWith(${formatted})`,
|
|
1876
|
+
description: `a string ending with ${formatted}`,
|
|
1877
|
+
jsonSchema: {
|
|
1878
|
+
pattern: `^.*${endsWith}$`
|
|
1879
|
+
},
|
|
1880
|
+
...annotations
|
|
1881
|
+
}));
|
|
1882
|
+
};
|
|
1861
1883
|
/**
|
|
1862
1884
|
* @category schema id
|
|
1863
1885
|
* @since 3.10.0
|
|
@@ -1867,17 +1889,21 @@ export const IncludesSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Include
|
|
|
1867
1889
|
* @category string filters
|
|
1868
1890
|
* @since 3.10.0
|
|
1869
1891
|
*/
|
|
1870
|
-
export const includes = (searchString, annotations) => self =>
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
}
|
|
1892
|
+
export const includes = (searchString, annotations) => self => {
|
|
1893
|
+
const formatted = JSON.stringify(searchString);
|
|
1894
|
+
return self.pipe(filter(a => a.includes(searchString), {
|
|
1895
|
+
schemaId: IncludesSchemaId,
|
|
1896
|
+
[IncludesSchemaId]: {
|
|
1897
|
+
includes: searchString
|
|
1898
|
+
},
|
|
1899
|
+
title: `includes(${formatted})`,
|
|
1900
|
+
description: `a string including ${formatted}`,
|
|
1901
|
+
jsonSchema: {
|
|
1902
|
+
pattern: `.*${searchString}.*`
|
|
1903
|
+
},
|
|
1904
|
+
...annotations
|
|
1905
|
+
}));
|
|
1906
|
+
};
|
|
1881
1907
|
/**
|
|
1882
1908
|
* @category schema id
|
|
1883
1909
|
* @since 3.10.0
|
|
@@ -1891,6 +1917,7 @@ export const LowercasedSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Lower
|
|
|
1891
1917
|
*/
|
|
1892
1918
|
export const lowercased = annotations => self => self.pipe(filter(a => a === a.toLowerCase(), {
|
|
1893
1919
|
schemaId: LowercasedSchemaId,
|
|
1920
|
+
title: "lowercased",
|
|
1894
1921
|
description: "a lowercase string",
|
|
1895
1922
|
jsonSchema: {
|
|
1896
1923
|
pattern: "^[^A-Z]*$"
|
|
@@ -1902,8 +1929,7 @@ export const lowercased = annotations => self => self.pipe(filter(a => a === a.t
|
|
|
1902
1929
|
* @since 3.10.0
|
|
1903
1930
|
*/
|
|
1904
1931
|
export class Lowercased extends /*#__PURE__*/String$.pipe( /*#__PURE__*/lowercased({
|
|
1905
|
-
identifier: "Lowercased"
|
|
1906
|
-
title: "Lowercased"
|
|
1932
|
+
identifier: "Lowercased"
|
|
1907
1933
|
})) {}
|
|
1908
1934
|
/**
|
|
1909
1935
|
* @category schema id
|
|
@@ -1918,6 +1944,7 @@ export const CapitalizedSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Capi
|
|
|
1918
1944
|
*/
|
|
1919
1945
|
export const capitalized = annotations => self => self.pipe(filter(a => a[0]?.toUpperCase() === a[0], {
|
|
1920
1946
|
schemaId: CapitalizedSchemaId,
|
|
1947
|
+
title: "capitalized",
|
|
1921
1948
|
description: "a capitalized string",
|
|
1922
1949
|
jsonSchema: {
|
|
1923
1950
|
pattern: "^[^a-z]?.*$"
|
|
@@ -1929,8 +1956,7 @@ export const capitalized = annotations => self => self.pipe(filter(a => a[0]?.to
|
|
|
1929
1956
|
* @since 3.10.0
|
|
1930
1957
|
*/
|
|
1931
1958
|
export class Capitalized extends /*#__PURE__*/String$.pipe( /*#__PURE__*/capitalized({
|
|
1932
|
-
identifier: "Capitalized"
|
|
1933
|
-
title: "Capitalized"
|
|
1959
|
+
identifier: "Capitalized"
|
|
1934
1960
|
})) {}
|
|
1935
1961
|
/**
|
|
1936
1962
|
* @category schema id
|
|
@@ -1945,6 +1971,7 @@ export const UncapitalizedSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Un
|
|
|
1945
1971
|
*/
|
|
1946
1972
|
export const uncapitalized = annotations => self => self.pipe(filter(a => a[0]?.toLowerCase() === a[0], {
|
|
1947
1973
|
schemaId: UncapitalizedSchemaId,
|
|
1974
|
+
title: "uncapitalized",
|
|
1948
1975
|
description: "a uncapitalized string",
|
|
1949
1976
|
jsonSchema: {
|
|
1950
1977
|
pattern: "^[^A-Z]?.*$"
|
|
@@ -1956,8 +1983,7 @@ export const uncapitalized = annotations => self => self.pipe(filter(a => a[0]?.
|
|
|
1956
1983
|
* @since 3.10.0
|
|
1957
1984
|
*/
|
|
1958
1985
|
export class Uncapitalized extends /*#__PURE__*/String$.pipe( /*#__PURE__*/uncapitalized({
|
|
1959
|
-
identifier: "Uncapitalized"
|
|
1960
|
-
title: "Uncapitalized"
|
|
1986
|
+
identifier: "Uncapitalized"
|
|
1961
1987
|
})) {}
|
|
1962
1988
|
/**
|
|
1963
1989
|
* @category schema id
|
|
@@ -1972,6 +1998,7 @@ export const UppercasedSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Upper
|
|
|
1972
1998
|
*/
|
|
1973
1999
|
export const uppercased = annotations => self => self.pipe(filter(a => a === a.toUpperCase(), {
|
|
1974
2000
|
schemaId: UppercasedSchemaId,
|
|
2001
|
+
title: "uppercased",
|
|
1975
2002
|
description: "an uppercase string",
|
|
1976
2003
|
jsonSchema: {
|
|
1977
2004
|
pattern: "^[^a-z]*$"
|
|
@@ -1983,8 +2010,7 @@ export const uppercased = annotations => self => self.pipe(filter(a => a === a.t
|
|
|
1983
2010
|
* @since 3.10.0
|
|
1984
2011
|
*/
|
|
1985
2012
|
export class Uppercased extends /*#__PURE__*/String$.pipe( /*#__PURE__*/uppercased({
|
|
1986
|
-
identifier: "Uppercased"
|
|
1987
|
-
title: "Uppercased"
|
|
2013
|
+
identifier: "Uppercased"
|
|
1988
2014
|
})) {}
|
|
1989
2015
|
/**
|
|
1990
2016
|
* @category schema id
|
|
@@ -2001,6 +2027,7 @@ export const length = (length, annotations) => self => {
|
|
|
2001
2027
|
if (minLength !== maxLength) {
|
|
2002
2028
|
return self.pipe(filter(a => a.length >= minLength && a.length <= maxLength, {
|
|
2003
2029
|
schemaId: LengthSchemaId,
|
|
2030
|
+
title: `length({ min: ${minLength}, max: ${maxLength})`,
|
|
2004
2031
|
description: `a string at least ${minLength} character(s) and at most ${maxLength} character(s) long`,
|
|
2005
2032
|
jsonSchema: {
|
|
2006
2033
|
minLength,
|
|
@@ -2011,6 +2038,7 @@ export const length = (length, annotations) => self => {
|
|
|
2011
2038
|
}
|
|
2012
2039
|
return self.pipe(filter(a => a.length === minLength, {
|
|
2013
2040
|
schemaId: LengthSchemaId,
|
|
2041
|
+
title: `length(${minLength})`,
|
|
2014
2042
|
description: minLength === 1 ? `a single character` : `a string ${minLength} character(s) long`,
|
|
2015
2043
|
jsonSchema: {
|
|
2016
2044
|
minLength,
|
|
@@ -2033,6 +2061,7 @@ export class Char extends /*#__PURE__*/String$.pipe( /*#__PURE__*/length(1, {
|
|
|
2033
2061
|
* @since 3.10.0
|
|
2034
2062
|
*/
|
|
2035
2063
|
export const nonEmptyString = annotations => minLength(1, {
|
|
2064
|
+
title: "nonEmptyString",
|
|
2036
2065
|
description: "a non empty string",
|
|
2037
2066
|
...annotations
|
|
2038
2067
|
});
|
|
@@ -2101,8 +2130,7 @@ export class Uncapitalize extends /*#__PURE__*/transform(String$.annotations({
|
|
|
2101
2130
|
* @since 3.10.0
|
|
2102
2131
|
*/
|
|
2103
2132
|
export class Trimmed extends /*#__PURE__*/String$.pipe( /*#__PURE__*/trimmed({
|
|
2104
|
-
identifier: "Trimmed"
|
|
2105
|
-
title: "Trimmed"
|
|
2133
|
+
identifier: "Trimmed"
|
|
2106
2134
|
})) {}
|
|
2107
2135
|
/**
|
|
2108
2136
|
* Useful for validating strings that must contain meaningful characters without
|
|
@@ -2121,8 +2149,7 @@ export class Trimmed extends /*#__PURE__*/String$.pipe( /*#__PURE__*/trimmed({
|
|
|
2121
2149
|
* @since 3.10.0
|
|
2122
2150
|
*/
|
|
2123
2151
|
export class NonEmptyTrimmedString extends /*#__PURE__*/Trimmed.pipe( /*#__PURE__*/nonEmptyString({
|
|
2124
|
-
identifier: "NonEmptyTrimmedString"
|
|
2125
|
-
title: "NonEmptyTrimmedString"
|
|
2152
|
+
identifier: "NonEmptyTrimmedString"
|
|
2126
2153
|
})) {}
|
|
2127
2154
|
/**
|
|
2128
2155
|
* This schema allows removing whitespaces from the beginning and end of a string.
|
|
@@ -2195,8 +2222,7 @@ export const parseJson = (schemaOrOptions, o) => isSchema(schemaOrOptions) ? com
|
|
|
2195
2222
|
* @since 3.10.0
|
|
2196
2223
|
*/
|
|
2197
2224
|
export class NonEmptyString extends /*#__PURE__*/String$.pipe( /*#__PURE__*/nonEmptyString({
|
|
2198
|
-
identifier: "NonEmptyString"
|
|
2199
|
-
title: "NonEmptyString"
|
|
2225
|
+
identifier: "NonEmptyString"
|
|
2200
2226
|
})) {}
|
|
2201
2227
|
/**
|
|
2202
2228
|
* @category schema id
|
|
@@ -2215,7 +2241,6 @@ const uuidRegexp = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}
|
|
|
2215
2241
|
export class UUID extends /*#__PURE__*/String$.pipe( /*#__PURE__*/pattern(uuidRegexp, {
|
|
2216
2242
|
schemaId: UUIDSchemaId,
|
|
2217
2243
|
identifier: "UUID",
|
|
2218
|
-
title: "UUID",
|
|
2219
2244
|
jsonSchema: {
|
|
2220
2245
|
format: "uuid",
|
|
2221
2246
|
pattern: uuidRegexp.source
|
|
@@ -2241,7 +2266,6 @@ const ulidRegexp = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/i;
|
|
|
2241
2266
|
export class ULID extends /*#__PURE__*/String$.pipe( /*#__PURE__*/pattern(ulidRegexp, {
|
|
2242
2267
|
schemaId: ULIDSchemaId,
|
|
2243
2268
|
identifier: "ULID",
|
|
2244
|
-
title: "ULID",
|
|
2245
2269
|
description: "a Universally Unique Lexicographically Sortable Identifier",
|
|
2246
2270
|
arbitrary: () => fc => fc.ulid()
|
|
2247
2271
|
})) {}
|
|
@@ -2253,7 +2277,6 @@ export class ULID extends /*#__PURE__*/String$.pipe( /*#__PURE__*/pattern(ulidRe
|
|
|
2253
2277
|
*/
|
|
2254
2278
|
export class URLFromSelf extends /*#__PURE__*/instanceOf(URL, {
|
|
2255
2279
|
identifier: "URLFromSelf",
|
|
2256
|
-
title: "URLFromSelf",
|
|
2257
2280
|
arbitrary: () => fc => fc.webUrl().map(s => new URL(s)),
|
|
2258
2281
|
pretty: () => url => url.toString()
|
|
2259
2282
|
}) {}
|
|
@@ -2269,7 +2292,6 @@ class URL$ extends /*#__PURE__*/transformOrFail(String$.annotations({
|
|
|
2269
2292
|
encode: url => ParseResult.succeed(url.toString())
|
|
2270
2293
|
}).annotations({
|
|
2271
2294
|
identifier: "URL",
|
|
2272
|
-
title: "URL",
|
|
2273
2295
|
pretty: () => url => url.toString()
|
|
2274
2296
|
}) {}
|
|
2275
2297
|
export {
|
|
@@ -2287,15 +2309,14 @@ URL$ as URL };
|
|
|
2287
2309
|
*/
|
|
2288
2310
|
export const FiniteSchemaId = schemaId_.FiniteSchemaId;
|
|
2289
2311
|
/**
|
|
2290
|
-
* Ensures that the provided value is a finite number.
|
|
2291
|
-
*
|
|
2292
|
-
* This schema filters out non-finite numeric values, allowing only finite numbers to pass through.
|
|
2312
|
+
* Ensures that the provided value is a finite number (excluding NaN, +Infinity, and -Infinity).
|
|
2293
2313
|
*
|
|
2294
2314
|
* @category number filters
|
|
2295
2315
|
* @since 3.10.0
|
|
2296
2316
|
*/
|
|
2297
2317
|
export const finite = annotations => self => self.pipe(filter(Number.isFinite, {
|
|
2298
2318
|
schemaId: FiniteSchemaId,
|
|
2319
|
+
title: "finite",
|
|
2299
2320
|
description: "a finite number",
|
|
2300
2321
|
jsonSchema: {
|
|
2301
2322
|
"type": "number"
|
|
@@ -2315,6 +2336,7 @@ export const GreaterThanSchemaId = schemaId_.GreaterThanSchemaId;
|
|
|
2315
2336
|
*/
|
|
2316
2337
|
export const greaterThan = (exclusiveMinimum, annotations) => self => self.pipe(filter(a => a > exclusiveMinimum, {
|
|
2317
2338
|
schemaId: GreaterThanSchemaId,
|
|
2339
|
+
title: `greaterThan(${exclusiveMinimum})`,
|
|
2318
2340
|
description: exclusiveMinimum === 0 ? "a positive number" : `a number greater than ${exclusiveMinimum}`,
|
|
2319
2341
|
jsonSchema: {
|
|
2320
2342
|
exclusiveMinimum
|
|
@@ -2334,6 +2356,7 @@ export const GreaterThanOrEqualToSchemaId = schemaId_.GreaterThanOrEqualToSchema
|
|
|
2334
2356
|
*/
|
|
2335
2357
|
export const greaterThanOrEqualTo = (minimum, annotations) => self => self.pipe(filter(a => a >= minimum, {
|
|
2336
2358
|
schemaId: GreaterThanOrEqualToSchemaId,
|
|
2359
|
+
title: `greaterThanOrEqualTo(${minimum})`,
|
|
2337
2360
|
description: minimum === 0 ? "a non-negative number" : `a number greater than or equal to ${minimum}`,
|
|
2338
2361
|
jsonSchema: {
|
|
2339
2362
|
minimum
|
|
@@ -2349,27 +2372,32 @@ export const MultipleOfSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Multi
|
|
|
2349
2372
|
* @category number filters
|
|
2350
2373
|
* @since 3.10.0
|
|
2351
2374
|
*/
|
|
2352
|
-
export const multipleOf = (divisor, annotations) => self =>
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
}
|
|
2375
|
+
export const multipleOf = (divisor, annotations) => self => {
|
|
2376
|
+
const positiveDivisor = Math.abs(divisor); // spec requires positive divisor
|
|
2377
|
+
return self.pipe(filter(a => number_.remainder(a, divisor) === 0, {
|
|
2378
|
+
schemaId: MultipleOfSchemaId,
|
|
2379
|
+
title: `multipleOf(${positiveDivisor})`,
|
|
2380
|
+
description: `a number divisible by ${positiveDivisor}`,
|
|
2381
|
+
jsonSchema: {
|
|
2382
|
+
multipleOf: positiveDivisor
|
|
2383
|
+
},
|
|
2384
|
+
...annotations
|
|
2385
|
+
}));
|
|
2386
|
+
};
|
|
2361
2387
|
/**
|
|
2362
2388
|
* @category schema id
|
|
2363
2389
|
* @since 3.10.0
|
|
2364
2390
|
*/
|
|
2365
2391
|
export const IntSchemaId = schemaId_.IntSchemaId;
|
|
2366
2392
|
/**
|
|
2393
|
+
* Ensures that the provided value is an integer number (excluding NaN, +Infinity, and -Infinity).
|
|
2394
|
+
*
|
|
2367
2395
|
* @category number filters
|
|
2368
2396
|
* @since 3.10.0
|
|
2369
2397
|
*/
|
|
2370
2398
|
export const int = annotations => self => self.pipe(filter(a => Number.isSafeInteger(a), {
|
|
2371
2399
|
schemaId: IntSchemaId,
|
|
2372
|
-
title: "
|
|
2400
|
+
title: "int",
|
|
2373
2401
|
description: "an integer",
|
|
2374
2402
|
jsonSchema: {
|
|
2375
2403
|
type: "integer"
|
|
@@ -2389,6 +2417,7 @@ export const LessThanSchemaId = schemaId_.LessThanSchemaId;
|
|
|
2389
2417
|
*/
|
|
2390
2418
|
export const lessThan = (exclusiveMaximum, annotations) => self => self.pipe(filter(a => a < exclusiveMaximum, {
|
|
2391
2419
|
schemaId: LessThanSchemaId,
|
|
2420
|
+
title: `lessThan(${exclusiveMaximum})`,
|
|
2392
2421
|
description: exclusiveMaximum === 0 ? "a negative number" : `a number less than ${exclusiveMaximum}`,
|
|
2393
2422
|
jsonSchema: {
|
|
2394
2423
|
exclusiveMaximum
|
|
@@ -2408,6 +2437,7 @@ export const LessThanOrEqualToSchemaId = schemaId_.LessThanOrEqualToSchemaId;
|
|
|
2408
2437
|
*/
|
|
2409
2438
|
export const lessThanOrEqualTo = (maximum, annotations) => self => self.pipe(filter(a => a <= maximum, {
|
|
2410
2439
|
schemaId: LessThanOrEqualToSchemaId,
|
|
2440
|
+
title: `lessThanOrEqualTo(${maximum})`,
|
|
2411
2441
|
description: maximum === 0 ? "a non-positive number" : `a number less than or equal to ${maximum}`,
|
|
2412
2442
|
jsonSchema: {
|
|
2413
2443
|
maximum
|
|
@@ -2427,6 +2457,7 @@ export const BetweenSchemaId = schemaId_.BetweenSchemaId;
|
|
|
2427
2457
|
*/
|
|
2428
2458
|
export const between = (minimum, maximum, annotations) => self => self.pipe(filter(a => a >= minimum && a <= maximum, {
|
|
2429
2459
|
schemaId: BetweenSchemaId,
|
|
2460
|
+
title: `between(${minimum}, ${maximum})`,
|
|
2430
2461
|
description: `a number between ${minimum} and ${maximum}`,
|
|
2431
2462
|
jsonSchema: {
|
|
2432
2463
|
minimum,
|
|
@@ -2445,6 +2476,7 @@ export const NonNaNSchemaId = schemaId_.NonNaNSchemaId;
|
|
|
2445
2476
|
*/
|
|
2446
2477
|
export const nonNaN = annotations => self => self.pipe(filter(a => !Number.isNaN(a), {
|
|
2447
2478
|
schemaId: NonNaNSchemaId,
|
|
2479
|
+
title: "nonNaN",
|
|
2448
2480
|
description: "a number excluding NaN",
|
|
2449
2481
|
...annotations
|
|
2450
2482
|
}));
|
|
@@ -2452,22 +2484,34 @@ export const nonNaN = annotations => self => self.pipe(filter(a => !Number.isNaN
|
|
|
2452
2484
|
* @category number filters
|
|
2453
2485
|
* @since 3.10.0
|
|
2454
2486
|
*/
|
|
2455
|
-
export const positive = annotations => greaterThan(0,
|
|
2487
|
+
export const positive = annotations => greaterThan(0, {
|
|
2488
|
+
title: "positive",
|
|
2489
|
+
...annotations
|
|
2490
|
+
});
|
|
2456
2491
|
/**
|
|
2457
2492
|
* @category number filters
|
|
2458
2493
|
* @since 3.10.0
|
|
2459
2494
|
*/
|
|
2460
|
-
export const negative = annotations => lessThan(0,
|
|
2495
|
+
export const negative = annotations => lessThan(0, {
|
|
2496
|
+
title: "negative",
|
|
2497
|
+
...annotations
|
|
2498
|
+
});
|
|
2461
2499
|
/**
|
|
2462
2500
|
* @category number filters
|
|
2463
2501
|
* @since 3.10.0
|
|
2464
2502
|
*/
|
|
2465
|
-
export const nonPositive = annotations => lessThanOrEqualTo(0,
|
|
2503
|
+
export const nonPositive = annotations => lessThanOrEqualTo(0, {
|
|
2504
|
+
title: "nonPositive",
|
|
2505
|
+
...annotations
|
|
2506
|
+
});
|
|
2466
2507
|
/**
|
|
2467
2508
|
* @category number filters
|
|
2468
2509
|
* @since 3.10.0
|
|
2469
2510
|
*/
|
|
2470
|
-
export const nonNegative = annotations => greaterThanOrEqualTo(0,
|
|
2511
|
+
export const nonNegative = annotations => greaterThanOrEqualTo(0, {
|
|
2512
|
+
title: "nonNegative",
|
|
2513
|
+
...annotations
|
|
2514
|
+
});
|
|
2471
2515
|
/**
|
|
2472
2516
|
* Clamps a number between a minimum and a maximum value.
|
|
2473
2517
|
*
|
|
@@ -2517,56 +2561,49 @@ export class NumberFromString extends /*#__PURE__*/parseNumber(String$.annotatio
|
|
|
2517
2561
|
* @since 3.10.0
|
|
2518
2562
|
*/
|
|
2519
2563
|
export class Finite extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/finite({
|
|
2520
|
-
identifier: "Finite"
|
|
2521
|
-
title: "Finite"
|
|
2564
|
+
identifier: "Finite"
|
|
2522
2565
|
})) {}
|
|
2523
2566
|
/**
|
|
2524
2567
|
* @category number constructors
|
|
2525
2568
|
* @since 3.10.0
|
|
2526
2569
|
*/
|
|
2527
2570
|
export class Int extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/int({
|
|
2528
|
-
identifier: "Int"
|
|
2529
|
-
title: "Int"
|
|
2571
|
+
identifier: "Int"
|
|
2530
2572
|
})) {}
|
|
2531
2573
|
/**
|
|
2532
2574
|
* @category number constructors
|
|
2533
2575
|
* @since 3.10.0
|
|
2534
2576
|
*/
|
|
2535
2577
|
export class NonNaN extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/nonNaN({
|
|
2536
|
-
identifier: "NonNaN"
|
|
2537
|
-
title: "NonNaN"
|
|
2578
|
+
identifier: "NonNaN"
|
|
2538
2579
|
})) {}
|
|
2539
2580
|
/**
|
|
2540
2581
|
* @category number constructors
|
|
2541
2582
|
* @since 3.10.0
|
|
2542
2583
|
*/
|
|
2543
2584
|
export class Positive extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/positive({
|
|
2544
|
-
identifier: "Positive"
|
|
2545
|
-
title: "Positive"
|
|
2585
|
+
identifier: "Positive"
|
|
2546
2586
|
})) {}
|
|
2547
2587
|
/**
|
|
2548
2588
|
* @category number constructors
|
|
2549
2589
|
* @since 3.10.0
|
|
2550
2590
|
*/
|
|
2551
2591
|
export class Negative extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/negative({
|
|
2552
|
-
identifier: "Negative"
|
|
2553
|
-
title: "Negative"
|
|
2592
|
+
identifier: "Negative"
|
|
2554
2593
|
})) {}
|
|
2555
2594
|
/**
|
|
2556
2595
|
* @category number constructors
|
|
2557
2596
|
* @since 3.10.0
|
|
2558
2597
|
*/
|
|
2559
2598
|
export class NonPositive extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/nonPositive({
|
|
2560
|
-
identifier: "NonPositive"
|
|
2561
|
-
title: "NonPositive"
|
|
2599
|
+
identifier: "NonPositive"
|
|
2562
2600
|
})) {}
|
|
2563
2601
|
/**
|
|
2564
2602
|
* @category number constructors
|
|
2565
2603
|
* @since 3.10.0
|
|
2566
2604
|
*/
|
|
2567
2605
|
export class NonNegative extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/nonNegative({
|
|
2568
|
-
identifier: "NonNegative"
|
|
2569
|
-
title: "NonNegative"
|
|
2606
|
+
identifier: "NonNegative"
|
|
2570
2607
|
})) {}
|
|
2571
2608
|
/**
|
|
2572
2609
|
* @category schema id
|
|
@@ -2595,9 +2632,7 @@ export const JsonNumberSchemaId = schemaId_.JsonNumberSchemaId;
|
|
|
2595
2632
|
*/
|
|
2596
2633
|
export class JsonNumber extends /*#__PURE__*/Number$.pipe( /*#__PURE__*/finite({
|
|
2597
2634
|
schemaId: JsonNumberSchemaId,
|
|
2598
|
-
identifier: "JsonNumber"
|
|
2599
|
-
title: "JSON-compatible number",
|
|
2600
|
-
description: "a JSON-compatible number, excluding NaN, +Infinity, and -Infinity"
|
|
2635
|
+
identifier: "JsonNumber"
|
|
2601
2636
|
})) {}
|
|
2602
2637
|
/**
|
|
2603
2638
|
* @category boolean transformations
|
|
@@ -2642,6 +2677,7 @@ export const greaterThanBigInt = (min, annotations) => self => self.pipe(filter(
|
|
|
2642
2677
|
[GreaterThanBigIntSchemaId]: {
|
|
2643
2678
|
min
|
|
2644
2679
|
},
|
|
2680
|
+
title: `greaterThanBigInt(${min})`,
|
|
2645
2681
|
description: min === 0n ? "a positive bigint" : `a bigint greater than ${min}n`,
|
|
2646
2682
|
...annotations
|
|
2647
2683
|
}));
|
|
@@ -2659,6 +2695,7 @@ export const greaterThanOrEqualToBigInt = (min, annotations) => self => self.pip
|
|
|
2659
2695
|
[GreaterThanOrEqualToBigIntSchemaId]: {
|
|
2660
2696
|
min
|
|
2661
2697
|
},
|
|
2698
|
+
title: `greaterThanOrEqualToBigInt(${min})`,
|
|
2662
2699
|
description: min === 0n ? "a non-negative bigint" : `a bigint greater than or equal to ${min}n`,
|
|
2663
2700
|
...annotations
|
|
2664
2701
|
}));
|
|
@@ -2676,6 +2713,7 @@ export const lessThanBigInt = (max, annotations) => self => self.pipe(filter(a =
|
|
|
2676
2713
|
[LessThanBigIntSchemaId]: {
|
|
2677
2714
|
max
|
|
2678
2715
|
},
|
|
2716
|
+
title: `lessThanBigInt(${max})`,
|
|
2679
2717
|
description: max === 0n ? "a negative bigint" : `a bigint less than ${max}n`,
|
|
2680
2718
|
...annotations
|
|
2681
2719
|
}));
|
|
@@ -2693,6 +2731,7 @@ export const lessThanOrEqualToBigInt = (max, annotations) => self => self.pipe(f
|
|
|
2693
2731
|
[LessThanOrEqualToBigIntSchemaId]: {
|
|
2694
2732
|
max
|
|
2695
2733
|
},
|
|
2734
|
+
title: `lessThanOrEqualToBigInt(${max})`,
|
|
2696
2735
|
description: max === 0n ? "a non-positive bigint" : `a bigint less than or equal to ${max}n`,
|
|
2697
2736
|
...annotations
|
|
2698
2737
|
}));
|
|
@@ -2711,6 +2750,7 @@ export const betweenBigInt = (min, max, annotations) => self => self.pipe(filter
|
|
|
2711
2750
|
min,
|
|
2712
2751
|
max
|
|
2713
2752
|
},
|
|
2753
|
+
title: `betweenBigInt(${min}, ${max})`,
|
|
2714
2754
|
description: `a bigint between ${min}n and ${max}n`,
|
|
2715
2755
|
...annotations
|
|
2716
2756
|
}));
|
|
@@ -2718,22 +2758,34 @@ export const betweenBigInt = (min, max, annotations) => self => self.pipe(filter
|
|
|
2718
2758
|
* @category bigint filters
|
|
2719
2759
|
* @since 3.10.0
|
|
2720
2760
|
*/
|
|
2721
|
-
export const positiveBigInt = annotations => greaterThanBigInt(0n,
|
|
2761
|
+
export const positiveBigInt = annotations => greaterThanBigInt(0n, {
|
|
2762
|
+
title: "positiveBigInt",
|
|
2763
|
+
...annotations
|
|
2764
|
+
});
|
|
2722
2765
|
/**
|
|
2723
2766
|
* @category bigint filters
|
|
2724
2767
|
* @since 3.10.0
|
|
2725
2768
|
*/
|
|
2726
|
-
export const negativeBigInt = annotations => lessThanBigInt(0n,
|
|
2769
|
+
export const negativeBigInt = annotations => lessThanBigInt(0n, {
|
|
2770
|
+
title: "negativeBigInt",
|
|
2771
|
+
...annotations
|
|
2772
|
+
});
|
|
2727
2773
|
/**
|
|
2728
2774
|
* @category bigint filters
|
|
2729
2775
|
* @since 3.10.0
|
|
2730
2776
|
*/
|
|
2731
|
-
export const nonNegativeBigInt = annotations => greaterThanOrEqualToBigInt(0n,
|
|
2777
|
+
export const nonNegativeBigInt = annotations => greaterThanOrEqualToBigInt(0n, {
|
|
2778
|
+
title: "nonNegativeBigInt",
|
|
2779
|
+
...annotations
|
|
2780
|
+
});
|
|
2732
2781
|
/**
|
|
2733
2782
|
* @category bigint filters
|
|
2734
2783
|
* @since 3.10.0
|
|
2735
2784
|
*/
|
|
2736
|
-
export const nonPositiveBigInt = annotations => lessThanOrEqualToBigInt(0n,
|
|
2785
|
+
export const nonPositiveBigInt = annotations => lessThanOrEqualToBigInt(0n, {
|
|
2786
|
+
title: "nonPositiveBigInt",
|
|
2787
|
+
...annotations
|
|
2788
|
+
});
|
|
2737
2789
|
/**
|
|
2738
2790
|
* Clamps a bigint between a minimum and a maximum value.
|
|
2739
2791
|
*
|
|
@@ -2773,64 +2825,56 @@ BigInt$ as BigInt };
|
|
|
2773
2825
|
* @since 3.10.0
|
|
2774
2826
|
*/
|
|
2775
2827
|
export const PositiveBigIntFromSelf = /*#__PURE__*/BigIntFromSelf.pipe( /*#__PURE__*/positiveBigInt({
|
|
2776
|
-
identifier: "PositiveBigintFromSelf"
|
|
2777
|
-
title: "PositiveBigintFromSelf"
|
|
2828
|
+
identifier: "PositiveBigintFromSelf"
|
|
2778
2829
|
}));
|
|
2779
2830
|
/**
|
|
2780
2831
|
* @category bigint constructors
|
|
2781
2832
|
* @since 3.10.0
|
|
2782
2833
|
*/
|
|
2783
2834
|
export const PositiveBigInt = /*#__PURE__*/BigInt$.pipe( /*#__PURE__*/positiveBigInt({
|
|
2784
|
-
identifier: "PositiveBigint"
|
|
2785
|
-
title: "PositiveBigint"
|
|
2835
|
+
identifier: "PositiveBigint"
|
|
2786
2836
|
}));
|
|
2787
2837
|
/**
|
|
2788
2838
|
* @category bigint constructors
|
|
2789
2839
|
* @since 3.10.0
|
|
2790
2840
|
*/
|
|
2791
2841
|
export const NegativeBigIntFromSelf = /*#__PURE__*/BigIntFromSelf.pipe( /*#__PURE__*/negativeBigInt({
|
|
2792
|
-
identifier: "NegativeBigintFromSelf"
|
|
2793
|
-
title: "NegativeBigintFromSelf"
|
|
2842
|
+
identifier: "NegativeBigintFromSelf"
|
|
2794
2843
|
}));
|
|
2795
2844
|
/**
|
|
2796
2845
|
* @category bigint constructors
|
|
2797
2846
|
* @since 3.10.0
|
|
2798
2847
|
*/
|
|
2799
2848
|
export const NegativeBigInt = /*#__PURE__*/BigInt$.pipe( /*#__PURE__*/negativeBigInt({
|
|
2800
|
-
identifier: "NegativeBigint"
|
|
2801
|
-
title: "NegativeBigint"
|
|
2849
|
+
identifier: "NegativeBigint"
|
|
2802
2850
|
}));
|
|
2803
2851
|
/**
|
|
2804
2852
|
* @category bigint constructors
|
|
2805
2853
|
* @since 3.10.0
|
|
2806
2854
|
*/
|
|
2807
2855
|
export const NonPositiveBigIntFromSelf = /*#__PURE__*/BigIntFromSelf.pipe( /*#__PURE__*/nonPositiveBigInt({
|
|
2808
|
-
identifier: "NonPositiveBigintFromSelf"
|
|
2809
|
-
title: "NonPositiveBigintFromSelf"
|
|
2856
|
+
identifier: "NonPositiveBigintFromSelf"
|
|
2810
2857
|
}));
|
|
2811
2858
|
/**
|
|
2812
2859
|
* @category bigint constructors
|
|
2813
2860
|
* @since 3.10.0
|
|
2814
2861
|
*/
|
|
2815
2862
|
export const NonPositiveBigInt = /*#__PURE__*/BigInt$.pipe( /*#__PURE__*/nonPositiveBigInt({
|
|
2816
|
-
identifier: "NonPositiveBigint"
|
|
2817
|
-
title: "NonPositiveBigint"
|
|
2863
|
+
identifier: "NonPositiveBigint"
|
|
2818
2864
|
}));
|
|
2819
2865
|
/**
|
|
2820
2866
|
* @category bigint constructors
|
|
2821
2867
|
* @since 3.10.0
|
|
2822
2868
|
*/
|
|
2823
2869
|
export const NonNegativeBigIntFromSelf = /*#__PURE__*/BigIntFromSelf.pipe( /*#__PURE__*/nonNegativeBigInt({
|
|
2824
|
-
identifier: "NonNegativeBigintFromSelf"
|
|
2825
|
-
title: "NonNegativeBigintFromSelf"
|
|
2870
|
+
identifier: "NonNegativeBigintFromSelf"
|
|
2826
2871
|
}));
|
|
2827
2872
|
/**
|
|
2828
2873
|
* @category bigint constructors
|
|
2829
2874
|
* @since 3.10.0
|
|
2830
2875
|
*/
|
|
2831
2876
|
export const NonNegativeBigInt = /*#__PURE__*/BigInt$.pipe( /*#__PURE__*/nonNegativeBigInt({
|
|
2832
|
-
identifier: "NonNegativeBigint"
|
|
2833
|
-
title: "NonNegativeBigint"
|
|
2877
|
+
identifier: "NonNegativeBigint"
|
|
2834
2878
|
}));
|
|
2835
2879
|
/**
|
|
2836
2880
|
* This schema transforms a `number` into a `bigint` by parsing the number using the `BigInt` function.
|
|
@@ -2926,20 +2970,27 @@ export class DurationFromMillis extends /*#__PURE__*/transform(Number$.annotatio
|
|
|
2926
2970
|
}).annotations({
|
|
2927
2971
|
identifier: "DurationFromMillis"
|
|
2928
2972
|
}) {}
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
})
|
|
2973
|
+
/**
|
|
2974
|
+
* @category number constructors
|
|
2975
|
+
* @since 3.11.10
|
|
2976
|
+
*/
|
|
2977
|
+
export const NonNegativeInt = /*#__PURE__*/NonNegative.pipe(int()).annotations({
|
|
2978
|
+
identifier: "NonNegativeInt"
|
|
2979
|
+
});
|
|
2980
|
+
const HRTime = /*#__PURE__*/Tuple(element(NonNegativeInt).annotations({
|
|
2981
|
+
title: "seconds"
|
|
2982
|
+
}), element(NonNegativeInt).annotations({
|
|
2983
|
+
title: "nanos"
|
|
2984
|
+
})).annotations({
|
|
2985
|
+
identifier: "HRTime"
|
|
2986
|
+
});
|
|
2936
2987
|
/**
|
|
2937
2988
|
* A schema that transforms a `[number, number]` tuple into a `Duration`.
|
|
2938
2989
|
*
|
|
2939
2990
|
* @category Duration transformations
|
|
2940
2991
|
* @since 3.10.0
|
|
2941
2992
|
*/
|
|
2942
|
-
export class Duration extends /*#__PURE__*/transform(
|
|
2993
|
+
export class Duration extends /*#__PURE__*/transform(HRTime.annotations({
|
|
2943
2994
|
description: "a tuple of seconds and nanos that will be parsed into a Duration"
|
|
2944
2995
|
}), DurationFromSelf, {
|
|
2945
2996
|
strict: true,
|
|
@@ -2976,6 +3027,7 @@ export const lessThanDuration = (max, annotations) => self => self.pipe(filter(a
|
|
|
2976
3027
|
[LessThanDurationSchemaId]: {
|
|
2977
3028
|
max
|
|
2978
3029
|
},
|
|
3030
|
+
title: `lessThanDuration(${max})`,
|
|
2979
3031
|
description: `a Duration less than ${duration_.decode(max)}`,
|
|
2980
3032
|
...annotations
|
|
2981
3033
|
}));
|
|
@@ -2993,6 +3045,7 @@ export const lessThanOrEqualToDuration = (max, annotations) => self => self.pipe
|
|
|
2993
3045
|
[LessThanDurationSchemaId]: {
|
|
2994
3046
|
max
|
|
2995
3047
|
},
|
|
3048
|
+
title: `lessThanOrEqualToDuration(${max})`,
|
|
2996
3049
|
description: `a Duration less than or equal to ${duration_.decode(max)}`,
|
|
2997
3050
|
...annotations
|
|
2998
3051
|
}));
|
|
@@ -3010,6 +3063,7 @@ export const greaterThanDuration = (min, annotations) => self => self.pipe(filte
|
|
|
3010
3063
|
[GreaterThanDurationSchemaId]: {
|
|
3011
3064
|
min
|
|
3012
3065
|
},
|
|
3066
|
+
title: `greaterThanDuration(${min})`,
|
|
3013
3067
|
description: `a Duration greater than ${duration_.decode(min)}`,
|
|
3014
3068
|
...annotations
|
|
3015
3069
|
}));
|
|
@@ -3027,6 +3081,7 @@ export const greaterThanOrEqualToDuration = (min, annotations) => self => self.p
|
|
|
3027
3081
|
[GreaterThanOrEqualToDurationSchemaId]: {
|
|
3028
3082
|
min
|
|
3029
3083
|
},
|
|
3084
|
+
title: `greaterThanOrEqualToDuration(${min})`,
|
|
3030
3085
|
description: `a Duration greater than or equal to ${duration_.decode(min)}`,
|
|
3031
3086
|
...annotations
|
|
3032
3087
|
}));
|
|
@@ -3048,6 +3103,7 @@ export const betweenDuration = (minimum, maximum, annotations) => self => self.p
|
|
|
3048
3103
|
maximum,
|
|
3049
3104
|
minimum
|
|
3050
3105
|
},
|
|
3106
|
+
title: `betweenDuration(${minimum}, ${maximum})`,
|
|
3051
3107
|
description: `a Duration between ${duration_.decode(minimum)} and ${duration_.decode(maximum)}`,
|
|
3052
3108
|
...annotations
|
|
3053
3109
|
}));
|
|
@@ -3061,10 +3117,15 @@ export const Uint8ArrayFromSelf = /*#__PURE__*/declare(Predicate.isUint8Array, {
|
|
|
3061
3117
|
arbitrary: () => fc => fc.uint8Array(),
|
|
3062
3118
|
equivalence: () => array_.getEquivalence(Equal.equals)
|
|
3063
3119
|
});
|
|
3064
|
-
|
|
3065
|
-
|
|
3120
|
+
/**
|
|
3121
|
+
* @category number constructors
|
|
3122
|
+
* @since 3.11.10
|
|
3123
|
+
*/
|
|
3124
|
+
export const Uint8 = /*#__PURE__*/Number$.pipe( /*#__PURE__*/between(0, 255, {
|
|
3125
|
+
identifier: "Uint8",
|
|
3066
3126
|
description: "a 8-bit unsigned integer"
|
|
3067
|
-
}))
|
|
3127
|
+
}));
|
|
3128
|
+
const Uint8Array$ = /*#__PURE__*/transform(Array$(Uint8).annotations({
|
|
3068
3129
|
description: "an array of 8-bit unsigned integers that will be parsed into a Uint8Array"
|
|
3069
3130
|
}), Uint8ArrayFromSelf, {
|
|
3070
3131
|
strict: true,
|
|
@@ -3157,6 +3218,7 @@ export const minItems = (n, annotations) => self => {
|
|
|
3157
3218
|
}
|
|
3158
3219
|
return self.pipe(filter(a => a.length >= minItems, {
|
|
3159
3220
|
schemaId: MinItemsSchemaId,
|
|
3221
|
+
title: `minItems(${minItems})`,
|
|
3160
3222
|
description: `an array of at least ${minItems} item(s)`,
|
|
3161
3223
|
jsonSchema: {
|
|
3162
3224
|
minItems
|
|
@@ -3176,6 +3238,7 @@ export const MaxItemsSchemaId = schemaId_.MaxItemsSchemaId;
|
|
|
3176
3238
|
*/
|
|
3177
3239
|
export const maxItems = (n, annotations) => self => self.pipe(filter(a => a.length <= n, {
|
|
3178
3240
|
schemaId: MaxItemsSchemaId,
|
|
3241
|
+
title: `maxItems(${n})`,
|
|
3179
3242
|
description: `an array of at most ${n} item(s)`,
|
|
3180
3243
|
jsonSchema: {
|
|
3181
3244
|
maxItems: n
|
|
@@ -3194,6 +3257,7 @@ export const ItemsCountSchemaId = schemaId_.ItemsCountSchemaId;
|
|
|
3194
3257
|
*/
|
|
3195
3258
|
export const itemsCount = (n, annotations) => self => self.pipe(filter(a => a.length === n, {
|
|
3196
3259
|
schemaId: ItemsCountSchemaId,
|
|
3260
|
+
title: `itemsCount(${n})`,
|
|
3197
3261
|
description: `an array of exactly ${n} item(s)`,
|
|
3198
3262
|
jsonSchema: {
|
|
3199
3263
|
minItems: n,
|
|
@@ -3253,6 +3317,7 @@ export const validDate = annotations => self => self.pipe(filter(a => !Number.is
|
|
|
3253
3317
|
[ValidDateSchemaId]: {
|
|
3254
3318
|
noInvalidDate: true
|
|
3255
3319
|
},
|
|
3320
|
+
title: "validDate",
|
|
3256
3321
|
description: "a valid Date",
|
|
3257
3322
|
...annotations
|
|
3258
3323
|
}));
|
|
@@ -3270,6 +3335,7 @@ export const lessThanDate = (max, annotations) => self => self.pipe(filter(a =>
|
|
|
3270
3335
|
[LessThanDateSchemaId]: {
|
|
3271
3336
|
max
|
|
3272
3337
|
},
|
|
3338
|
+
title: `lessThanDate(${util_.formatDate(max)})`,
|
|
3273
3339
|
description: `a date before ${util_.formatDate(max)}`,
|
|
3274
3340
|
...annotations
|
|
3275
3341
|
}));
|
|
@@ -3287,6 +3353,7 @@ export const lessThanOrEqualToDate = (max, annotations) => self => self.pipe(fil
|
|
|
3287
3353
|
[LessThanDateSchemaId]: {
|
|
3288
3354
|
max
|
|
3289
3355
|
},
|
|
3356
|
+
title: `lessThanOrEqualToDate(${util_.formatDate(max)})`,
|
|
3290
3357
|
description: `a date before or equal to ${util_.formatDate(max)}`,
|
|
3291
3358
|
...annotations
|
|
3292
3359
|
}));
|
|
@@ -3304,6 +3371,7 @@ export const greaterThanDate = (min, annotations) => self => self.pipe(filter(a
|
|
|
3304
3371
|
[GreaterThanDateSchemaId]: {
|
|
3305
3372
|
min
|
|
3306
3373
|
},
|
|
3374
|
+
title: `greaterThanDate(${util_.formatDate(min)})`,
|
|
3307
3375
|
description: `a date after ${util_.formatDate(min)}`,
|
|
3308
3376
|
...annotations
|
|
3309
3377
|
}));
|
|
@@ -3321,6 +3389,7 @@ export const greaterThanOrEqualToDate = (min, annotations) => self => self.pipe(
|
|
|
3321
3389
|
[GreaterThanOrEqualToDateSchemaId]: {
|
|
3322
3390
|
min
|
|
3323
3391
|
},
|
|
3392
|
+
title: `greaterThanOrEqualToDate(${util_.formatDate(min)})`,
|
|
3324
3393
|
description: `a date after or equal to ${util_.formatDate(min)}`,
|
|
3325
3394
|
...annotations
|
|
3326
3395
|
}));
|
|
@@ -3339,6 +3408,7 @@ export const betweenDate = (min, max, annotations) => self => self.pipe(filter(a
|
|
|
3339
3408
|
max,
|
|
3340
3409
|
min
|
|
3341
3410
|
},
|
|
3411
|
+
title: `betweenDate(${util_.formatDate(min)}, ${util_.formatDate(max)})`,
|
|
3342
3412
|
description: `a date between ${util_.formatDate(min)} and ${util_.formatDate(max)}`,
|
|
3343
3413
|
...annotations
|
|
3344
3414
|
}));
|
|
@@ -4061,7 +4131,7 @@ export class BigDecimalFromNumber extends /*#__PURE__*/transformOrFail(Number$.a
|
|
|
4061
4131
|
description: "a number that will be parsed into a BigDecimal"
|
|
4062
4132
|
}), BigDecimalFromSelf, {
|
|
4063
4133
|
strict: true,
|
|
4064
|
-
decode: num => ParseResult.succeed(bigDecimal_.
|
|
4134
|
+
decode: num => ParseResult.succeed(bigDecimal_.unsafeFromNumber(num)),
|
|
4065
4135
|
encode: val => ParseResult.succeed(bigDecimal_.unsafeToNumber(val))
|
|
4066
4136
|
}).annotations({
|
|
4067
4137
|
identifier: "BigDecimalFromNumber"
|
|
@@ -4075,14 +4145,18 @@ export const GreaterThanBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/Sch
|
|
|
4075
4145
|
* @category BigDecimal filters
|
|
4076
4146
|
* @since 3.10.0
|
|
4077
4147
|
*/
|
|
4078
|
-
export const greaterThanBigDecimal = (min, annotations) => self =>
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
})
|
|
4148
|
+
export const greaterThanBigDecimal = (min, annotations) => self => {
|
|
4149
|
+
const formatted = bigDecimal_.format(min);
|
|
4150
|
+
return self.pipe(filter(a => bigDecimal_.greaterThan(a, min), {
|
|
4151
|
+
schemaId: GreaterThanBigDecimalSchemaId,
|
|
4152
|
+
[GreaterThanBigDecimalSchemaId]: {
|
|
4153
|
+
min
|
|
4154
|
+
},
|
|
4155
|
+
title: `greaterThanBigDecimal(${formatted})`,
|
|
4156
|
+
description: `a BigDecimal greater than ${formatted}`,
|
|
4157
|
+
...annotations
|
|
4158
|
+
}));
|
|
4159
|
+
};
|
|
4086
4160
|
/**
|
|
4087
4161
|
* @category schema id
|
|
4088
4162
|
* @since 3.10.0
|
|
@@ -4092,14 +4166,18 @@ export const GreaterThanOrEqualToBigDecimalSchemaId = /*#__PURE__*/Symbol.for("e
|
|
|
4092
4166
|
* @category BigDecimal filters
|
|
4093
4167
|
* @since 3.10.0
|
|
4094
4168
|
*/
|
|
4095
|
-
export const greaterThanOrEqualToBigDecimal = (min, annotations) => self =>
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
})
|
|
4169
|
+
export const greaterThanOrEqualToBigDecimal = (min, annotations) => self => {
|
|
4170
|
+
const formatted = bigDecimal_.format(min);
|
|
4171
|
+
return self.pipe(filter(a => bigDecimal_.greaterThanOrEqualTo(a, min), {
|
|
4172
|
+
schemaId: GreaterThanOrEqualToBigDecimalSchemaId,
|
|
4173
|
+
[GreaterThanOrEqualToBigDecimalSchemaId]: {
|
|
4174
|
+
min
|
|
4175
|
+
},
|
|
4176
|
+
title: `greaterThanOrEqualToBigDecimal(${formatted})`,
|
|
4177
|
+
description: `a BigDecimal greater than or equal to ${formatted}`,
|
|
4178
|
+
...annotations
|
|
4179
|
+
}));
|
|
4180
|
+
};
|
|
4103
4181
|
/**
|
|
4104
4182
|
* @category schema id
|
|
4105
4183
|
* @since 3.10.0
|
|
@@ -4109,14 +4187,18 @@ export const LessThanBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/Schema
|
|
|
4109
4187
|
* @category BigDecimal filters
|
|
4110
4188
|
* @since 3.10.0
|
|
4111
4189
|
*/
|
|
4112
|
-
export const lessThanBigDecimal = (max, annotations) => self =>
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
})
|
|
4190
|
+
export const lessThanBigDecimal = (max, annotations) => self => {
|
|
4191
|
+
const formatted = bigDecimal_.format(max);
|
|
4192
|
+
return self.pipe(filter(a => bigDecimal_.lessThan(a, max), {
|
|
4193
|
+
schemaId: LessThanBigDecimalSchemaId,
|
|
4194
|
+
[LessThanBigDecimalSchemaId]: {
|
|
4195
|
+
max
|
|
4196
|
+
},
|
|
4197
|
+
title: `lessThanBigDecimal(${formatted})`,
|
|
4198
|
+
description: `a BigDecimal less than ${formatted}`,
|
|
4199
|
+
...annotations
|
|
4200
|
+
}));
|
|
4201
|
+
};
|
|
4120
4202
|
/**
|
|
4121
4203
|
* @category schema id
|
|
4122
4204
|
* @since 3.10.0
|
|
@@ -4126,14 +4208,18 @@ export const LessThanOrEqualToBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effe
|
|
|
4126
4208
|
* @category BigDecimal filters
|
|
4127
4209
|
* @since 3.10.0
|
|
4128
4210
|
*/
|
|
4129
|
-
export const lessThanOrEqualToBigDecimal = (max, annotations) => self =>
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
})
|
|
4211
|
+
export const lessThanOrEqualToBigDecimal = (max, annotations) => self => {
|
|
4212
|
+
const formatted = bigDecimal_.format(max);
|
|
4213
|
+
return self.pipe(filter(a => bigDecimal_.lessThanOrEqualTo(a, max), {
|
|
4214
|
+
schemaId: LessThanOrEqualToBigDecimalSchemaId,
|
|
4215
|
+
[LessThanOrEqualToBigDecimalSchemaId]: {
|
|
4216
|
+
max
|
|
4217
|
+
},
|
|
4218
|
+
title: `lessThanOrEqualToBigDecimal(${formatted})`,
|
|
4219
|
+
description: `a BigDecimal less than or equal to ${formatted}`,
|
|
4220
|
+
...annotations
|
|
4221
|
+
}));
|
|
4222
|
+
};
|
|
4137
4223
|
/**
|
|
4138
4224
|
* @category schema id
|
|
4139
4225
|
* @since 3.10.0
|
|
@@ -4145,6 +4231,7 @@ export const PositiveBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/schema
|
|
|
4145
4231
|
*/
|
|
4146
4232
|
export const positiveBigDecimal = annotations => self => self.pipe(filter(a => bigDecimal_.isPositive(a), {
|
|
4147
4233
|
schemaId: PositiveBigDecimalSchemaId,
|
|
4234
|
+
title: "positiveBigDecimal",
|
|
4148
4235
|
description: `a positive BigDecimal`,
|
|
4149
4236
|
...annotations
|
|
4150
4237
|
}));
|
|
@@ -4153,8 +4240,7 @@ export const positiveBigDecimal = annotations => self => self.pipe(filter(a => b
|
|
|
4153
4240
|
* @since 3.10.0
|
|
4154
4241
|
*/
|
|
4155
4242
|
export const PositiveBigDecimalFromSelf = /*#__PURE__*/BigDecimalFromSelf.pipe( /*#__PURE__*/positiveBigDecimal({
|
|
4156
|
-
identifier: "PositiveBigDecimalFromSelf"
|
|
4157
|
-
title: "PositiveBigDecimalFromSelf"
|
|
4243
|
+
identifier: "PositiveBigDecimalFromSelf"
|
|
4158
4244
|
}));
|
|
4159
4245
|
/**
|
|
4160
4246
|
* @category schema id
|
|
@@ -4167,6 +4253,7 @@ export const NonNegativeBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/sch
|
|
|
4167
4253
|
*/
|
|
4168
4254
|
export const nonNegativeBigDecimal = annotations => self => self.pipe(filter(a => a.value >= 0n, {
|
|
4169
4255
|
schemaId: NonNegativeBigDecimalSchemaId,
|
|
4256
|
+
title: "nonNegativeBigDecimal",
|
|
4170
4257
|
description: `a non-negative BigDecimal`,
|
|
4171
4258
|
...annotations
|
|
4172
4259
|
}));
|
|
@@ -4175,8 +4262,7 @@ export const nonNegativeBigDecimal = annotations => self => self.pipe(filter(a =
|
|
|
4175
4262
|
* @since 3.10.0
|
|
4176
4263
|
*/
|
|
4177
4264
|
export const NonNegativeBigDecimalFromSelf = /*#__PURE__*/BigDecimalFromSelf.pipe( /*#__PURE__*/nonNegativeBigDecimal({
|
|
4178
|
-
identifier: "NonNegativeBigDecimalFromSelf"
|
|
4179
|
-
title: "NonNegativeBigDecimalFromSelf"
|
|
4265
|
+
identifier: "NonNegativeBigDecimalFromSelf"
|
|
4180
4266
|
}));
|
|
4181
4267
|
/**
|
|
4182
4268
|
* @category schema id
|
|
@@ -4189,6 +4275,7 @@ export const NegativeBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/schema
|
|
|
4189
4275
|
*/
|
|
4190
4276
|
export const negativeBigDecimal = annotations => self => self.pipe(filter(a => bigDecimal_.isNegative(a), {
|
|
4191
4277
|
schemaId: NegativeBigDecimalSchemaId,
|
|
4278
|
+
title: "negativeBigDecimal",
|
|
4192
4279
|
description: `a negative BigDecimal`,
|
|
4193
4280
|
...annotations
|
|
4194
4281
|
}));
|
|
@@ -4197,8 +4284,7 @@ export const negativeBigDecimal = annotations => self => self.pipe(filter(a => b
|
|
|
4197
4284
|
* @since 3.10.0
|
|
4198
4285
|
*/
|
|
4199
4286
|
export const NegativeBigDecimalFromSelf = /*#__PURE__*/BigDecimalFromSelf.pipe( /*#__PURE__*/negativeBigDecimal({
|
|
4200
|
-
identifier: "NegativeBigDecimalFromSelf"
|
|
4201
|
-
title: "NegativeBigDecimalFromSelf"
|
|
4287
|
+
identifier: "NegativeBigDecimalFromSelf"
|
|
4202
4288
|
}));
|
|
4203
4289
|
/**
|
|
4204
4290
|
* @category schema id
|
|
@@ -4211,6 +4297,7 @@ export const NonPositiveBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/sch
|
|
|
4211
4297
|
*/
|
|
4212
4298
|
export const nonPositiveBigDecimal = annotations => self => self.pipe(filter(a => a.value <= 0n, {
|
|
4213
4299
|
schemaId: NonPositiveBigDecimalSchemaId,
|
|
4300
|
+
title: "nonPositiveBigDecimal",
|
|
4214
4301
|
description: `a non-positive BigDecimal`,
|
|
4215
4302
|
...annotations
|
|
4216
4303
|
}));
|
|
@@ -4219,8 +4306,7 @@ export const nonPositiveBigDecimal = annotations => self => self.pipe(filter(a =
|
|
|
4219
4306
|
* @since 3.10.0
|
|
4220
4307
|
*/
|
|
4221
4308
|
export const NonPositiveBigDecimalFromSelf = /*#__PURE__*/BigDecimalFromSelf.pipe( /*#__PURE__*/nonPositiveBigDecimal({
|
|
4222
|
-
identifier: "NonPositiveBigDecimalFromSelf"
|
|
4223
|
-
title: "NonPositiveBigDecimalFromSelf"
|
|
4309
|
+
identifier: "NonPositiveBigDecimalFromSelf"
|
|
4224
4310
|
}));
|
|
4225
4311
|
/**
|
|
4226
4312
|
* @category schema id
|
|
@@ -4231,18 +4317,23 @@ export const BetweenBigDecimalSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaI
|
|
|
4231
4317
|
* @category BigDecimal filters
|
|
4232
4318
|
* @since 3.10.0
|
|
4233
4319
|
*/
|
|
4234
|
-
export const betweenBigDecimal = (minimum, maximum, annotations) => self =>
|
|
4235
|
-
minimum
|
|
4236
|
-
maximum
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
}
|
|
4320
|
+
export const betweenBigDecimal = (minimum, maximum, annotations) => self => {
|
|
4321
|
+
const formattedMinimum = bigDecimal_.format(minimum);
|
|
4322
|
+
const formattedMaximum = bigDecimal_.format(maximum);
|
|
4323
|
+
return self.pipe(filter(a => bigDecimal_.between(a, {
|
|
4324
|
+
minimum,
|
|
4325
|
+
maximum
|
|
4326
|
+
}), {
|
|
4327
|
+
schemaId: BetweenBigDecimalSchemaId,
|
|
4328
|
+
[BetweenBigDecimalSchemaId]: {
|
|
4329
|
+
maximum,
|
|
4330
|
+
minimum
|
|
4331
|
+
},
|
|
4332
|
+
title: `betweenBigDecimal(${formattedMinimum}, ${formattedMaximum})`,
|
|
4333
|
+
description: `a BigDecimal between ${formattedMinimum} and ${formattedMaximum}`,
|
|
4334
|
+
...annotations
|
|
4335
|
+
}));
|
|
4336
|
+
};
|
|
4246
4337
|
/**
|
|
4247
4338
|
* Clamps a `BigDecimal` between a minimum and a maximum value.
|
|
4248
4339
|
*
|
|
@@ -4644,14 +4735,8 @@ const FiberIdNoneEncoded = /*#__PURE__*/Struct({
|
|
|
4644
4735
|
});
|
|
4645
4736
|
const FiberIdRuntimeEncoded = /*#__PURE__*/Struct({
|
|
4646
4737
|
_tag: Literal("Runtime"),
|
|
4647
|
-
id: Int
|
|
4648
|
-
|
|
4649
|
-
description: "id"
|
|
4650
|
-
}),
|
|
4651
|
-
startTimeMillis: Int.annotations({
|
|
4652
|
-
title: "startTimeMillis",
|
|
4653
|
-
description: "startTimeMillis"
|
|
4654
|
-
})
|
|
4738
|
+
id: Int,
|
|
4739
|
+
startTimeMillis: Int
|
|
4655
4740
|
}).annotations({
|
|
4656
4741
|
identifier: "FiberIdRuntimeEncoded"
|
|
4657
4742
|
});
|