@parischap/conversions 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +50 -49
  2. package/cjs/BigDecimal.js +2 -2
  3. package/cjs/BigInt.js +7 -5
  4. package/cjs/BigInt.js.map +1 -1
  5. package/cjs/DateTime.js +144 -136
  6. package/cjs/DateTime.js.map +1 -1
  7. package/cjs/DateTimeFormat.js +7 -2
  8. package/cjs/DateTimeFormat.js.map +1 -1
  9. package/cjs/DateTimeFormatContext.js +11 -6
  10. package/cjs/DateTimeFormatContext.js.map +1 -1
  11. package/cjs/Email.js +11 -15
  12. package/cjs/Email.js.map +1 -1
  13. package/cjs/Integer.js +33 -23
  14. package/cjs/Integer.js.map +1 -1
  15. package/cjs/NumberBase10Format.js +65 -65
  16. package/cjs/PositiveInteger.js +44 -29
  17. package/cjs/PositiveInteger.js.map +1 -1
  18. package/cjs/PositiveReal.js +34 -24
  19. package/cjs/PositiveReal.js.map +1 -1
  20. package/cjs/Real.js +29 -18
  21. package/cjs/Real.js.map +1 -1
  22. package/cjs/RoundingMode.js +7 -4
  23. package/cjs/RoundingMode.js.map +1 -1
  24. package/cjs/RoundingOption.js +6 -6
  25. package/cjs/RoundingOption.js.map +1 -1
  26. package/cjs/Schema.js +29 -28
  27. package/cjs/Schema.js.map +1 -1
  28. package/cjs/SemVer.js +19 -20
  29. package/cjs/SemVer.js.map +1 -1
  30. package/cjs/Template.js +36 -31
  31. package/cjs/Template.js.map +1 -1
  32. package/cjs/TemplatePart.js +4 -4
  33. package/cjs/TemplateParts.js +3 -2
  34. package/cjs/TemplateParts.js.map +1 -1
  35. package/cjs/TemplatePlaceholder.js +56 -45
  36. package/cjs/TemplatePlaceholder.js.map +1 -1
  37. package/cjs/TemplateSeparator.js +17 -24
  38. package/cjs/TemplateSeparator.js.map +1 -1
  39. package/cjs/internal/Int.js +5 -8
  40. package/cjs/internal/Int.js.map +1 -1
  41. package/cjs/internal/Positive.js +5 -8
  42. package/cjs/internal/Positive.js.map +1 -1
  43. package/dts/BigDecimal.d.ts +2 -2
  44. package/dts/BigDecimal.d.ts.map +1 -1
  45. package/dts/BigInt.d.ts +7 -5
  46. package/dts/BigInt.d.ts.map +1 -1
  47. package/dts/DateTime.d.ts +145 -137
  48. package/dts/DateTime.d.ts.map +1 -1
  49. package/dts/DateTimeFormat.d.ts +7 -2
  50. package/dts/DateTimeFormat.d.ts.map +1 -1
  51. package/dts/DateTimeFormatContext.d.ts +17 -12
  52. package/dts/DateTimeFormatContext.d.ts.map +1 -1
  53. package/dts/Email.d.ts +16 -13
  54. package/dts/Email.d.ts.map +1 -1
  55. package/dts/Integer.d.ts +43 -21
  56. package/dts/Integer.d.ts.map +1 -1
  57. package/dts/NumberBase10Format.d.ts +68 -68
  58. package/dts/PositiveInteger.d.ts +54 -27
  59. package/dts/PositiveInteger.d.ts.map +1 -1
  60. package/dts/PositiveReal.d.ts +44 -22
  61. package/dts/PositiveReal.d.ts.map +1 -1
  62. package/dts/Real.d.ts +39 -16
  63. package/dts/Real.d.ts.map +1 -1
  64. package/dts/RoundingMode.d.ts +6 -3
  65. package/dts/RoundingMode.d.ts.map +1 -1
  66. package/dts/RoundingOption.d.ts +6 -6
  67. package/dts/Schema.d.ts +32 -33
  68. package/dts/Schema.d.ts.map +1 -1
  69. package/dts/SemVer.d.ts +25 -13
  70. package/dts/SemVer.d.ts.map +1 -1
  71. package/dts/Template.d.ts +30 -29
  72. package/dts/Template.d.ts.map +1 -1
  73. package/dts/TemplatePart.d.ts +4 -4
  74. package/dts/TemplateParts.d.ts +4 -3
  75. package/dts/TemplateParts.d.ts.map +1 -1
  76. package/dts/TemplatePlaceholder.d.ts +56 -44
  77. package/dts/TemplatePlaceholder.d.ts.map +1 -1
  78. package/dts/TemplateSeparator.d.ts +9 -51
  79. package/dts/TemplateSeparator.d.ts.map +1 -1
  80. package/dts/internal/Int.d.ts +0 -4
  81. package/dts/internal/Int.d.ts.map +1 -1
  82. package/dts/internal/Positive.d.ts +0 -4
  83. package/dts/internal/Positive.d.ts.map +1 -1
  84. package/esm/BigDecimal.js +2 -2
  85. package/esm/BigInt.js +7 -5
  86. package/esm/BigInt.js.map +1 -1
  87. package/esm/DateTime.js +144 -136
  88. package/esm/DateTime.js.map +1 -1
  89. package/esm/DateTimeFormat.js +7 -2
  90. package/esm/DateTimeFormat.js.map +1 -1
  91. package/esm/DateTimeFormatContext.js +11 -6
  92. package/esm/DateTimeFormatContext.js.map +1 -1
  93. package/esm/Email.js +10 -13
  94. package/esm/Email.js.map +1 -1
  95. package/esm/Integer.js +33 -23
  96. package/esm/Integer.js.map +1 -1
  97. package/esm/NumberBase10Format.js +65 -65
  98. package/esm/PositiveInteger.js +44 -29
  99. package/esm/PositiveInteger.js.map +1 -1
  100. package/esm/PositiveReal.js +34 -24
  101. package/esm/PositiveReal.js.map +1 -1
  102. package/esm/Real.js +29 -18
  103. package/esm/Real.js.map +1 -1
  104. package/esm/RoundingMode.js +6 -3
  105. package/esm/RoundingMode.js.map +1 -1
  106. package/esm/RoundingOption.js +6 -6
  107. package/esm/RoundingOption.js.map +1 -1
  108. package/esm/Schema.js +33 -34
  109. package/esm/Schema.js.map +1 -1
  110. package/esm/SemVer.js +18 -18
  111. package/esm/SemVer.js.map +1 -1
  112. package/esm/Template.js +36 -31
  113. package/esm/Template.js.map +1 -1
  114. package/esm/TemplatePart.js +4 -4
  115. package/esm/TemplateParts.js +3 -2
  116. package/esm/TemplateParts.js.map +1 -1
  117. package/esm/TemplatePlaceholder.js +55 -44
  118. package/esm/TemplatePlaceholder.js.map +1 -1
  119. package/esm/TemplateSeparator.js +16 -24
  120. package/esm/TemplateSeparator.js.map +1 -1
  121. package/esm/internal/Int.js +5 -7
  122. package/esm/internal/Int.js.map +1 -1
  123. package/esm/internal/Positive.js +5 -7
  124. package/esm/internal/Positive.js.map +1 -1
  125. package/package.json +2 -2
@@ -1,16 +1,15 @@
1
1
  /**
2
- * This module implements a TemplatePlaceholder type which is a sub-type of the TemplatePart type
3
- * (see TemplatePart.ts)
2
+ * This module implements a `CVTemplatePlaceholder` type which is one of the constituents of
3
+ * `CVTemplate`'s (see Template.ts and TemplatePart.ts)
4
4
  *
5
- * A TemplatePlaceholder represents the mutable part of a template. Each Placeholder defines a
6
- * parser and a formatter:
5
+ * Each `CVTemplatePlaceholder` defines a parser and a formatter:
7
6
  *
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.
7
+ * - The parser takes a text, consumes a part of that text, optionnally converts the consumed part to
8
+ * a value of type T and, if successful, returns a `Right` of that value and of what has not been
9
+ * consumed. In case of failure, it returns a `Left`.
11
10
  * - 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.
11
+ * the result is coherent and, if so, returns a `Right` of that string. Otherwise, it returns a
12
+ * `Left`
14
13
  */
15
14
  import { MInputError, MInspectable, MPipeable, MRegExp, MRegExpString, MString, MStruct, MTuple, MTypes } from '@parischap/effect-lib';
16
15
  import { Array, Either, flow, Function, HashMap, pipe, Predicate, Schema, String, Struct, Tuple } from 'effect';
@@ -84,20 +83,21 @@ export const parser = /*#__PURE__*/Struct.get('parser');
84
83
  */
85
84
  export const formatter = /*#__PURE__*/Struct.get('formatter');
86
85
  /**
87
- * Returns the `schemaInstance` property of `self`
86
+ * Returns the `tSchemaInstance` property of `self`
88
87
  *
89
88
  * @category Destructors
90
89
  */
91
- export const schemaInstance = /*#__PURE__*/Struct.get('schemaInstance');
90
+ export const tSchemaInstance = /*#__PURE__*/Struct.get('tSchemaInstance');
92
91
  /**
93
- * Returns the description of `self`
92
+ * Returns a description of `self`, e.g. "#dd: 2-character string left-padded with '0' to unsigned
93
+ * integer."
94
94
  *
95
95
  * @category Destructors
96
96
  */
97
97
  export const getLabelledDescription = self => `${self.label}: ${self.description}`;
98
98
  /**
99
- * Returns a modified copy of `self` where a postParser function is executed after the parser of
100
- * `self` and a preFormatter function is executed before the formatter of `self`
99
+ * Returns a copy of `self` where a postParser function is executed after the parser of `self` and a
100
+ * preFormatter function is executed before the formatter of `self`
101
101
  *
102
102
  * @category Destructors
103
103
  */
@@ -118,10 +118,10 @@ export const modify = ({
118
118
  formatter: function (t1) {
119
119
  return pipe(preFormatter.call(this, t1), Either.flatMap(t => self.formatter.call(this, t)));
120
120
  },
121
- schemaInstance: t1SchemaInstance === undefined ? self.schemaInstance : t1SchemaInstance
121
+ tSchemaInstance: t1SchemaInstance === undefined ? self.tSchemaInstance : t1SchemaInstance
122
122
  });
123
123
  /**
124
- * Builds a TemplatePlaceholder instance that parses/formats exactly `length` characters from a
124
+ * Builds a `CVTemplatePlaceholder` instance that parses/formats exactly `length` characters from a
125
125
  * string. `length` must be a strictly positive integer.
126
126
  *
127
127
  * @category Constructors
@@ -148,14 +148,14 @@ export const fixedLength = ({
148
148
  name: this.label
149
149
  })(value);
150
150
  },
151
- schemaInstance: Schema.String
151
+ tSchemaInstance: Schema.String
152
152
  });
153
153
  };
154
154
  /**
155
- * Builds a TemplatePlaceholder instance that parses/formats exactly `length` characters from a
156
- * string and trims/pads the result at `padPosition` with `fillChar`. `fillChar` should be a
155
+ * Same as `fixedLength` but the consumed text is trimmed off of a `fillChar` at `fillPosition` and
156
+ * the written text is padded with a `fillChar` at `fillPosition`. `fillChar` should be a
157
157
  * one-character string. `length` must be a strictly positive integer. See the meaning of
158
- * `disallowEmptyString` in String.trim.
158
+ * `disallowEmptyString` in `MString.trim`
159
159
  *
160
160
  * @category Constructors
161
161
  */
@@ -163,17 +163,18 @@ export const paddedFixedLength = params => {
163
163
  const trimmer = flow(MString.trim(params), Either.right);
164
164
  const padder = flow(MString.pad(params), Either.right);
165
165
  return pipe(fixedLength(params), modify({
166
- descriptorMapper: MString.append(` ${MString.PadPosition.toId(params.padPosition)}-padded with '${params.fillChar}'`),
166
+ descriptorMapper: MString.append(` ${MString.FillPosition.toId(params.fillPosition)}-padded with '${params.fillChar}'`),
167
167
  postParser: trimmer,
168
168
  preFormatter: padder
169
169
  }));
170
170
  };
171
171
  /**
172
- * Builds a TemplatePlaceholder instance that parses/formats a Real in the given
173
- * `numberBase10Format`. If the number to parse/format is less than `length` characters, `fillChar`
174
- * is trimmed/padded between the sign and the number so that the length condition is respected.
175
- * fillChar must be a one-character string (but no error is triggered if you do not respect that
176
- * condition)
172
+ * Same as `fixedLength` but the parser tries to convert the consumed text into a `CVReal` using the
173
+ * passed `CVNumberBase10Format`. The formatter takes a `CVReal` and tries to convert and write it
174
+ * as an n-character string. If the number to parse/format is less than `length` characters,
175
+ * `fillChar` is trimmed/padded between the sign and the number so that the length condition is
176
+ * respected. `fillChar` must be a one-character string (but no error is triggered if you do not
177
+ * respect that condition)
177
178
  *
178
179
  * @category Constructors
179
180
  */
@@ -196,7 +197,9 @@ export const fixedLengthToReal = params => {
196
197
  }));
197
198
  };
198
199
  /**
199
- * Builds a TemplatePlaceholder instance that parses/formats a Real provided in
200
+ * Builds a `CVTemplatePlaceholder` whose parser reads from the text all the characters that it can
201
+ * interpret as a number in the provided `numberBase10Format` and converts the consumed text into a
202
+ * `CVReal`. The formatter takes a `CVReal` and converts it into a string according to the provided
200
203
  * `numberBase10Format`.
201
204
  *
202
205
  * @category Constructors
@@ -217,11 +220,11 @@ export const real = ({
217
220
  })), Either.map(Tuple.mapSecond(flow(String.length, flippedTakeRightBut(text)))));
218
221
  },
219
222
  formatter: flow(numberFormatter, Either.right),
220
- schemaInstance: CVReal.SchemaFromSelf
223
+ tSchemaInstance: CVReal.SchemaFromSelf
221
224
  });
222
225
  };
223
226
  /**
224
- * Builds a TemplatePlaceholder instance that works as a map:
227
+ * Builds a `CVTemplatePlaceholder` instance that works as a map:
225
228
  *
226
229
  * The parser expects one of the keys of `keyValuePairs` and will return the associated value. The
227
230
  * formatter expects one of the values of `keyValuePairs` and will return the associated key.
@@ -230,11 +233,11 @@ export const real = ({
230
233
  * is best if the type of the values defines a toString method. Value equality is checked with The
231
234
  * Effect Equal.equals function.
232
235
  *
233
- * `schemaInstance` is a Schema instance that transforms a value of type T into a value of type T.
234
- * It is an optional parameter. You need only provide it if you intend to use a CVTemplate built
235
- * from it within the Effect Schema module. In that case, you can build such a Schema with the
236
- * Schema.declare function. If you don't provide it and use a CVTemplate built from it within the
237
- * Effect Schema module, it will not work.
236
+ * `schemaInstance` is a `Schema` instance that transforms a value of type T into a value of type T.
237
+ * It is an optional parameter. You need only provide it if you intend to use a `CVTemplate` built
238
+ * from this `CVTemplatePlaceholder` within the `Effect.Schema` module. In that case, you can build
239
+ * such a `Schema` with the `Schema.declare` function (if you don't provide it, the `Schema` will
240
+ * return an error)
238
241
  *
239
242
  * @category Constructors
240
243
  */
@@ -264,12 +267,12 @@ export const mappedLiterals = ({
264
267
  message: `${this.label}: expected one of ${values}. Actual: ${MString.fromUnknown(value)}`
265
268
  })));
266
269
  },
267
- schemaInstance
270
+ tSchemaInstance: schemaInstance
268
271
  });
269
272
  };
270
273
  /**
271
- * Same as `mappedLiterals` but `T` is assumed to be `CVReal.Type` which should be the most usual
272
- * use case
274
+ * Same as `mappedLiterals` but `T` is assumed to be `CVReal` which should be the most usual use
275
+ * case
273
276
  *
274
277
  * @category Constructors
275
278
  */
@@ -278,8 +281,10 @@ export const realMappedLiterals = params => mappedLiterals({
278
281
  schemaInstance: CVReal.SchemaFromSelf
279
282
  });
280
283
  /**
281
- * Builds a TemplatePlaceholder instance that parses/formats the regular expression regExp. `regExp`
282
- * must start with the ^ character. Otherwise, the parser and formatter will not work properly.
284
+ * Builds a `CVTemplatePlaceholder` whose parser reads as much of the text as it can that fulfills
285
+ * the passed regular expression. The formatter only accepts a string that matches the passed
286
+ * regular expression and writes it into the text. `regExp` must start with the ^ character.
287
+ * Otherwise, the parser and formatter will not work properly.
283
288
  *
284
289
  * @category Constructors
285
290
  */
@@ -308,13 +313,16 @@ export const fulfilling = ({
308
313
  message: `${this.label}: expected ${regExpDescriptor}. Actual: '${text}'`
309
314
  })));
310
315
  },
311
- schemaInstance: Schema.String
316
+ tSchemaInstance: Schema.String
312
317
  });
313
318
  };
314
319
  /**
315
- * Builds a TemplatePlaceholder instance that parses/formats a non-empty string made up of
316
- * characters other than those contained in `forbiddenChars`. `forbiddenChars` should be an array of
317
- * 1-character strings (will not throw otherwise but strange behaviors can be expected)
320
+ * This `CVTemplatePlaceholder` instance is a special case of the `fulfilling`
321
+ * `CVTemplatePlaceholder` instance. The parser of this Placeholder reads from the text until it
322
+ * meets one of the `forbiddenChars` passed as parameter (the result must be a non-empty string).
323
+ * The formatter only accepts a non-empty string that does not contain any of the forbidden chars
324
+ * and write it to the text. `forbiddenChars` should be an array of 1-character strings (will not
325
+ * throw otherwise but strange behaviors can be expected)
318
326
  *
319
327
  * @category Constructors
320
328
  */
@@ -330,7 +338,10 @@ export const anythingBut = ({
330
338
  });
331
339
  };
332
340
  /**
333
- * Builds a TemplatePlaceholder instance that parses/formats all the remaining text.
341
+ * This `CVTemplatePlaceholder` instance is another special case of the `fulfilling`
342
+ * `CVTemplatePlaceholder` instance. The parser of this `CVTemplatePlaceholder` reads all the
343
+ * remaining text. The formatter accepts any string and writes it. This `CVTemplatePlaceholder`
344
+ * should only be used as the last `CVTemplatePart` of a `CVTemplate`.
334
345
  *
335
346
  * @category Constructors
336
347
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TemplatePlaceholder.js","names":["MInputError","MInspectable","MPipeable","MRegExp","MRegExpString","MString","MStruct","MTuple","MTypes","Array","Either","flow","Function","HashMap","pipe","Predicate","Schema","String","Struct","Tuple","CVNumberBase10Format","CVReal","moduleTag","_TypeId","Symbol","for","has","u","hasProperty","proto","_N","covariantValue","_T","invariantValue","IdSymbol","getLabelledDescription","BaseProto","_make","params","objectFromDataAndProto","make","enrichWith","label","name","prepend","get","description","parser","formatter","schemaInstance","self","modify","descriptorMapper","postParser","preFormatter","t1SchemaInstance","text","flatMap","call","mapBoth","onFirst","t","onSecond","right","all","t1","undefined","fixedLength","length","splitAt","assertLength","expected","value","paddedFixedLength","trimmer","trim","padder","pad","append","PadPosition","toId","padPosition","fillChar","fixedLengthToReal","numberBase10Format","numberParser","input","toRealParser","fromOption","Type","message","toDescription","numberFormatter","toNumberFormatter","repeat","SchemaFromSelf","real","toRealExtractor","flippedTakeRightBut","flip","takeRightBut","map","mapSecond","mappedLiterals","keyValuePairs","declare","_input","keys","getFirst","join","values","getSecond","fromUnknown","valueNameMap","swap","fromIterable","isTheStartOf","startsWith","findFirst","makeBothBy","toFirst","toSecond","realMappedLiterals","fulfilling","regExp","regExpDescriptor","match","identity","filterOrLeft","hasLength","anythingBut","forbiddenChars","forbiddenCharsAsString","notInRange","oneOrMore","atStart","fromRegExpString","toEnd"],"sources":["../../esm/TemplatePlaceholder.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;AAeA,SACCA,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,OAAO,EACPC,aAAa,EACbC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,MAAM,QACA,uBAAuB;AAE9B,SACCC,KAAK,EACLC,MAAM,EACNC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,IAAI,EAEJC,SAAS,EACTC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,KAAK,QAEC,QAAQ;AAEf,OAAO,KAAKC,oBAAoB,MAAM,yBAAyB;AAC/D,OAAO,KAAKC,MAAM,MAAM,WAAW;AAEnC;;;;;AAKA,OAAO,MAAMC,SAAS,GAAG,6CAA6C;AACtE,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,SAAS,CAAY;AAqF/D;;;;;AAKA,OAAO,MAAMI,GAAG,GAAIC,CAAU,IAAiCZ,SAAS,CAACa,WAAW,CAACD,CAAC,EAAEJ,OAAO,CAAC;AAEhG;AACA;AACA,MAAMM,KAAK,GAAmC;EAC7C,CAACN,OAAO,GAAG;IAAEO,EA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CAAC1C,IAAI,CAAC;OACvD,CAAC,CACF,CACD;IACF,CAAC;IACDR,SAAS,EAAE,SAAAA,CAAiCQ,IAAI;MAC/C,OAAO1C,IAAI,CACV0C,IAAI,EACJsE,KAAK,CAAC,IAAI,CAACpF,KAAK,CAAC,EACjBhC,MAAM,CAACsH,YAAY,CAClB3H,OAAO,CAAC4H,SAAS,CAACzE,IAAI,CAACY,MAAM,CAAC,EAC9B,MACC,IAAIpE,WAAW,CAACyF,IAAI,CAAC;QACpBC,OAAO,EAAE,GAAG,IAAI,CAAChD,KAAK,cAAcmF,gBAAgB,cAAcrE,IAAI;OACtE,CAAC,CACH,CACD;IACF,CAAC;IACDP,cAAc,EAAEjC,MAAM,CAACC;GACvB,CAAC;AACH,CAAC;AAED;;;;;;;AAOA,OAAO,MAAMiH,WAAW,GAAGA,CAAyB;EACnDvF,IAAI;EACJwF;AAAc,CAId,KAAqB;EACrB,MAAMC,sBAAsB,GAAGtH,IAAI,CAClCqH,cAAc,EACd1H,KAAK,CAACoG,IAAI,CAAC,MAAM,CAAC,EAClBxG,OAAO,CAACuC,OAAO,CAAC,KAAK,CAAC,EACtBvC,OAAO,CAACyE,MAAM,CAAC,KAAK,CAAC,CACrB;EACD,OAAO6C,UAAU,CAAC;IACjBhF,IAAI;IACJiF,MAAM,EAAE9G,IAAI,CACXqH,cAAc,EACd/H,aAAa,CAACiI,UAAU,EACxBjI,aAAa,CAACkI,SAAS,EACvBlI,aAAa,CAACmI,OAAO,EACrBpI,OAAO,CAACqI,gBAAgB,EAAE,CAC1B;IACDX,gBAAgB,EAAE,kEAAkEO,sBAAsB;GAC1G,CAAC;AACH,CAAC;AAED;;;;;AAKA,OAAO,MAAMK,KAAK,GAA4B9F,IAAO,IACpDgF,UAAU,CAAC;EACVhF,IAAI;EACJiF,MAAM,EAAE,KAAK;EACbC,gBAAgB,EAAE;CAClB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TemplatePlaceholder.js","names":["MInputError","MInspectable","MPipeable","MRegExp","MRegExpString","MString","MStruct","MTuple","MTypes","Array","Either","flow","Function","HashMap","pipe","Predicate","Schema","String","Struct","Tuple","CVNumberBase10Format","CVReal","moduleTag","_TypeId","Symbol","for","has","u","hasProperty","proto","_N","covariantValue","_T","invariantValue","IdSymbol","getLabelledDescription","BaseProto","_make","params","objectFromDataAndProto","make","enrichWith","label","name","prepend","get","description","parser","formatter","tSchemaInstance","self","modify","descriptorMapper","postParser","preFormatter","t1SchemaInstance","text","flatMap","call","mapBoth","onFirst","t","onSecond","right","all","t1","undefined","fixedLength","length","splitAt","assertLength","expected","value","paddedFixedLength","trimmer","trim","padder","pad","append","FillPosition","toId","fillPosition","fillChar","fixedLengthToReal","numberBase10Format","numberParser","input","toRealParser","fromOption","Type","message","toDescription","numberFormatter","toNumberFormatter","repeat","SchemaFromSelf","real","toRealExtractor","flippedTakeRightBut","flip","takeRightBut","map","mapSecond","mappedLiterals","keyValuePairs","schemaInstance","declare","_input","keys","getFirst","join","values","getSecond","fromUnknown","valueNameMap","swap","fromIterable","isTheStartOf","startsWith","findFirst","makeBothBy","toFirst","toSecond","realMappedLiterals","fulfilling","regExp","regExpDescriptor","match","identity","filterOrLeft","hasLength","anythingBut","forbiddenChars","forbiddenCharsAsString","notInRange","oneOrMore","atStart","fromRegExpString","toEnd"],"sources":["../../esm/TemplatePlaceholder.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;AAcA,SACCA,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,OAAO,EACPC,aAAa,EACbC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,MAAM,QACA,uBAAuB;AAE9B,SACCC,KAAK,EACLC,MAAM,EACNC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,IAAI,EAEJC,SAAS,EACTC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,KAAK,QAEC,QAAQ;AAEf,OAAO,KAAKC,oBAAoB,MAAM,yBAAyB;AAC/D,OAAO,KAAKC,MAAM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AS,EACvBnI,aAAa,CAACoI,OAAO,EACrBrI,OAAO,CAACsI,gBAAgB,EAAE,CAC1B;IACDX,gBAAgB,EAAE,kEAAkEO,sBAAsB;GAC1G,CAAC;AACH,CAAC;AAED;;;;;;;;AAQA,OAAO,MAAMK,KAAK,GAA4B/F,IAAO,IACpDiF,UAAU,CAAC;EACVjF,IAAI;EACJkF,MAAM,EAAE,KAAK;EACbC,gBAAgB,EAAE;CAClB,CAAC","ignoreList":[]}
@@ -1,13 +1,9 @@
1
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
2
+ * This module implements a `CVTemplateSeparator` type which is one of the constituents of
3
+ * `CVTemplate`'s (see Template.ts and TemplatePart.ts)
8
4
  */
9
5
  import { MInputError, MInspectable, MPipeable, MString, MTypes } from '@parischap/effect-lib';
10
- import { Either, flow, Function, Predicate, Struct } from 'effect';
6
+ import { Either, pipe, Predicate, Struct } from 'effect';
11
7
  /**
12
8
  * Module tag
13
9
  *
@@ -32,36 +28,32 @@ const proto = {
32
28
  };
33
29
  const _make = params => MTypes.objectFromDataAndProto(proto, params);
34
30
  /**
35
- * Builds a Separator instance that parses/formats a given string.
31
+ * Constructor
36
32
  *
37
33
  * @category Constructors
38
34
  */
39
35
  export const make = value => _make({
40
- value,
41
- parser: pos => flow(MInputError.assertStartsWith({
42
- startString: value,
43
- name: `remaining text for separator at position ${pos}`
44
- }), Either.map(MString.takeRightBut(value.length))),
45
- formatter: Function.constant(value)
36
+ value
46
37
  });
47
38
  /**
48
- * Returns the `value` property of `self`
49
- *
50
- * @category Destructors
51
- */
52
- export const value = /*#__PURE__*/Struct.get('value');
53
- /**
54
- * Returns the `parser` property of `self`
39
+ * Builds a parser that implements this `CVTemplateSeparator`
55
40
  *
56
41
  * @category Destructors
57
42
  */
58
- export const parser = /*#__PURE__*/Struct.get('parser');
43
+ export const toParser = self => (pos, text) => {
44
+ const value = self.value;
45
+ const length = value.length;
46
+ return pipe(text, MInputError.assertStartsWith({
47
+ startString: value,
48
+ name: `remaining text for separator at position ${pos}`
49
+ }), Either.map(MString.takeRightBut(length)));
50
+ };
59
51
  /**
60
- * Returns the `formatter` property of `self`
52
+ * Returns the `value` property of `self`
61
53
  *
62
54
  * @category Destructors
63
55
  */
64
- export const formatter = /*#__PURE__*/Struct.get('formatter');
56
+ export const value = /*#__PURE__*/Struct.get('value');
65
57
  /**
66
58
  * Slash Separator instance
67
59
  *
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateSeparator.js","names":["MInputError","MInspectable","MPipeable","MString","MTypes","Either","flow","Function","Predicate","Struct","moduleTag","_TypeId","Symbol","for","has","u","hasProperty","proto","IdSymbol","value","BaseProto","_make","params","objectFromDataAndProto","make","parser","pos","assertStartsWith","startString","name","map","takeRightBut","length","formatter","constant","get","slash","backslash","dot","hyphen","colon","comma","space"],"sources":["../../esm/TemplateSeparator.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AASA,SAASA,WAAW,EAAEC,YAAY,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,uBAAuB;AAE7F,SAASC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAYC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAE5E;;;;;AAKA,OAAO,MAAMC,SAAS,GAAG,2CAA2C;AACpE,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,SAAS,CAAY;AAsD/D;;;;;AAKA,OAAO,MAAMI,GAAG,GAAIC,CAAU,IAAgBP,SAAS,CAACQ,WAAW,CAACD,CAAC,EAAEJ,OAAO,CAAC;AAE/E;AACA,MAAMM,KAAK,GAAuB;EACjC,CAACN,OAAO,GAAGA,OAAO;EAClB,CAACV,YAAY,CAACiB,QAAQ,IAAC;IACtB,OAAO,IAAI,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AAK,gBAASjB,IAAI,CAAC,GAAG,CAAC;AAEpC;;;;;AAKA,OAAO,MAAMkB,KAAK,gBAASlB,IAAI,CAAC,GAAG,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TemplateSeparator.js","names":["MInputError","MInspectable","MPipeable","MString","MTypes","Either","pipe","Predicate","Struct","moduleTag","_TypeId","Symbol","for","has","u","hasProperty","proto","IdSymbol","value","BaseProto","_make","params","objectFromDataAndProto","make","toParser","self","pos","text","length","assertStartsWith","startString","name","map","takeRightBut","get","slash","backslash","dot","hyphen","colon","comma","space"],"sources":["../../esm/TemplateSeparator.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,SAASA,WAAW,EAAEC,YAAY,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,uBAAuB;AAE7F,SAASC,MAAM,EAAEC,IAAI,EAAYC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAElE;;;;;AAKA,OAAO,MAAMC,SAAS,GAAG,2CAA2C;AACpE,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,SAAS,CAAY;AAgB/D;;;;;AAKA,OAAO,MAAMI,GAAG,GAAIC,CAAU,IAAgBP,SAAS,CAACQ,WAAW,CAACD,CAAC,EAAEJ,OAAO,CAAC;AAE/E;AACA,MAAMM,KAAK,GAAuB;EACjC,CAACN,OAAO,GAAGA,OAAO;EAClB,CAACT,YAAY,CAACgB,QAAQ,IAAC;IACtB,OAAO,IAAI,CAACC,KAAK;EAClB,CAAC;EACD,iBAAGjB,YAAY,CAACkB,SAAS,CAACV,SAAS,CAAC;EACpC,GAAGP,SAAS,CAACiB;CACb;AAED,MAAMC,KAAK,GAAIC,MAAyB,IAAWjB,MAAM,CAACkB,sBAAsB,CAACN,KAAK,EAAEK,MAAM,CAAC;AAE/F;;;;;AAKA,OAAO,MAAME,IAAI,GAAIL,KAAa,IAAWE,KAAK,CAAC;EAAEF;AAAK,CAAE,CAAC;AAE7D;;;;;AAKA,OAAO,MAAMM,QAAQ,GACnBC,IAAU,IACX,CAACC,GAAW,EAAEC,IAAY,KAA6C;EACtE,MAAMT,KAAK,GAAGO,IAAI,CAACP,KAAK;EACxB,MAAMU,MAAM,GAAGV,KAAK,CAACU,MAAM;EAC3B,OAAOtB,IAAI,CACVqB,IAAI,EACJ3B,WAAW,CAAC6B,gBAAgB,CAAC;IAC5BC,WAAW,EAAEZ,KAAK;IAClBa,IAAI,EAAE,4CAA4CL,GAAG;GACrD,CAAC,EACFrB,MAAM,CAAC2B,GAAG,CAAC7B,OAAO,CAAC8B,YAAY,CAACL,MAAM,CAAC,CAAC,CACxC;AACF,CAAC;AAEF;;;;;AAKA,OAAO,MAAMV,KAAK,gBAAwCV,MAAM,CAAC0B,GAAG,CAAC,OAAO,CAAC;AAE7E;;;;;AAKA,OAAO,MAAMC,KAAK,gBAASZ,IAAI,CAAC,GAAG,CAAC;AAEpC;;;;;AAKA,OAAO,MAAMa,SAAS,gBAASb,IAAI,CAAC,IAAI,CAAC;AAEzC;;;;;AAKA,OAAO,MAAMc,GAAG,gBAASd,IAAI,CAAC,GAAG,CAAC;AAElC;;;;;AAKA,OAAO,MAAMe,MAAM,gBAASf,IAAI,CAAC,GAAG,CAAC;AAErC;;;;;AAKA,OAAO,MAAMgB,KAAK,gBAAShB,IAAI,CAAC,GAAG,CAAC;AAEpC;;;;;AAKA,OAAO,MAAMiB,KAAK,gBAASjB,IAAI,CAAC,GAAG,CAAC;AAEpC;;;;;AAKA,OAAO,MAAMkB,KAAK,gBAASlB,IAAI,CAAC,GAAG,CAAC","ignoreList":[]}
@@ -1,7 +1,3 @@
1
- /**
2
- * A module that implements an integer brand (non-null fractional part disallowed). Not exported.
3
- * Only used internally
4
- */
5
1
  import { MNumber, MString } from '@parischap/effect-lib';
6
2
  import { Brand, flow } from 'effect';
7
3
  /**
@@ -23,19 +19,21 @@ export const _TypeId = /*#__PURE__*/Symbol.for(_moduleTag);
23
19
  */
24
20
  export const constructor = /*#__PURE__*/Brand.refined(MNumber.isInt, /*#__PURE__*/flow(/*#__PURE__*/MString.fromNumber(10), /*#__PURE__*/MString.prepend("'"), /*#__PURE__*/MString.append("' does not represent an integer"), Brand.error));
25
21
  /**
26
- * Constructs an Option of an Int from a number.
22
+ * Tries to construct a CVInt from a number. Returns a `Some` if the conversion can be performed, a
23
+ * `None` otherwise
27
24
  *
28
25
  * @internal
29
26
  */
30
27
  export const fromNumberOption = /*#__PURE__*/constructor.option.bind(constructor);
31
28
  /**
32
- * Constructs an Either of an Int from a number.
29
+ * Tries to constructs a `CVInt` from a number. Returns a `Right` if the conversion can be
30
+ * performed, a `Left` otherwise
33
31
  *
34
32
  * @internal
35
33
  */
36
34
  export const fromNumber = /*#__PURE__*/constructor.either.bind(constructor);
37
35
  /**
38
- * Constructs an Int from a number or throws
36
+ * Constructs a `CVInt` from a number if possible. Throws otherwise
39
37
  *
40
38
  * @internal
41
39
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Int.js","names":["MNumber","MString","Brand","flow","_moduleTag","_TypeId","Symbol","for","constructor","refined","isInt","fromNumber","prepend","append","error","fromNumberOption","option","bind","either","fromNumberOrThrow"],"sources":["../../../esm/internal/Int.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,SAASA,OAAO,EAAEC,OAAO,QAAgB,uBAAuB;AAChE,SAASC,KAAK,EAAUC,IAAI,QAAgB,QAAQ;AAEpD;;;;;AAKA,MAAMC,UAAU,GAAG,6BAA6B;AAEhD;;;;;AAKA,OAAO,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,UAAU,CAAY;AAUvE;;;;;AAKA,OAAO,MAAMI,WAAW,gBAAGN,KAAK,CAACO,OAAO,CACvCT,OAAO,CAACU,KAAK,eACbP,IAAI,cACHF,OAAO,CAACU,UAAU,CAAC,EAAE,CAAC,eACtBV,OAAO,CAACW,OAAO,CAAC,GAAG,CAAC,eACpBX,OAAO,CAACY,MAAM,CAAC,iCAAiC,CAAC,EACjDX,KAAK,CAACY,KAAK,CACX,CACD;AAED;;;;;AAKA,OAAO,MAAMC,gBAAgB,gBAGzBP,WAAW,CAACQ,MAAM,CAACC,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;AAKA,OAAO,MAAMG,UAAU,gBAGnBH,WAAW,CAACU,MAAM,CAACD,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;AAKA,OAAO,MAAMW,iBAAiB,GAAwCX,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"Int.js","names":["MNumber","MString","Brand","flow","_moduleTag","_TypeId","Symbol","for","constructor","refined","isInt","fromNumber","prepend","append","error","fromNumberOption","option","bind","either","fromNumberOrThrow"],"sources":["../../../esm/internal/Int.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,OAAO,EAAEC,OAAO,QAAgB,uBAAuB;AAChE,SAASC,KAAK,EAAUC,IAAI,QAAgB,QAAQ;AAEpD;;;;;AAKA,MAAMC,UAAU,GAAG,6BAA6B;AAEhD;;;;;AAKA,OAAO,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,UAAU,CAAY;AAUvE;;;;;AAKA,OAAO,MAAMI,WAAW,gBAAGN,KAAK,CAACO,OAAO,CACvCT,OAAO,CAACU,KAAK,eACbP,IAAI,cACHF,OAAO,CAACU,UAAU,CAAC,EAAE,CAAC,eACtBV,OAAO,CAACW,OAAO,CAAC,GAAG,CAAC,eACpBX,OAAO,CAACY,MAAM,CAAC,iCAAiC,CAAC,EACjDX,KAAK,CAACY,KAAK,CACX,CACD;AAED;;;;;;AAMA,OAAO,MAAMC,gBAAgB,gBAGzBP,WAAW,CAACQ,MAAM,CAACC,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;;AAMA,OAAO,MAAMG,UAAU,gBAGnBH,WAAW,CAACU,MAAM,CAACD,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;AAKA,OAAO,MAAMW,iBAAiB,GAAwCX,WAAW","ignoreList":[]}
@@ -1,7 +1,3 @@
1
- /**
2
- * A module that implements a positive number brand (negative number disallowed). Not exported. Only
3
- * used internally
4
- */
5
1
  import { MString } from '@parischap/effect-lib';
6
2
  import { Brand, flow, Number } from 'effect';
7
3
  /**
@@ -23,19 +19,21 @@ export const _TypeId = /*#__PURE__*/Symbol.for(_moduleTag);
23
19
  */
24
20
  export const constructor = /*#__PURE__*/Brand.refined(/*#__PURE__*/Number.greaterThanOrEqualTo(0), /*#__PURE__*/flow(/*#__PURE__*/MString.fromNumber(10), /*#__PURE__*/MString.prepend("'"), /*#__PURE__*/MString.append("' is not positive"), Brand.error));
25
21
  /**
26
- * Constructs an Option of a Positive from a number.
22
+ * Tries to constructs a `CVPositive` from a number. Returns a `Some` if the conversion can be
23
+ * performed, a `None` otherwise
27
24
  *
28
25
  * @internal
29
26
  */
30
27
  export const fromNumberOption = /*#__PURE__*/constructor.option.bind(constructor);
31
28
  /**
32
- * Constructs an Either of a Positive from a number.
29
+ * Tries to construct a `CVPositive` from a number. Returns a `Right` if the conversion can be
30
+ * performed, a `Left` otherwise
33
31
  *
34
32
  * @internal
35
33
  */
36
34
  export const fromNumber = /*#__PURE__*/constructor.either.bind(constructor);
37
35
  /**
38
- * Constructs a Positive from a number or throws
36
+ * Constructs a `CVPositive` from a number if possible. Throws otherwise
39
37
  *
40
38
  * @internal
41
39
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Positive.js","names":["MString","Brand","flow","Number","_moduleTag","_TypeId","Symbol","for","constructor","refined","greaterThanOrEqualTo","fromNumber","prepend","append","error","fromNumberOption","option","bind","either","fromNumberOrThrow"],"sources":["../../../esm/internal/Positive.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,SAASA,OAAO,QAAgB,uBAAuB;AACvD,SAASC,KAAK,EAAUC,IAAI,EAAEC,MAAM,QAAgB,QAAQ;AAE5D;;;;;AAKA,OAAO,MAAMC,UAAU,GAAG,kCAAkC;AAE5D;;;;;AAKA,OAAO,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,UAAU,CAAY;AAUvE;;;;;AAKA,OAAO,MAAMI,WAAW,gBAAGP,KAAK,CAACQ,OAAO,cACvCN,MAAM,CAACO,oBAAoB,CAAC,CAAC,CAAC,eAC9BR,IAAI,cACHF,OAAO,CAACW,UAAU,CAAC,EAAE,CAAC,eACtBX,OAAO,CAACY,OAAO,CAAC,GAAG,CAAC,eACpBZ,OAAO,CAACa,MAAM,CAAC,mBAAmB,CAAC,EACnCZ,KAAK,CAACa,KAAK,CACX,CACD;AAED;;;;;AAKA,OAAO,MAAMC,gBAAgB,gBAGzBP,WAAW,CAACQ,MAAM,CAACC,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;AAKA,OAAO,MAAMG,UAAU,gBAGnBH,WAAW,CAACU,MAAM,CAACD,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;AAKA,OAAO,MAAMW,iBAAiB,GAAwCX,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"Positive.js","names":["MString","Brand","flow","Number","_moduleTag","_TypeId","Symbol","for","constructor","refined","greaterThanOrEqualTo","fromNumber","prepend","append","error","fromNumberOption","option","bind","either","fromNumberOrThrow"],"sources":["../../../esm/internal/Positive.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,OAAO,QAAgB,uBAAuB;AACvD,SAASC,KAAK,EAAUC,IAAI,EAAEC,MAAM,QAAgB,QAAQ;AAE5D;;;;;AAKA,OAAO,MAAMC,UAAU,GAAG,kCAAkC;AAE5D;;;;;AAKA,OAAO,MAAMC,OAAO,gBAAkBC,MAAM,CAACC,GAAG,CAACH,UAAU,CAAY;AAUvE;;;;;AAKA,OAAO,MAAMI,WAAW,gBAAGP,KAAK,CAACQ,OAAO,cACvCN,MAAM,CAACO,oBAAoB,CAAC,CAAC,CAAC,eAC9BR,IAAI,cACHF,OAAO,CAACW,UAAU,CAAC,EAAE,CAAC,eACtBX,OAAO,CAACY,OAAO,CAAC,GAAG,CAAC,eACpBZ,OAAO,CAACa,MAAM,CAAC,mBAAmB,CAAC,EACnCZ,KAAK,CAACa,KAAK,CACX,CACD;AAED;;;;;;AAMA,OAAO,MAAMC,gBAAgB,gBAGzBP,WAAW,CAACQ,MAAM,CAACC,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;;AAMA,OAAO,MAAMG,UAAU,gBAGnBH,WAAW,CAACU,MAAM,CAACD,IAAI,CAACT,WAAW,CAAC;AAExC;;;;;AAKA,OAAO,MAAMW,iBAAiB,GAAwCX,WAAW","ignoreList":[]}
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  }
35
35
  },
36
36
  "peerDependencies": {
37
- "@parischap/effect-lib": "^0.6.0",
37
+ "@parischap/effect-lib": "^0.7.0",
38
38
  "effect": "^3.17.13"
39
39
  },
40
40
  "repository": {
@@ -43,7 +43,7 @@
43
43
  "directory": "packages/conversions"
44
44
  },
45
45
  "homepage": "https://github.com/parischap/effect-libs/tree/master/packages/conversions",
46
- "version": "0.1.0",
46
+ "version": "0.3.0",
47
47
  "main": "./cjs/index.js",
48
48
  "types": "./dts/index.d.ts"
49
49
  }