@serenity-js/core 2.32.4 → 3.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/lib/index.d.ts +2 -1
  3. package/lib/index.js +4 -1
  4. package/lib/index.js.map +1 -1
  5. package/lib/io/ErrorSerialiser.js +4 -1
  6. package/lib/io/ErrorSerialiser.js.map +1 -1
  7. package/lib/io/asyncMap.d.ts +8 -0
  8. package/lib/io/asyncMap.js +18 -0
  9. package/lib/io/asyncMap.js.map +1 -0
  10. package/lib/io/format.d.ts +37 -0
  11. package/lib/io/format.js +49 -0
  12. package/lib/io/format.js.map +1 -0
  13. package/lib/io/formatted.d.ts +5 -1
  14. package/lib/io/formatted.js +6 -13
  15. package/lib/io/formatted.js.map +1 -1
  16. package/lib/io/index.d.ts +2 -1
  17. package/lib/io/index.js +2 -1
  18. package/lib/io/index.js.map +1 -1
  19. package/lib/io/inspected.d.ts +9 -1
  20. package/lib/io/inspected.js +50 -14
  21. package/lib/io/inspected.js.map +1 -1
  22. package/lib/model/Timestamp.d.ts +4 -2
  23. package/lib/model/Timestamp.js +8 -2
  24. package/lib/model/Timestamp.js.map +1 -1
  25. package/lib/screenplay/Question.d.ts +6 -83
  26. package/lib/screenplay/Question.js +14 -98
  27. package/lib/screenplay/Question.js.map +1 -1
  28. package/lib/screenplay/actor/Actor.js +2 -2
  29. package/lib/screenplay/actor/Actor.js.map +1 -1
  30. package/lib/screenplay/index.d.ts +1 -1
  31. package/lib/screenplay/index.js +1 -1
  32. package/lib/screenplay/index.js.map +1 -1
  33. package/lib/screenplay/model/Adapter.d.ts +8 -0
  34. package/lib/{io/collections/reducible.js → screenplay/model/Adapter.js} +1 -1
  35. package/lib/screenplay/model/Adapter.js.map +1 -0
  36. package/lib/screenplay/model/createAdapter.d.ts +3 -0
  37. package/lib/screenplay/model/createAdapter.js +112 -0
  38. package/lib/screenplay/model/createAdapter.js.map +1 -0
  39. package/lib/screenplay/model/index.d.ts +2 -0
  40. package/lib/screenplay/{tasks → model}/index.js +2 -1
  41. package/lib/screenplay/model/index.js.map +1 -0
  42. package/lib/screenplay/questions/Expectation.d.ts +11 -0
  43. package/lib/screenplay/questions/Expectation.js +18 -1
  44. package/lib/screenplay/questions/Expectation.js.map +1 -1
  45. package/lib/screenplay/questions/List.d.ts +22 -191
  46. package/lib/screenplay/questions/List.js +162 -208
  47. package/lib/screenplay/questions/List.js.map +1 -1
  48. package/lib/screenplay/questions/Note.d.ts +10 -0
  49. package/lib/screenplay/questions/Note.js +17 -1
  50. package/lib/screenplay/questions/Note.js.map +1 -1
  51. package/lib/screenplay/questions/index.d.ts +0 -3
  52. package/lib/screenplay/questions/index.js +0 -5
  53. package/lib/screenplay/questions/index.js.map +1 -1
  54. package/package.json +7 -7
  55. package/src/index.ts +2 -1
  56. package/src/io/ErrorSerialiser.ts +5 -1
  57. package/src/io/asyncMap.ts +18 -0
  58. package/src/io/format.ts +46 -0
  59. package/src/io/formatted.ts +7 -15
  60. package/src/io/index.ts +2 -1
  61. package/src/io/inspected.ts +66 -14
  62. package/src/model/Timestamp.ts +10 -2
  63. package/src/screenplay/Question.ts +21 -119
  64. package/src/screenplay/actor/Actor.ts +2 -2
  65. package/src/screenplay/index.ts +1 -1
  66. package/src/screenplay/model/Adapter.ts +14 -0
  67. package/src/screenplay/model/createAdapter.ts +142 -0
  68. package/src/screenplay/model/index.ts +2 -0
  69. package/src/screenplay/questions/Expectation.ts +20 -1
  70. package/src/screenplay/questions/List.ts +228 -232
  71. package/src/screenplay/questions/Note.ts +21 -1
  72. package/src/screenplay/questions/index.ts +0 -3
  73. package/lib/io/collections/index.d.ts +0 -2
  74. package/lib/io/collections/index.js +0 -15
  75. package/lib/io/collections/index.js.map +0 -1
  76. package/lib/io/collections/mappable.d.ts +0 -52
  77. package/lib/io/collections/mappable.js +0 -28
  78. package/lib/io/collections/mappable.js.map +0 -1
  79. package/lib/io/collections/reducible.d.ts +0 -16
  80. package/lib/io/collections/reducible.js.map +0 -1
  81. package/lib/screenplay/questions/Property.d.ts +0 -91
  82. package/lib/screenplay/questions/Property.js +0 -99
  83. package/lib/screenplay/questions/Property.js.map +0 -1
  84. package/lib/screenplay/questions/Transform.d.ts +0 -31
  85. package/lib/screenplay/questions/Transform.js +0 -46
  86. package/lib/screenplay/questions/Transform.js.map +0 -1
  87. package/lib/screenplay/questions/lists/ArrayListAdapter.d.ts +0 -88
  88. package/lib/screenplay/questions/lists/ArrayListAdapter.js +0 -152
  89. package/lib/screenplay/questions/lists/ArrayListAdapter.js.map +0 -1
  90. package/lib/screenplay/questions/lists/ListAdapter.d.ts +0 -20
  91. package/lib/screenplay/questions/lists/ListAdapter.js +0 -3
  92. package/lib/screenplay/questions/lists/ListAdapter.js.map +0 -1
  93. package/lib/screenplay/questions/lists/index.d.ts +0 -2
  94. package/lib/screenplay/questions/lists/index.js +0 -15
  95. package/lib/screenplay/questions/lists/index.js.map +0 -1
  96. package/lib/screenplay/questions/mappings/AnswerMappingFunction.d.ts +0 -11
  97. package/lib/screenplay/questions/mappings/AnswerMappingFunction.js +0 -3
  98. package/lib/screenplay/questions/mappings/AnswerMappingFunction.js.map +0 -1
  99. package/lib/screenplay/questions/mappings/index.d.ts +0 -2
  100. package/lib/screenplay/questions/mappings/index.js +0 -15
  101. package/lib/screenplay/questions/mappings/index.js.map +0 -1
  102. package/lib/screenplay/questions/mappings/string/append.d.ts +0 -14
  103. package/lib/screenplay/questions/mappings/string/append.js +0 -25
  104. package/lib/screenplay/questions/mappings/string/append.js.map +0 -1
  105. package/lib/screenplay/questions/mappings/string/index.d.ts +0 -11
  106. package/lib/screenplay/questions/mappings/string/index.js +0 -24
  107. package/lib/screenplay/questions/mappings/string/index.js.map +0 -1
  108. package/lib/screenplay/questions/mappings/string/normalize.d.ts +0 -20
  109. package/lib/screenplay/questions/mappings/string/normalize.js +0 -30
  110. package/lib/screenplay/questions/mappings/string/normalize.js.map +0 -1
  111. package/lib/screenplay/questions/mappings/string/replace.d.ts +0 -17
  112. package/lib/screenplay/questions/mappings/string/replace.js +0 -30
  113. package/lib/screenplay/questions/mappings/string/replace.js.map +0 -1
  114. package/lib/screenplay/questions/mappings/string/slice.d.ts +0 -28
  115. package/lib/screenplay/questions/mappings/string/slice.js +0 -47
  116. package/lib/screenplay/questions/mappings/string/slice.js.map +0 -1
  117. package/lib/screenplay/questions/mappings/string/split.d.ts +0 -19
  118. package/lib/screenplay/questions/mappings/string/split.js +0 -36
  119. package/lib/screenplay/questions/mappings/string/split.js.map +0 -1
  120. package/lib/screenplay/questions/mappings/string/toLocaleLowerCase.d.ts +0 -17
  121. package/lib/screenplay/questions/mappings/string/toLocaleLowerCase.js +0 -28
  122. package/lib/screenplay/questions/mappings/string/toLocaleLowerCase.js.map +0 -1
  123. package/lib/screenplay/questions/mappings/string/toLocaleUpperCase.d.ts +0 -17
  124. package/lib/screenplay/questions/mappings/string/toLocaleUpperCase.js +0 -29
  125. package/lib/screenplay/questions/mappings/string/toLocaleUpperCase.js.map +0 -1
  126. package/lib/screenplay/questions/mappings/string/toLowerCase.d.ts +0 -10
  127. package/lib/screenplay/questions/mappings/string/toLowerCase.js +0 -19
  128. package/lib/screenplay/questions/mappings/string/toLowerCase.js.map +0 -1
  129. package/lib/screenplay/questions/mappings/string/toNumber.d.ts +0 -10
  130. package/lib/screenplay/questions/mappings/string/toNumber.js +0 -18
  131. package/lib/screenplay/questions/mappings/string/toNumber.js.map +0 -1
  132. package/lib/screenplay/questions/mappings/string/toUpperCase.d.ts +0 -10
  133. package/lib/screenplay/questions/mappings/string/toUpperCase.js +0 -19
  134. package/lib/screenplay/questions/mappings/string/toUpperCase.js.map +0 -1
  135. package/lib/screenplay/questions/mappings/string/trim.d.ts +0 -12
  136. package/lib/screenplay/questions/mappings/string/trim.js +0 -21
  137. package/lib/screenplay/questions/mappings/string/trim.js.map +0 -1
  138. package/lib/screenplay/questions/proxies/PropertyPathKey.d.ts +0 -4
  139. package/lib/screenplay/questions/proxies/PropertyPathKey.js +0 -3
  140. package/lib/screenplay/questions/proxies/PropertyPathKey.js.map +0 -1
  141. package/lib/screenplay/questions/proxies/createMetaQuestionProxy.d.ts +0 -14
  142. package/lib/screenplay/questions/proxies/createMetaQuestionProxy.js +0 -35
  143. package/lib/screenplay/questions/proxies/createMetaQuestionProxy.js.map +0 -1
  144. package/lib/screenplay/questions/proxies/createQuestionProxy.d.ts +0 -13
  145. package/lib/screenplay/questions/proxies/createQuestionProxy.js +0 -34
  146. package/lib/screenplay/questions/proxies/createQuestionProxy.js.map +0 -1
  147. package/lib/screenplay/questions/proxies/describePath.d.ts +0 -5
  148. package/lib/screenplay/questions/proxies/describePath.js +0 -19
  149. package/lib/screenplay/questions/proxies/describePath.js.map +0 -1
  150. package/lib/screenplay/questions/proxies/index.d.ts +0 -2
  151. package/lib/screenplay/questions/proxies/index.js +0 -15
  152. package/lib/screenplay/questions/proxies/index.js.map +0 -1
  153. package/lib/screenplay/questions/proxies/key.d.ts +0 -8
  154. package/lib/screenplay/questions/proxies/key.js +0 -16
  155. package/lib/screenplay/questions/proxies/key.js.map +0 -1
  156. package/lib/screenplay/tasks/Loop.d.ts +0 -198
  157. package/lib/screenplay/tasks/Loop.js +0 -222
  158. package/lib/screenplay/tasks/Loop.js.map +0 -1
  159. package/lib/screenplay/tasks/index.d.ts +0 -1
  160. package/lib/screenplay/tasks/index.js.map +0 -1
  161. package/src/io/collections/index.ts +0 -2
  162. package/src/io/collections/mappable.ts +0 -60
  163. package/src/io/collections/reducible.ts +0 -16
  164. package/src/screenplay/questions/Property.ts +0 -98
  165. package/src/screenplay/questions/Transform.ts +0 -51
  166. package/src/screenplay/questions/lists/ArrayListAdapter.ts +0 -186
  167. package/src/screenplay/questions/lists/ListAdapter.ts +0 -33
  168. package/src/screenplay/questions/lists/index.ts +0 -2
  169. package/src/screenplay/questions/mappings/AnswerMappingFunction.ts +0 -13
  170. package/src/screenplay/questions/mappings/index.ts +0 -2
  171. package/src/screenplay/questions/mappings/string/append.ts +0 -28
  172. package/src/screenplay/questions/mappings/string/index.ts +0 -11
  173. package/src/screenplay/questions/mappings/string/normalize.ts +0 -33
  174. package/src/screenplay/questions/mappings/string/replace.ts +0 -34
  175. package/src/screenplay/questions/mappings/string/slice.ts +0 -53
  176. package/src/screenplay/questions/mappings/string/split.ts +0 -38
  177. package/src/screenplay/questions/mappings/string/toLocaleLowerCase.ts +0 -31
  178. package/src/screenplay/questions/mappings/string/toLocaleUpperCase.ts +0 -30
  179. package/src/screenplay/questions/mappings/string/toLowerCase.ts +0 -20
  180. package/src/screenplay/questions/mappings/string/toNumber.ts +0 -19
  181. package/src/screenplay/questions/mappings/string/toUpperCase.ts +0 -20
  182. package/src/screenplay/questions/mappings/string/trim.ts +0 -22
  183. package/src/screenplay/questions/proxies/PropertyPathKey.ts +0 -4
  184. package/src/screenplay/questions/proxies/createMetaQuestionProxy.ts +0 -51
  185. package/src/screenplay/questions/proxies/createQuestionProxy.ts +0 -49
  186. package/src/screenplay/questions/proxies/describePath.ts +0 -23
  187. package/src/screenplay/questions/proxies/index.ts +0 -2
  188. package/src/screenplay/questions/proxies/key.ts +0 -14
  189. package/src/screenplay/tasks/Loop.ts +0 -240
  190. package/src/screenplay/tasks/index.ts +0 -1
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toLocaleLowerCase = void 0;
4
- /* eslint-disable unicorn/consistent-function-scoping */
5
- const tiny_types_1 = require("tiny-types");
6
- /**
7
- * @desc
8
- * Returns the calling string value converted to upper case, according to any locale-specific case mappings.
9
- *
10
- * @param {Answerable<string | string[]>} [locales]
11
- * The `locale` parameter indicates the locale to be used to convert to lower case according to any
12
- * locale-specific case mappings. If multiple locales are given in an `Array`,
13
- * the [best available locale](https://tc39.es/ecma402/#sec-bestavailablelocale) is used.
14
- * The default locale is the host environment’s current locale.
15
- *
16
- * @returns {AnswerMappingFunction<string, string>}
17
- *
18
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase
19
- */
20
- function toLocaleLowerCase(locales) {
21
- return (actor) => (value) => {
22
- (0, tiny_types_1.ensure)('The value to be mapped', value, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)());
23
- return actor.answer(locales)
24
- .then(l => value.toLocaleLowerCase(l));
25
- };
26
- }
27
- exports.toLocaleLowerCase = toLocaleLowerCase;
28
- //# sourceMappingURL=toLocaleLowerCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toLocaleLowerCase.js","sourceRoot":"","sources":["../../../../../src/screenplay/questions/mappings/string/toLocaleLowerCase.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAyD;AAMzD;;;;;;;;;;;;;GAaG;AACH,SAAgB,iBAAiB,CAAC,OAAuC;IACrE,OAAO,CAAC,KAAuB,EAAE,EAAE,CAC/B,CAAC,KAAa,EAAE,EAAE;QACd,IAAA,mBAAM,EAAC,wBAAwB,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,GAAE,CAAC,CAAC;QAEjE,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;aACvB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAA;AAET,CAAC;AATD,8CASC"}
@@ -1,17 +0,0 @@
1
- import { AnswerMappingFunction } from '../AnswerMappingFunction';
2
- /**
3
- * @desc
4
- * Returns a string where all alphabetic characters have been converted to uppercase,
5
- * taking into account the host environment's current locale.
6
- *
7
- * @param {Answerable<string | string[]>} [locales]
8
- * The `locale` parameter indicates the locale to be used to convert to lower case according to any
9
- * locale-specific case mappings. If multiple locales are given in an `Array`,
10
- * the [best available locale](https://tc39.es/ecma402/#sec-bestavailablelocale) is used.
11
- * The default locale is the host environment’s current locale.
12
- *
13
- * @returns {AnswerMappingFunction<string, string>}
14
- *
15
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase
16
- */
17
- export declare function toLocaleUpperCase(locales?: string | string[]): AnswerMappingFunction<string, string>;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toLocaleUpperCase = void 0;
4
- /* eslint-disable unicorn/consistent-function-scoping */
5
- const tiny_types_1 = require("tiny-types");
6
- /**
7
- * @desc
8
- * Returns a string where all alphabetic characters have been converted to uppercase,
9
- * taking into account the host environment's current locale.
10
- *
11
- * @param {Answerable<string | string[]>} [locales]
12
- * The `locale` parameter indicates the locale to be used to convert to lower case according to any
13
- * locale-specific case mappings. If multiple locales are given in an `Array`,
14
- * the [best available locale](https://tc39.es/ecma402/#sec-bestavailablelocale) is used.
15
- * The default locale is the host environment’s current locale.
16
- *
17
- * @returns {AnswerMappingFunction<string, string>}
18
- *
19
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase
20
- */
21
- function toLocaleUpperCase(locales) {
22
- return (actor) => (value) => {
23
- (0, tiny_types_1.ensure)('The value to be mapped', value, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)());
24
- return actor.answer(locales)
25
- .then(l => value.toLocaleUpperCase(l));
26
- };
27
- }
28
- exports.toLocaleUpperCase = toLocaleUpperCase;
29
- //# sourceMappingURL=toLocaleUpperCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toLocaleUpperCase.js","sourceRoot":"","sources":["../../../../../src/screenplay/questions/mappings/string/toLocaleUpperCase.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAyD;AAKzD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,iBAAiB,CAAC,OAA2B;IACzD,OAAO,CAAC,KAAuB,EAAE,EAAE,CAC/B,CAAC,KAAa,EAAE,EAAE;QACd,IAAA,mBAAM,EAAC,wBAAwB,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,GAAE,CAAC,CAAC;QAEjE,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;aACvB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAA;AACT,CAAC;AARD,8CAQC"}
@@ -1,10 +0,0 @@
1
- import { AnswerMappingFunction } from '../AnswerMappingFunction';
2
- /**
3
- * @desc
4
- * Converts all the alphabetic characters in a string to lowercase.
5
- *
6
- * @returns {AnswerMappingFunction<string, string>}
7
- *
8
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
9
- */
10
- export declare function toLowerCase(): AnswerMappingFunction<string, string>;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toLowerCase = void 0;
4
- /* eslint-disable unicorn/consistent-function-scoping */
5
- const tiny_types_1 = require("tiny-types");
6
- /**
7
- * @desc
8
- * Converts all the alphabetic characters in a string to lowercase.
9
- *
10
- * @returns {AnswerMappingFunction<string, string>}
11
- *
12
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
13
- */
14
- function toLowerCase() {
15
- return (actor) => (value) => (0, tiny_types_1.ensure)('The value to be mapped', value, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)())
16
- .toLowerCase();
17
- }
18
- exports.toLowerCase = toLowerCase;
19
- //# sourceMappingURL=toLowerCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toLowerCase.js","sourceRoot":"","sources":["../../../../../src/screenplay/questions/mappings/string/toLowerCase.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAyD;AAKzD;;;;;;;GAOG;AACH,SAAgB,WAAW;IACvB,OAAO,CAAC,KAAuB,EAAE,EAAE,CAC/B,CAAC,KAAa,EAAE,EAAE,CACd,IAAA,mBAAM,EAAC,wBAAwB,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,GAAE,CAAC;SAC3D,WAAW,EAAE,CAAC;AAC/B,CAAC;AALD,kCAKC"}
@@ -1,10 +0,0 @@
1
- import { AnswerMappingFunction } from '../AnswerMappingFunction';
2
- /**
3
- * @desc
4
- * Converts a `string` to a `number`.
5
- *
6
- * @returns {AnswerMappingFunction<string, string>}
7
- *
8
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number
9
- */
10
- export declare function toNumber(): AnswerMappingFunction<string, number>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toNumber = void 0;
4
- /* eslint-disable unicorn/consistent-function-scoping */
5
- const tiny_types_1 = require("tiny-types");
6
- /**
7
- * @desc
8
- * Converts a `string` to a `number`.
9
- *
10
- * @returns {AnswerMappingFunction<string, string>}
11
- *
12
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number
13
- */
14
- function toNumber() {
15
- return (actor) => (value) => Number((0, tiny_types_1.ensure)('value', value, (0, tiny_types_1.isDefined)()));
16
- }
17
- exports.toNumber = toNumber;
18
- //# sourceMappingURL=toNumber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toNumber.js","sourceRoot":"","sources":["../../../../../src/screenplay/questions/mappings/string/toNumber.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAA+C;AAK/C;;;;;;;GAOG;AACH,SAAgB,QAAQ;IACpB,OAAO,CAAC,KAAuB,EAAE,EAAE,CAC/B,CAAC,KAAa,EAAE,EAAE,CACd,MAAM,CAAC,IAAA,mBAAM,EAAC,OAAO,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC,CAAC;AACxD,CAAC;AAJD,4BAIC"}
@@ -1,10 +0,0 @@
1
- import { AnswerMappingFunction } from '../AnswerMappingFunction';
2
- /**
3
- * @desc
4
- * Converts all the alphabetic characters in a string to uppercase.
5
- *
6
- * @returns {AnswerMappingFunction<string, string>}
7
- *
8
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
9
- */
10
- export declare function toUpperCase(): AnswerMappingFunction<string, string>;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toUpperCase = void 0;
4
- /* eslint-disable unicorn/consistent-function-scoping */
5
- const tiny_types_1 = require("tiny-types");
6
- /**
7
- * @desc
8
- * Converts all the alphabetic characters in a string to uppercase.
9
- *
10
- * @returns {AnswerMappingFunction<string, string>}
11
- *
12
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
13
- */
14
- function toUpperCase() {
15
- return (actor) => (value) => (0, tiny_types_1.ensure)('The value to be mapped', value, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)())
16
- .toUpperCase();
17
- }
18
- exports.toUpperCase = toUpperCase;
19
- //# sourceMappingURL=toUpperCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toUpperCase.js","sourceRoot":"","sources":["../../../../../src/screenplay/questions/mappings/string/toUpperCase.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAyD;AAKzD;;;;;;;GAOG;AACH,SAAgB,WAAW;IACvB,OAAO,CAAC,KAAuB,EAAE,EAAE,CAC/B,CAAC,KAAa,EAAE,EAAE,CACd,IAAA,mBAAM,EAAC,wBAAwB,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,GAAE,CAAC;SAC3D,WAAW,EAAE,CAAC;AAC/B,CAAC;AALD,kCAKC"}
@@ -1,12 +0,0 @@
1
- import { AnswerMappingFunction } from '../AnswerMappingFunction';
2
- /**
3
- * @desc
4
- * Removes whitespace from both ends of a string.
5
- * Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.)
6
- * and all the line terminator characters (LF, CR, etc.).
7
- *
8
- * @returns {AnswerMappingFunction<string, string>}
9
- *
10
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim
11
- */
12
- export declare function trim(): AnswerMappingFunction<string, string>;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trim = void 0;
4
- /* eslint-disable unicorn/consistent-function-scoping */
5
- const tiny_types_1 = require("tiny-types");
6
- /**
7
- * @desc
8
- * Removes whitespace from both ends of a string.
9
- * Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.)
10
- * and all the line terminator characters (LF, CR, etc.).
11
- *
12
- * @returns {AnswerMappingFunction<string, string>}
13
- *
14
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim
15
- */
16
- function trim() {
17
- return (actor) => (value) => (0, tiny_types_1.ensure)('The value to be mapped', value, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)())
18
- .trim();
19
- }
20
- exports.trim = trim;
21
- //# sourceMappingURL=trim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trim.js","sourceRoot":"","sources":["../../../../../src/screenplay/questions/mappings/string/trim.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAyD;AAKzD;;;;;;;;;GASG;AACH,SAAgB,IAAI;IAChB,OAAO,CAAC,KAAuB,EAAE,EAAE,CAC/B,CAAC,KAAa,EAAE,EAAE,CACd,IAAA,mBAAM,EAAC,wBAAwB,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,GAAE,CAAC;SAC3D,IAAI,EAAE,CAAC;AACxB,CAAC;AALD,oBAKC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * @package
3
- */
4
- export declare type PropertyPathKey = string | symbol | number;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PropertyPathKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyPathKey.js","sourceRoot":"","sources":["../../../../src/screenplay/questions/proxies/PropertyPathKey.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- import { Answerable } from '../../Answerable';
2
- import { Question } from '../../Question';
3
- import { MetaQuestion } from '../MetaQuestion';
4
- import { PropertyPathKey } from './PropertyPathKey';
5
- /**
6
- * @package
7
- */
8
- export declare type WithPropertiesAsMetaQuestions<Original_Type, Nested_Type = Original_Type> = {
9
- [Key in keyof Nested_Type]: Nested_Type[Key] extends object ? Question<Promise<Nested_Type[Key]>> & MetaQuestion<Answerable<Original_Type>, Promise<Nested_Type[Key]>> & WithPropertiesAsMetaQuestions<Original_Type, Nested_Type[Key]> : Question<Promise<Nested_Type[Key]>> & MetaQuestion<Answerable<Original_Type>, Promise<Nested_Type[Key]>>;
10
- };
11
- /**
12
- * @package
13
- */
14
- export declare function createMetaQuestionProxy<Original_Type extends object>(path?: PropertyPathKey[]): WithPropertiesAsMetaQuestions<Original_Type>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createMetaQuestionProxy = void 0;
4
- /* eslint-disable @typescript-eslint/ban-types */
5
- const io_1 = require("../../../io");
6
- const Question_1 = require("../../Question");
7
- const describePath_1 = require("./describePath");
8
- const key_1 = require("./key");
9
- /**
10
- * @package
11
- */
12
- function createMetaQuestionProxy(path = []) {
13
- const empty = {};
14
- return new Proxy(empty, {
15
- get(target, name) {
16
- if ((0, key_1.key)(name).isOneOf('of')) {
17
- return function of(subject) {
18
- return Question_1.Question.about((0, io_1.formatted) `property ${(0, describePath_1.describePath)(path)} of ${subject}`, actor => {
19
- return actor.answer(subject).then(answer => {
20
- return path.reduce((subObject, keyName, index) => {
21
- if (keyName in subObject) {
22
- return subObject[keyName];
23
- }
24
- throw new Error((0, io_1.formatted) `property ${(0, describePath_1.describePath)(path.slice(0, index + 1))} of ${subject} doesn't exist`);
25
- }, answer);
26
- });
27
- });
28
- };
29
- }
30
- return createMetaQuestionProxy(path.concat(name));
31
- }
32
- });
33
- }
34
- exports.createMetaQuestionProxy = createMetaQuestionProxy;
35
- //# sourceMappingURL=createMetaQuestionProxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMetaQuestionProxy.js","sourceRoot":"","sources":["../../../../src/screenplay/questions/proxies/createMetaQuestionProxy.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,oCAAwC;AAExC,6CAA0C;AAE1C,iDAA8C;AAC9C,+BAA4B;AAY5B;;GAEG;AACH,SAAgB,uBAAuB,CAA+B,OAA0B,EAAE;IAE9F,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,OAAO,IAAI,KAAK,CAAgB,KAAY,EAAE;QAC1C,GAAG,CAAC,MAAe,EAAE,IAAqB;YAEtC,IAAI,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC,OAAO,CAAwD,IAAI,CAAC,EAAE;gBAEhF,OAAO,SAAS,EAAE,CAAC,OAAkC;oBAEjD,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAA,cAAS,EAAC,YAAa,IAAA,2BAAY,EAAC,IAAI,CAAE,OAAQ,OAAQ,EAAE,EAAE,KAAK,CAAC,EAAE;wBACxF,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;4BAEvC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;gCAC7C,IAAI,OAAO,IAAI,SAAS,EAAE;oCACtB,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;iCAC7B;gCACD,MAAM,IAAI,KAAK,CAAC,IAAA,cAAS,EAAC,YAAa,IAAA,2BAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAE,OAAQ,OAAQ,gBAAgB,CAAC,CAAC;4BACpH,CAAC,EAAE,MAAM,CAAC,CAAC;wBAEf,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAA;aACJ;YAED,OAAO,uBAAuB,CAAgB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,CAAC;KACJ,CAAiD,CAAC;AACvD,CAAC;AA7BD,0DA6BC"}
@@ -1,13 +0,0 @@
1
- import { Answerable } from '../../Answerable';
2
- import { Question } from '../../Question';
3
- import { PropertyPathKey } from './PropertyPathKey';
4
- /**
5
- * @package
6
- */
7
- export declare type WithPropertiesAsQuestions<Original_Type> = {
8
- [Key in keyof Original_Type]: Original_Type[Key] extends object ? Question<Promise<Original_Type[Key]>> & WithPropertiesAsQuestions<Original_Type[Key]> : Question<Promise<Original_Type[Key]>>;
9
- };
10
- /**
11
- * @package
12
- */
13
- export declare function createQuestionProxy<Original_Type extends object>(subject: Answerable<Original_Type>, path?: PropertyPathKey[]): WithPropertiesAsQuestions<Original_Type>;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createQuestionProxy = void 0;
4
- /* eslint-disable @typescript-eslint/ban-types */
5
- const io_1 = require("../../../io");
6
- const Question_1 = require("../../Question");
7
- const describePath_1 = require("./describePath");
8
- const key_1 = require("./key");
9
- /**
10
- * @package
11
- */
12
- function createQuestionProxy(subject, path = []) {
13
- const empty = {};
14
- return new Proxy(empty, {
15
- get(target, name) {
16
- if ((0, key_1.key)(name).isOneOf('answeredBy', 'describedAs', 'map', 'toString')) {
17
- const question = Question_1.Question.about((0, io_1.formatted) `property ${(0, describePath_1.describePath)(path)} of ${subject}`, actor => {
18
- return actor.answer(subject).then(answer => {
19
- return path.reduce((subObject, keyName, index) => {
20
- if (keyName in subObject) {
21
- return subObject[keyName];
22
- }
23
- throw new Error((0, io_1.formatted) `property ${(0, describePath_1.describePath)(path.slice(0, index + 1))} of ${subject} doesn't exist`);
24
- }, answer);
25
- });
26
- });
27
- return question[name].bind(question); // eslint-disable-line unicorn/prefer-prototype-methods
28
- }
29
- return createQuestionProxy(subject, path.concat(name));
30
- }
31
- });
32
- }
33
- exports.createQuestionProxy = createQuestionProxy;
34
- //# sourceMappingURL=createQuestionProxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createQuestionProxy.js","sourceRoot":"","sources":["../../../../src/screenplay/questions/proxies/createQuestionProxy.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,oCAAwC;AAExC,6CAA0C;AAC1C,iDAA8C;AAC9C,+BAA4B;AAY5B;;GAEG;AACH,SAAgB,mBAAmB,CAA+B,OAAkC,EAAE,OAA0B,EAAE;IAE9H,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,OAAO,IAAI,KAAK,CAAgB,KAAY,EAAE;QAC1C,GAAG,CAAC,MAAe,EAAE,IAAqB;YAEtC,IAAI,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC,OAAO,CAAgB,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE;gBAElF,MAAM,QAAQ,GAAG,mBAAQ,CAAC,KAAK,CAAC,IAAA,cAAS,EAAC,YAAa,IAAA,2BAAY,EAAC,IAAI,CAAE,OAAQ,OAAQ,EAAE,EAAE,KAAK,CAAC,EAAE;oBAClG,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;wBAEvC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;4BAC7C,IAAI,OAAO,IAAI,SAAS,EAAE;gCACtB,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;6BAC7B;4BACD,MAAM,IAAI,KAAK,CAAC,IAAA,cAAS,EAAC,YAAa,IAAA,2BAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAE,OAAQ,OAAQ,gBAAgB,CAAC,CAAC;wBACpH,CAAC,EAAE,MAAM,CAAC,CAAC;oBAEf,CAAC,CAAC,CAAA;gBACN,CAAC,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAG,uDAAuD;aAClG;YAED,OAAO,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,CAAC;KACJ,CAA6C,CAAC;AACnD,CAAC;AA5BD,kDA4BC"}
@@ -1,5 +0,0 @@
1
- import { PropertyPathKey } from './PropertyPathKey';
2
- /**
3
- * @package
4
- */
5
- export declare function describePath(parts: PropertyPathKey[]): string;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.describePath = void 0;
4
- /**
5
- * @package
6
- */
7
- function describePath(parts) {
8
- return parts.reduce((acc, segment) => acc.concat(isNumber(segment)
9
- ? `[${segment}]`
10
- : segment), []).join('.');
11
- }
12
- exports.describePath = describePath;
13
- /**
14
- * @private
15
- */
16
- function isNumber(segment) {
17
- return Number.parseInt(String(segment), 10).toString() === segment;
18
- }
19
- //# sourceMappingURL=describePath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"describePath.js","sourceRoot":"","sources":["../../../../src/screenplay/questions/proxies/describePath.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACjD,OAAO,KAAK,CAAC,MAAM,CACf,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CACb,GAAG,CAAC,MAAM,CACN,QAAQ,CAAC,OAAO,CAAC;QACb,CAAC,CAAC,IAAK,OAAQ,GAAG;QAClB,CAAC,CAAC,OAAO,CAChB,EACL,EAAE,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC;AAVD,oCAUC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,OAAwB;IACtC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC;AACvE,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './createMetaQuestionProxy';
2
- export * from './createQuestionProxy';
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./createMetaQuestionProxy"), exports);
14
- __exportStar(require("./createQuestionProxy"), exports);
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/screenplay/questions/proxies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAA0C;AAC1C,wDAAsC"}
@@ -1,8 +0,0 @@
1
- import { PropertyPathKey } from './PropertyPathKey';
2
- /**
3
- * @package
4
- * @param {PropertyPathKey} keyName
5
- */
6
- export declare function key(keyName: PropertyPathKey): {
7
- isOneOf<T extends object = object>(...keys: (keyof T)[]): boolean;
8
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.key = void 0;
4
- /**
5
- * @package
6
- * @param {PropertyPathKey} keyName
7
- */
8
- function key(keyName) {
9
- return {
10
- isOneOf(...keys) {
11
- return !!~keys.indexOf(keyName);
12
- }
13
- };
14
- }
15
- exports.key = key;
16
- //# sourceMappingURL=key.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"key.js","sourceRoot":"","sources":["../../../../src/screenplay/questions/proxies/key.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,SAAgB,GAAG,CAAC,OAAwB;IACxC,OAAO;QACH,OAAO,CAA4B,GAAG,IAAoB;YACtD,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAc,CAAC,CAAC;QAC3C,CAAC;KACJ,CAAA;AACL,CAAC;AAND,kBAMC"}