@parischap/conversions 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1304 -0
- package/cjs/BigDecimal.js +16 -0
- package/cjs/BigDecimal.js.map +1 -0
- package/cjs/BigInt.js +34 -0
- package/cjs/BigInt.js.map +1 -0
- package/cjs/DateTime.js +2202 -0
- package/cjs/DateTime.js.map +1 -0
- package/cjs/DateTimeFormat.js +269 -0
- package/cjs/DateTimeFormat.js.map +1 -0
- package/cjs/DateTimeFormatContext.js +327 -0
- package/cjs/DateTimeFormatContext.js.map +1 -0
- package/cjs/Email.js +73 -0
- package/cjs/Email.js.map +1 -0
- package/cjs/Integer.js +155 -0
- package/cjs/Integer.js.map +1 -0
- package/cjs/NumberBase10Format.js +759 -0
- package/cjs/NumberBase10Format.js.map +1 -0
- package/cjs/PositiveInteger.js +191 -0
- package/cjs/PositiveInteger.js.map +1 -0
- package/cjs/PositiveReal.js +162 -0
- package/cjs/PositiveReal.js.map +1 -0
- package/cjs/Real.js +113 -0
- package/cjs/Real.js.map +1 -0
- package/cjs/RoundingMode.js +86 -0
- package/cjs/RoundingMode.js.map +1 -0
- package/cjs/RoundingOption.js +152 -0
- package/cjs/RoundingOption.js.map +1 -0
- package/cjs/Schema.js +218 -0
- package/cjs/Schema.js.map +1 -0
- package/cjs/SemVer.js +73 -0
- package/cjs/SemVer.js.map +1 -0
- package/cjs/Template.js +189 -0
- package/cjs/Template.js.map +1 -0
- package/cjs/TemplatePart.js +51 -0
- package/cjs/TemplatePart.js.map +1 -0
- package/cjs/TemplateParts.js +46 -0
- package/cjs/TemplateParts.js.map +1 -0
- package/cjs/TemplatePlaceholder.js +381 -0
- package/cjs/TemplatePlaceholder.js.map +1 -0
- package/cjs/TemplateSeparator.js +116 -0
- package/cjs/TemplateSeparator.js.map +1 -0
- package/cjs/index.js +67 -0
- package/cjs/index.js.map +1 -0
- package/cjs/internal/Int.js +50 -0
- package/cjs/internal/Int.js.map +1 -0
- package/cjs/internal/Positive.js +50 -0
- package/cjs/internal/Positive.js.map +1 -0
- package/dts/BigDecimal.d.ts +11 -0
- package/dts/BigDecimal.d.ts.map +1 -0
- package/dts/BigInt.d.ts +30 -0
- package/dts/BigInt.d.ts.map +1 -0
- package/dts/DateTime.d.ts +1421 -0
- package/dts/DateTime.d.ts.map +1 -0
- package/dts/DateTimeFormat.d.ts +257 -0
- package/dts/DateTimeFormat.d.ts.map +1 -0
- package/dts/DateTimeFormatContext.d.ts +112 -0
- package/dts/DateTimeFormatContext.d.ts.map +1 -0
- package/dts/Email.d.ts +61 -0
- package/dts/Email.d.ts.map +1 -0
- package/dts/Integer.d.ts +123 -0
- package/dts/Integer.d.ts.map +1 -0
- package/dts/NumberBase10Format.d.ts +641 -0
- package/dts/NumberBase10Format.d.ts.map +1 -0
- package/dts/PositiveInteger.d.ts +161 -0
- package/dts/PositiveInteger.d.ts.map +1 -0
- package/dts/PositiveReal.d.ts +130 -0
- package/dts/PositiveReal.d.ts.map +1 -0
- package/dts/Real.d.ts +102 -0
- package/dts/Real.d.ts.map +1 -0
- package/dts/RoundingMode.d.ts +72 -0
- package/dts/RoundingMode.d.ts.map +1 -0
- package/dts/RoundingOption.d.ts +79 -0
- package/dts/RoundingOption.d.ts.map +1 -0
- package/dts/Schema.d.ts +159 -0
- package/dts/Schema.d.ts.map +1 -0
- package/dts/SemVer.d.ts +61 -0
- package/dts/SemVer.d.ts.map +1 -0
- package/dts/Template.d.ts +113 -0
- package/dts/Template.d.ts.map +1 -0
- package/dts/TemplatePart.d.ts +28 -0
- package/dts/TemplatePart.d.ts.map +1 -0
- package/dts/TemplateParts.d.ts +23 -0
- package/dts/TemplateParts.d.ts.map +1 -0
- package/dts/TemplatePlaceholder.d.ts +274 -0
- package/dts/TemplatePlaceholder.d.ts.map +1 -0
- package/dts/TemplateSeparator.d.ts +130 -0
- package/dts/TemplateSeparator.d.ts.map +1 -0
- package/dts/index.d.ts +21 -0
- package/dts/index.d.ts.map +1 -0
- package/dts/internal/Int.d.ts +6 -0
- package/dts/internal/Int.d.ts.map +1 -0
- package/dts/internal/Positive.d.ts +6 -0
- package/dts/internal/Positive.d.ts.map +1 -0
- package/esm/BigDecimal.js +9 -0
- package/esm/BigDecimal.js.map +1 -0
- package/esm/BigInt.js +27 -0
- package/esm/BigInt.js.map +1 -0
- package/esm/DateTime.js +2130 -0
- package/esm/DateTime.js.map +1 -0
- package/esm/DateTimeFormat.js +238 -0
- package/esm/DateTimeFormat.js.map +1 -0
- package/esm/DateTimeFormatContext.js +296 -0
- package/esm/DateTimeFormatContext.js.map +1 -0
- package/esm/Email.js +65 -0
- package/esm/Email.js.map +1 -0
- package/esm/Integer.js +128 -0
- package/esm/Integer.js.map +1 -0
- package/esm/NumberBase10Format.js +717 -0
- package/esm/NumberBase10Format.js.map +1 -0
- package/esm/PositiveInteger.js +164 -0
- package/esm/PositiveInteger.js.map +1 -0
- package/esm/PositiveReal.js +135 -0
- package/esm/PositiveReal.js.map +1 -0
- package/esm/Real.js +106 -0
- package/esm/Real.js.map +1 -0
- package/esm/RoundingMode.js +79 -0
- package/esm/RoundingMode.js.map +1 -0
- package/esm/RoundingOption.js +120 -0
- package/esm/RoundingOption.js.map +1 -0
- package/esm/Schema.js +203 -0
- package/esm/Schema.js.map +1 -0
- package/esm/SemVer.js +65 -0
- package/esm/SemVer.js.map +1 -0
- package/esm/Template.js +158 -0
- package/esm/Template.js.map +1 -0
- package/esm/TemplatePart.js +22 -0
- package/esm/TemplatePart.js.map +1 -0
- package/esm/TemplateParts.js +19 -0
- package/esm/TemplateParts.js.map +1 -0
- package/esm/TemplatePlaceholder.js +342 -0
- package/esm/TemplatePlaceholder.js.map +1 -0
- package/esm/TemplateSeparator.js +107 -0
- package/esm/TemplateSeparator.js.map +1 -0
- package/esm/index.js +21 -0
- package/esm/index.js.map +1 -0
- package/esm/internal/Int.js +43 -0
- package/esm/internal/Int.js.map +1 -0
- package/esm/internal/Positive.js +43 -0
- package/esm/internal/Positive.js.map +1 -0
- package/esm/package.json +3 -0
- package/package.json +49 -0
@@ -0,0 +1,274 @@
|
|
1
|
+
/**
|
2
|
+
* This module implements a TemplatePlaceholder type which is a sub-type of the TemplatePart type
|
3
|
+
* (see TemplatePart.ts)
|
4
|
+
*
|
5
|
+
* A TemplatePlaceholder represents the mutable part of a template. Each Placeholder defines a
|
6
|
+
* parser and a formatter:
|
7
|
+
*
|
8
|
+
* - The parser takes a string, consumes a part of that string, optionnally converts the consumed part
|
9
|
+
* to a value of type T and, if successful, returns a right of that value and of what has not been
|
10
|
+
* consumed. In case of an error, it returns a left.
|
11
|
+
* - The formatter takes a value of type T, converts it to a string (if T is not string), checks that
|
12
|
+
* the result is coherent and, if so, returns a right of that string. Otherwise, it returns a
|
13
|
+
* left.
|
14
|
+
*/
|
15
|
+
import { MInputError, MInspectable, MString, MTypes } from '@parischap/effect-lib';
|
16
|
+
import { Either, Pipeable, Schema } from 'effect';
|
17
|
+
import * as CVNumberBase10Format from './NumberBase10Format.js';
|
18
|
+
import * as CVReal from './Real.js';
|
19
|
+
/**
|
20
|
+
* Module tag
|
21
|
+
*
|
22
|
+
* @category Module markers
|
23
|
+
*/
|
24
|
+
export declare const moduleTag = "@parischap/conversions/TemplatePlaceholder/";
|
25
|
+
/**
|
26
|
+
* Namespace of a Parser
|
27
|
+
*
|
28
|
+
* @category Models
|
29
|
+
*/
|
30
|
+
export declare namespace Parser {
|
31
|
+
/**
|
32
|
+
* Type that describes a Parser
|
33
|
+
*
|
34
|
+
* @category Models
|
35
|
+
*/
|
36
|
+
interface Type<out T> extends MTypes.OneArgFunction<string, Either.Either<readonly [consumed: T, leftOver: string], MInputError.Type>> {
|
37
|
+
}
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Namespace of a Formatter
|
41
|
+
*
|
42
|
+
* @category Models
|
43
|
+
*/
|
44
|
+
export declare namespace Formatter {
|
45
|
+
/**
|
46
|
+
* Type that describes a Formatter
|
47
|
+
*
|
48
|
+
* @category Models
|
49
|
+
*/
|
50
|
+
interface Type<in T> extends MTypes.OneArgFunction<T, Either.Either<string, MInputError.Type>> {
|
51
|
+
}
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* Type that represents a TemplatePlaceholder
|
55
|
+
*
|
56
|
+
* @category Models
|
57
|
+
*/
|
58
|
+
export interface Type<out N extends string, in out T> extends MInspectable.Type, Pipeable.Pipeable {
|
59
|
+
/** Name of this TemplatePlaceholder */
|
60
|
+
readonly name: N;
|
61
|
+
/** Label of this TemplatePlaceholder(usually the name prefixed with '#') */
|
62
|
+
readonly label: string;
|
63
|
+
/** Descriptor of this TemplatePlaceholder (used for debugging purposes) */
|
64
|
+
readonly description: string;
|
65
|
+
/** Parser of this TemplatePlaceholder */
|
66
|
+
readonly parser: Parser.Type<T>;
|
67
|
+
/** Formatter of this TemplatePlaceholder */
|
68
|
+
readonly formatter: Formatter.Type<T>;
|
69
|
+
readonly schemaInstance: Schema.Schema<T, T>;
|
70
|
+
}
|
71
|
+
/**
|
72
|
+
* Type that represents a TemplatePlaceholder from and to any type
|
73
|
+
*
|
74
|
+
* @category Models
|
75
|
+
*/
|
76
|
+
export interface All extends Type<string, any> {
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* Utility type that extracts the Name type of a TemplatePlaceholder
|
80
|
+
*
|
81
|
+
* @category Utility types
|
82
|
+
*/
|
83
|
+
export type ExtractName<P extends All> = P extends Type<infer N, infer _> ? N : never;
|
84
|
+
/**
|
85
|
+
* Utility type that extracts the Type type of a TemplatePlaceholder
|
86
|
+
*
|
87
|
+
* @category Utility types
|
88
|
+
*/
|
89
|
+
export type ExtractType<P extends All> = P extends Type<string, infer T> ? T : never;
|
90
|
+
/**
|
91
|
+
* Type guard
|
92
|
+
*
|
93
|
+
* @category Guards
|
94
|
+
*/
|
95
|
+
export declare const has: (u: unknown) => u is Type<string, unknown>;
|
96
|
+
/**
|
97
|
+
* Constructor
|
98
|
+
*
|
99
|
+
* @category Constructors
|
100
|
+
*/
|
101
|
+
export declare const make: <const N extends string, T>(params: Omit<MTypes.Data<Type<N, T>>, 'label'>) => Type<N, T>;
|
102
|
+
/**
|
103
|
+
* Returns the `name` property of `self`
|
104
|
+
*
|
105
|
+
* @category Destructors
|
106
|
+
*/
|
107
|
+
export declare const name: <const N extends string, T>(self: Type<N, T>) => N;
|
108
|
+
/**
|
109
|
+
* Returns the `label` property of `self`
|
110
|
+
*
|
111
|
+
* @category Destructors
|
112
|
+
*/
|
113
|
+
export declare const label: <const N extends string, T>(self: Type<N, T>) => string;
|
114
|
+
/**
|
115
|
+
* Returns the `description` property of `self`
|
116
|
+
*
|
117
|
+
* @category Destructors
|
118
|
+
*/
|
119
|
+
export declare const description: <const N extends string, T>(self: Type<N, T>) => string;
|
120
|
+
/**
|
121
|
+
* Returns the `parser` property of `self`
|
122
|
+
*
|
123
|
+
* @category Destructors
|
124
|
+
*/
|
125
|
+
export declare const parser: <const N extends string, T>(self: Type<N, T>) => Parser.Type<T>;
|
126
|
+
/**
|
127
|
+
* Returns the `formatter` property of `self`
|
128
|
+
*
|
129
|
+
* @category Destructors
|
130
|
+
*/
|
131
|
+
export declare const formatter: <const N extends string, T>(self: Type<N, T>) => Formatter.Type<T>;
|
132
|
+
/**
|
133
|
+
* Returns the `schemaInstance` property of `self`
|
134
|
+
*
|
135
|
+
* @category Destructors
|
136
|
+
*/
|
137
|
+
export declare const schemaInstance: <const N extends string, T>(self: Type<N, T>) => Schema.Schema<T, T>;
|
138
|
+
/**
|
139
|
+
* Returns the description of `self`
|
140
|
+
*
|
141
|
+
* @category Destructors
|
142
|
+
*/
|
143
|
+
export declare const getLabelledDescription: <N extends string, T>(self: Type<N, T>) => string;
|
144
|
+
/**
|
145
|
+
* Returns a modified copy of `self` where a postParser function is executed after the parser of
|
146
|
+
* `self` and a preFormatter function is executed before the formatter of `self`
|
147
|
+
*
|
148
|
+
* @category Destructors
|
149
|
+
*/
|
150
|
+
export declare const modify: {
|
151
|
+
<T>({ descriptorMapper, postParser, preFormatter }: {
|
152
|
+
readonly descriptorMapper: MTypes.OneArgFunction<string>;
|
153
|
+
readonly postParser: MTypes.OneArgFunction<T, Either.Either<T, MInputError.Type>>;
|
154
|
+
readonly preFormatter: MTypes.OneArgFunction<T, Either.Either<T, MInputError.Type>>;
|
155
|
+
}): <const N extends string>(self: Type<N, T>) => Type<N, T>;
|
156
|
+
<T, T1>({ descriptorMapper, postParser, preFormatter, t1SchemaInstance }: {
|
157
|
+
readonly descriptorMapper: MTypes.OneArgFunction<string>;
|
158
|
+
readonly postParser: MTypes.OneArgFunction<T, Either.Either<T1, MInputError.Type>>;
|
159
|
+
readonly preFormatter: MTypes.OneArgFunction<T1, Either.Either<T, MInputError.Type>>;
|
160
|
+
readonly t1SchemaInstance: Schema.Schema<T1, T1>;
|
161
|
+
}): <const N extends string>(self: Type<N, T>) => Type<N, T1>;
|
162
|
+
};
|
163
|
+
/**
|
164
|
+
* Builds a TemplatePlaceholder instance that parses/formats exactly `length` characters from a
|
165
|
+
* string. `length` must be a strictly positive integer.
|
166
|
+
*
|
167
|
+
* @category Constructors
|
168
|
+
*/
|
169
|
+
export declare const fixedLength: <const N extends string>({ name, length }: {
|
170
|
+
readonly name: N;
|
171
|
+
readonly length: number;
|
172
|
+
}) => Type<N, string>;
|
173
|
+
/**
|
174
|
+
* Builds a TemplatePlaceholder instance that parses/formats exactly `length` characters from a
|
175
|
+
* string and trims/pads the result at `padPosition` with `fillChar`. `fillChar` should be a
|
176
|
+
* one-character string. `length` must be a strictly positive integer. See the meaning of
|
177
|
+
* `disallowEmptyString` in String.trim.
|
178
|
+
*
|
179
|
+
* @category Constructors
|
180
|
+
*/
|
181
|
+
export declare const paddedFixedLength: <const N extends string>(params: {
|
182
|
+
readonly name: N;
|
183
|
+
readonly length: number;
|
184
|
+
readonly fillChar: string;
|
185
|
+
readonly padPosition: MString.PadPosition;
|
186
|
+
readonly disallowEmptyString: boolean;
|
187
|
+
}) => Type<N, string>;
|
188
|
+
/**
|
189
|
+
* Builds a TemplatePlaceholder instance that parses/formats a Real in the given
|
190
|
+
* `numberBase10Format`. If the number to parse/format is less than `length` characters, `fillChar`
|
191
|
+
* is trimmed/padded between the sign and the number so that the length condition is respected.
|
192
|
+
* fillChar must be a one-character string (but no error is triggered if you do not respect that
|
193
|
+
* condition)
|
194
|
+
*
|
195
|
+
* @category Constructors
|
196
|
+
*/
|
197
|
+
export declare const fixedLengthToReal: <const N extends string>(params: {
|
198
|
+
readonly name: N;
|
199
|
+
readonly length: number;
|
200
|
+
readonly fillChar: string;
|
201
|
+
readonly numberBase10Format: CVNumberBase10Format.Type;
|
202
|
+
}) => Type<N, CVReal.Type>;
|
203
|
+
/**
|
204
|
+
* Builds a TemplatePlaceholder instance that parses/formats a Real provided in
|
205
|
+
* `numberBase10Format`.
|
206
|
+
*
|
207
|
+
* @category Constructors
|
208
|
+
*/
|
209
|
+
export declare const real: <const N extends string>({ name, numberBase10Format }: {
|
210
|
+
readonly name: N;
|
211
|
+
readonly numberBase10Format: CVNumberBase10Format.Type;
|
212
|
+
}) => Type<N, CVReal.Type>;
|
213
|
+
/**
|
214
|
+
* Builds a TemplatePlaceholder instance that works as a map:
|
215
|
+
*
|
216
|
+
* The parser expects one of the keys of `keyValuePairs` and will return the associated value. The
|
217
|
+
* formatter expects one of the values of `keyValuePairs` and will return the associated key.
|
218
|
+
*
|
219
|
+
* `keyValuePairs` should define a bijection (each key and each value must be present only once). It
|
220
|
+
* is best if the type of the values defines a toString method. Value equality is checked with The
|
221
|
+
* Effect Equal.equals function.
|
222
|
+
*
|
223
|
+
* `schemaInstance` is a Schema instance that transforms a value of type T into a value of type T.
|
224
|
+
* It is an optional parameter. You need only provide it if you intend to use a CVTemplate built
|
225
|
+
* from it within the Effect Schema module. In that case, you can build such a Schema with the
|
226
|
+
* Schema.declare function. If you don't provide it and use a CVTemplate built from it within the
|
227
|
+
* Effect Schema module, it will not work.
|
228
|
+
*
|
229
|
+
* @category Constructors
|
230
|
+
*/
|
231
|
+
export declare const mappedLiterals: <const N extends string, T>({ name, keyValuePairs, schemaInstance }: {
|
232
|
+
readonly name: N;
|
233
|
+
readonly keyValuePairs: ReadonlyArray<readonly [string, T]>;
|
234
|
+
readonly schemaInstance?: Schema.Schema<T, T>;
|
235
|
+
}) => Type<N, T>;
|
236
|
+
/**
|
237
|
+
* Same as `mappedLiterals` but `T` is assumed to be `CVReal.Type` which should be the most usual
|
238
|
+
* use case
|
239
|
+
*
|
240
|
+
* @category Constructors
|
241
|
+
*/
|
242
|
+
export declare const realMappedLiterals: <const N extends string>(params: {
|
243
|
+
readonly name: N;
|
244
|
+
readonly keyValuePairs: ReadonlyArray<readonly [string, CVReal.Type]>;
|
245
|
+
}) => Type<N, CVReal.Type>;
|
246
|
+
/**
|
247
|
+
* Builds a TemplatePlaceholder instance that parses/formats the regular expression regExp. `regExp`
|
248
|
+
* must start with the ^ character. Otherwise, the parser and formatter will not work properly.
|
249
|
+
*
|
250
|
+
* @category Constructors
|
251
|
+
*/
|
252
|
+
export declare const fulfilling: <const N extends string>({ name, regExp, regExpDescriptor }: {
|
253
|
+
readonly name: N;
|
254
|
+
readonly regExp: RegExp;
|
255
|
+
readonly regExpDescriptor: string;
|
256
|
+
}) => Type<N, string>;
|
257
|
+
/**
|
258
|
+
* Builds a TemplatePlaceholder instance that parses/formats a non-empty string made up of
|
259
|
+
* characters other than those contained in `forbiddenChars`. `forbiddenChars` should be an array of
|
260
|
+
* 1-character strings (will not throw otherwise but strange behaviors can be expected)
|
261
|
+
*
|
262
|
+
* @category Constructors
|
263
|
+
*/
|
264
|
+
export declare const anythingBut: <const N extends string>({ name, forbiddenChars }: {
|
265
|
+
readonly name: N;
|
266
|
+
readonly forbiddenChars: MTypes.OverOne<string>;
|
267
|
+
}) => Type<N, string>;
|
268
|
+
/**
|
269
|
+
* Builds a TemplatePlaceholder instance that parses/formats all the remaining text.
|
270
|
+
*
|
271
|
+
* @category Constructors
|
272
|
+
*/
|
273
|
+
export declare const toEnd: <const N extends string>(name: N) => Type<N, string>;
|
274
|
+
//# sourceMappingURL=TemplatePlaceholder.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TemplatePlaceholder.d.ts","sourceRoot":"","sources":["../../esm/TemplatePlaceholder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACN,WAAW,EACX,YAAY,EAIZ,OAAO,EAGP,MAAM,EACN,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEN,MAAM,EAKN,QAAQ,EAER,MAAM,EAKN,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,oBAAoB,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,SAAS,gDAAgD,CAAC;AAIvE;;;;GAIG;AACH,yBAAiB,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAiB,IAAI,CAAC,GAAG,CAAC,CAAC,CAC1B,SAAQ,MAAM,CAAC,cAAc,CAC5B,MAAM,EACN,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CACzE;KAAG;CACL;AAED;;;;GAIG;AACH,yBAAiB,SAAS,CAAC;IAC1B;;;;OAIG;IACH,UAAiB,IAAI,CAAC,EAAE,CAAC,CAAC,CACzB,SAAQ,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;KAAG;CAC7E;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAE,SAAQ,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ;IACjG,uCAAuC;IACvC,QAAQ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AAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD,KAAG,IAAI,CAAC,CAAC,EAAE,MAAM,CAkBjB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,KAAG,IAAI,CAAC,CAAC,EAAE,MAAM,CAKnE,CAAC"}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/**
|
2
|
+
* This module implements a TemplateSeparator type which is a sub-type of the TemplatePart type (see
|
3
|
+
* TemplatePart.ts)
|
4
|
+
*
|
5
|
+
* A TemplateSeparator represents the immutable part of a template. Upon parsing, we must check that
|
6
|
+
* it is present as is in the text. Upon formatting, it must be inserted as is into the text. A
|
7
|
+
* Separator contains no valuable information
|
8
|
+
*/
|
9
|
+
import { MInputError, MInspectable, MTypes } from '@parischap/effect-lib';
|
10
|
+
import { Either, Function, Pipeable } from 'effect';
|
11
|
+
/**
|
12
|
+
* Module tag
|
13
|
+
*
|
14
|
+
* @category Module markers
|
15
|
+
*/
|
16
|
+
export declare const moduleTag = "@parischap/conversions/TemplateSeparator/";
|
17
|
+
/**
|
18
|
+
* Namespace of a Parser
|
19
|
+
*
|
20
|
+
* @category Models
|
21
|
+
*/
|
22
|
+
export declare namespace Parser {
|
23
|
+
/**
|
24
|
+
* Type that describes a Parser
|
25
|
+
*
|
26
|
+
* @category Models
|
27
|
+
*/
|
28
|
+
interface Type extends MTypes.OneArgFunction<number, MTypes.OneArgFunction<string, Either.Either<string, MInputError.Type>>> {
|
29
|
+
}
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Namespace of a Formatter
|
33
|
+
*
|
34
|
+
* @category Models
|
35
|
+
*/
|
36
|
+
export declare namespace Formatter {
|
37
|
+
/**
|
38
|
+
* Type that describes a Formatter
|
39
|
+
*
|
40
|
+
* @category Models
|
41
|
+
*/
|
42
|
+
interface Type extends Function.LazyArg<string> {
|
43
|
+
}
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Type that represents a TemplateSeparator
|
47
|
+
*
|
48
|
+
* @category Models
|
49
|
+
*/
|
50
|
+
export interface Type extends MInspectable.Type, Pipeable.Pipeable {
|
51
|
+
/** The string representing this separator */
|
52
|
+
readonly value: string;
|
53
|
+
/** Parser of this TemplateSeparator */
|
54
|
+
readonly parser: Parser.Type;
|
55
|
+
/** Formatter of this TemplateSeparator */
|
56
|
+
readonly formatter: Formatter.Type;
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* Type guard
|
60
|
+
*
|
61
|
+
* @category Guards
|
62
|
+
*/
|
63
|
+
export declare const has: (u: unknown) => u is Type;
|
64
|
+
/**
|
65
|
+
* Builds a Separator instance that parses/formats a given string.
|
66
|
+
*
|
67
|
+
* @category Constructors
|
68
|
+
*/
|
69
|
+
export declare const make: (value: string) => Type;
|
70
|
+
/**
|
71
|
+
* Returns the `value` property of `self`
|
72
|
+
*
|
73
|
+
* @category Destructors
|
74
|
+
*/
|
75
|
+
export declare const value: MTypes.OneArgFunction<Type, string>;
|
76
|
+
/**
|
77
|
+
* Returns the `parser` property of `self`
|
78
|
+
*
|
79
|
+
* @category Destructors
|
80
|
+
*/
|
81
|
+
export declare const parser: MTypes.OneArgFunction<Type, Parser.Type>;
|
82
|
+
/**
|
83
|
+
* Returns the `formatter` property of `self`
|
84
|
+
*
|
85
|
+
* @category Destructors
|
86
|
+
*/
|
87
|
+
export declare const formatter: MTypes.OneArgFunction<Type, Formatter.Type>;
|
88
|
+
/**
|
89
|
+
* Slash Separator instance
|
90
|
+
*
|
91
|
+
* @category Instances
|
92
|
+
*/
|
93
|
+
export declare const slash: Type;
|
94
|
+
/**
|
95
|
+
* Backslash Separator instance
|
96
|
+
*
|
97
|
+
* @category Instances
|
98
|
+
*/
|
99
|
+
export declare const backslash: Type;
|
100
|
+
/**
|
101
|
+
* Dot Separator instance
|
102
|
+
*
|
103
|
+
* @category Instances
|
104
|
+
*/
|
105
|
+
export declare const dot: Type;
|
106
|
+
/**
|
107
|
+
* Hyphen Separator instance
|
108
|
+
*
|
109
|
+
* @category Instances
|
110
|
+
*/
|
111
|
+
export declare const hyphen: Type;
|
112
|
+
/**
|
113
|
+
* Colon Separator instance
|
114
|
+
*
|
115
|
+
* @category Instances
|
116
|
+
*/
|
117
|
+
export declare const colon: Type;
|
118
|
+
/**
|
119
|
+
* Comma Separator instance
|
120
|
+
*
|
121
|
+
* @category Instances
|
122
|
+
*/
|
123
|
+
export declare const comma: Type;
|
124
|
+
/**
|
125
|
+
* Space Separator instance
|
126
|
+
*
|
127
|
+
* @category Instances
|
128
|
+
*/
|
129
|
+
export declare const space: Type;
|
130
|
+
//# sourceMappingURL=TemplateSeparator.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TemplateSeparator.d.ts","sourceRoot":"","sources":["../../esm/TemplateSeparator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAsB,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,MAAM,EAAQ,QAAQ,EAAE,QAAQ,EAAqB,MAAM,QAAQ,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,SAAS,8CAA8C,CAAC;AAIrE;;;;GAIG;AACH,yBAAiB,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAiB,IAChB,SAAQ,MAAM,CAAC,cAAc,CAC5B,MAAM,EACN,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CACtE;KAAG;CACL;AAED;;;;GAIG;AACH,yBAAiB,SAAS,CAAC;IAC1B;;;;OAIG;IACH,UAAiB,IAAK,SAAQ,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;KAAG;CACzD;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAK,SAAQ,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,QAA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
+
export * as CVDateTime from './DateTime.js';
|
4
|
+
export * as CVDateTimeFormat from './DateTimeFormat.js';
|
5
|
+
export * as CVDateTimeFormatContext from './DateTimeFormatContext.js';
|
6
|
+
export * as CVEmail from './Email.js';
|
7
|
+
export * as CVInteger from './Integer.js';
|
8
|
+
export * as CVNumberBase10Format from './NumberBase10Format.js';
|
9
|
+
export * as CVPositiveInteger from './PositiveInteger.js';
|
10
|
+
export * as CVPositiveReal from './PositiveReal.js';
|
11
|
+
export * as CVReal from './Real.js';
|
12
|
+
export * as CVRoundingMode from './RoundingMode.js';
|
13
|
+
export * as CVRoundingOption from './RoundingOption.js';
|
14
|
+
export * as CVSchema from './Schema.js';
|
15
|
+
export * as CVSemVer from './SemVer.js';
|
16
|
+
export * as CVTemplate from './Template.js';
|
17
|
+
export * as CVTemplatePart from './TemplatePart.js';
|
18
|
+
export * as CVTemplateParts from './TemplateParts.js';
|
19
|
+
export * as CVTemplatePlaceholder from './TemplatePlaceholder.js';
|
20
|
+
export * as CVTemplateSeparator from './TemplateSeparator.js';
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../esm/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,gBAAgB,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,uBAAuB,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,oBAAoB,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,gBAAgB,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,mBAAmB,MAAM,wBAAwB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Int.d.ts","sourceRoot":"","sources":["../../../esm/internal/Int.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Positive.d.ts","sourceRoot":"","sources":["../../../esm/internal/Positive.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/** A simple extension to the Effect BigDecimal module */
|
2
|
+
import { BigDecimal } from 'effect';
|
3
|
+
/**
|
4
|
+
* Constructs a BigDecimal from a Real
|
5
|
+
*
|
6
|
+
* @category Constructors
|
7
|
+
*/
|
8
|
+
export const fromReal = BigDecimal.unsafeFromNumber;
|
9
|
+
//# sourceMappingURL=BigDecimal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BigDecimal.js","names":["BigDecimal","fromReal","unsafeFromNumber"],"sources":["../../esm/BigDecimal.ts"],"sourcesContent":[null],"mappings":"AAAA;AAGA,SAASA,UAAU,QAAQ,QAAQ;AAGnC;;;;;AAKA,OAAO,MAAMC,QAAQ,GACpBD,UAAU,CAACE,gBAAgB","ignoreList":[]}
|
package/esm/BigInt.js
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
/** A simple extension to the Effect BigInt module */
|
2
|
+
import { MBigInt } from '@parischap/effect-lib';
|
3
|
+
/**
|
4
|
+
* Constructs a BigInt from a Integer
|
5
|
+
*
|
6
|
+
* @category Constructors
|
7
|
+
*/
|
8
|
+
export const fromInteger = MBigInt.fromPrimitiveOrThrow;
|
9
|
+
/**
|
10
|
+
* Constructs an Option of a BigInt from a Real
|
11
|
+
*
|
12
|
+
* @category Constructors
|
13
|
+
*/
|
14
|
+
export const fromRealOption = MBigInt.fromPrimitiveOption;
|
15
|
+
/**
|
16
|
+
* Constructs an Either of a BigInt from a Real
|
17
|
+
*
|
18
|
+
* @category Constructors
|
19
|
+
*/
|
20
|
+
export const fromReal = MBigInt.fromPrimitive;
|
21
|
+
/**
|
22
|
+
* Constructs a BigInt from a Real or throws
|
23
|
+
*
|
24
|
+
* @category Constructors
|
25
|
+
*/
|
26
|
+
export const fromRealOrThrow = MBigInt.fromPrimitiveOrThrow;
|
27
|
+
//# sourceMappingURL=BigInt.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BigInt.js","names":["MBigInt","fromInteger","fromPrimitiveOrThrow","fromRealOption","fromPrimitiveOption","fromReal","fromPrimitive","fromRealOrThrow"],"sources":["../../esm/BigInt.ts"],"sourcesContent":[null],"mappings":"AAAA;AAEA,SAASA,OAAO,QAAgB,uBAAuB;AAKvD;;;;;AAKA,OAAO,MAAMC,WAAW,GACvBD,OAAO,CAACE,oBAAoB;AAE7B;;;;;AAKA,OAAO,MAAMC,cAAc,GAGvBH,OAAO,CAACI,mBAA4B;AAExC;;;;;AAKA,OAAO,MAAMC,QAAQ,GAGjBL,OAAO,CAACM,aAAsB;AAElC;;;;;AAKA,OAAO,MAAMC,eAAe,GAC3BP,OAAO,CAACE,oBAA6B","ignoreList":[]}
|