@inseefr/lunatic 3.5.7 → 3.5.8

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 (235) hide show
  1. package/components/shared/Combobox/Combobox.stories.d.ts +3 -2
  2. package/components/shared/Combobox/Combobox.stories.js +26 -21
  3. package/components/shared/Combobox/Combobox.stories.js.map +1 -1
  4. package/esm/components/shared/Combobox/Combobox.stories.d.ts +3 -2
  5. package/esm/components/shared/Combobox/Combobox.stories.js +28 -24
  6. package/esm/components/shared/Combobox/Combobox.stories.js.map +1 -1
  7. package/esm/hooks/useLocalStorage.d.ts +1 -0
  8. package/esm/hooks/useLocalStorage.js +31 -0
  9. package/esm/hooks/useLocalStorage.js.map +1 -0
  10. package/esm/type.source.d.ts +6 -0
  11. package/esm/use-lunatic/commons/compile-controls.js +22 -14
  12. package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
  13. package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js +4 -1
  14. package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
  15. package/esm/use-lunatic/hooks/use-page-has-response.js +1 -1
  16. package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  17. package/esm/use-lunatic/hooks/useOverview.spec.js +2 -2
  18. package/esm/use-lunatic/hooks/useOverview.spec.js.map +1 -1
  19. package/esm/utils/number.d.ts +4 -0
  20. package/esm/utils/number.js +12 -0
  21. package/esm/utils/number.js.map +1 -1
  22. package/esm/utils/object.d.ts +10 -0
  23. package/esm/utils/object.js +26 -0
  24. package/esm/utils/object.js.map +1 -1
  25. package/hooks/useLocalStorage.d.ts +1 -0
  26. package/hooks/useLocalStorage.js +34 -0
  27. package/hooks/useLocalStorage.js.map +1 -0
  28. package/package.json +76 -137
  29. package/src/components/shared/Combobox/Combobox.stories.tsx +48 -49
  30. package/src/hooks/useLocalStorage.ts +37 -0
  31. package/src/json.d.ts +16 -0
  32. package/src/stories/accordion/accordion.stories.tsx +21 -0
  33. package/src/stories/behaviour/cleaning/cleaning.stories.tsx +40 -0
  34. package/src/stories/behaviour/controls/controls.stories.tsx +51 -0
  35. package/src/stories/behaviour/disabled/disabled.stories.tsx +29 -0
  36. package/src/stories/behaviour/filter/filter.stories.tsx +34 -0
  37. package/src/stories/behaviour/missing/missing.stories.tsx +31 -0
  38. package/src/stories/behaviour/overview/overview.stories.tsx +61 -0
  39. package/src/stories/{overview/sourceWithHierarchy.json → behaviour/overview/source.json} +1 -1
  40. package/src/stories/{overview → behaviour/overview}/sourceLoop.json +1 -1
  41. package/src/stories/behaviour/performance/performance.stories.tsx +29 -0
  42. package/src/stories/behaviour/resizing/resizing.stories.tsx +34 -0
  43. package/src/stories/behaviour/slots.stories.tsx +34 -0
  44. package/src/stories/checkbox/checkbox.stories.tsx +75 -0
  45. package/src/stories/{checkbox-group/sourceLoop.json → checkbox/sourceGroupLoop.json} +1 -1
  46. package/src/stories/datepicker/datepicker.stories.tsx +21 -0
  47. package/src/stories/declaration/declaration.stories.tsx +27 -0
  48. package/src/stories/dropdown/dropdown.stories.tsx +27 -0
  49. package/src/stories/duration/duration.stories.tsx +27 -0
  50. package/src/stories/filter-description/filter-description.stories.tsx +28 -0
  51. package/src/stories/input/input.stories.tsx +21 -0
  52. package/src/stories/input-number/input-number.stories.tsx +35 -0
  53. package/src/stories/loop/loop.stories.tsx +35 -0
  54. package/src/stories/loop/roster-for-loop.stories.tsx +59 -0
  55. package/src/stories/pairwise/pairwise.stories.tsx +30 -0
  56. package/src/stories/paste.stories.tsx +85 -0
  57. package/src/stories/question/question.stories.tsx +21 -0
  58. package/src/stories/questionnaires/logement/logement.stories.tsx +26 -0
  59. package/src/stories/questionnaires/recensement/recensement.stories.tsx +28 -0
  60. package/src/stories/questionnaires/rp/rp.stories.tsx +21 -0
  61. package/src/stories/questionnaires/simpsons/simpsons.stories.tsx +31 -0
  62. package/src/stories/radio/radio.stories.tsx +53 -0
  63. package/src/stories/roundabout/roundabout.stories.tsx +37 -0
  64. package/src/stories/roundabout/source.json +1 -0
  65. package/src/stories/sequence/sequence.stories.tsx +28 -0
  66. package/src/stories/suggester/source-option-responses.json +1 -1
  67. package/src/stories/suggester/suggester.stories.tsx +68 -0
  68. package/src/stories/summary/source.json +22 -1
  69. package/src/stories/summary/summary.stories.tsx +31 -0
  70. package/src/stories/table/table.stories.tsx +35 -0
  71. package/src/stories/text/text.stories.tsx +38 -0
  72. package/src/stories/textarea/textarea.stories.tsx +21 -0
  73. package/src/stories/utils/Orchestrator.tsx +310 -0
  74. package/src/stories/utils/OrchestratorData.tsx +176 -0
  75. package/src/stories/utils/OrchestratorOverview.tsx +70 -0
  76. package/src/stories/utils/OrchestratorSidebar.tsx +119 -0
  77. package/src/stories/utils/SchemaValidator.tsx +29 -0
  78. package/src/stories/utils/referentiel.ts +9 -0
  79. package/src/type.source.ts +6 -0
  80. package/src/use-lunatic/commons/compile-controls.ts +36 -18
  81. package/src/use-lunatic/commons/fill-components/fill-component-expressions.ts +4 -1
  82. package/src/use-lunatic/hooks/use-page-has-response.ts +1 -1
  83. package/src/use-lunatic/hooks/useOverview.spec.ts +3 -2
  84. package/src/use-lunatic/use-lunatic.test.ts +53 -40
  85. package/src/utils/number.ts +13 -0
  86. package/src/utils/object.ts +40 -0
  87. package/tsconfig.build.tsbuildinfo +1 -1
  88. package/type.source.d.ts +6 -0
  89. package/use-lunatic/commons/compile-controls.js +21 -13
  90. package/use-lunatic/commons/compile-controls.js.map +1 -1
  91. package/use-lunatic/commons/fill-components/fill-component-expressions.js +5 -2
  92. package/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
  93. package/use-lunatic/hooks/use-page-has-response.js +2 -2
  94. package/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  95. package/use-lunatic/hooks/useOverview.spec.js +8 -8
  96. package/use-lunatic/hooks/useOverview.spec.js.map +1 -1
  97. package/utils/number.d.ts +4 -0
  98. package/utils/number.js +13 -0
  99. package/utils/number.js.map +1 -1
  100. package/utils/object.d.ts +10 -0
  101. package/utils/object.js +30 -0
  102. package/utils/object.js.map +1 -1
  103. package/esm/stories/overview/sourceWithHierarchy.json +0 -5151
  104. package/esm/tests/utils/lunatic.d.ts +0 -15
  105. package/esm/tests/utils/lunatic.js +0 -27
  106. package/esm/tests/utils/lunatic.js.map +0 -1
  107. package/esm/use-lunatic/replace-component-sequence.d.ts +0 -36
  108. package/esm/use-lunatic/replace-component-sequence.js +0 -19
  109. package/esm/use-lunatic/replace-component-sequence.js.map +0 -1
  110. package/esm/use-lunatic/test.utils.d.ts +0 -2
  111. package/esm/use-lunatic/test.utils.js +0 -13
  112. package/esm/use-lunatic/test.utils.js.map +0 -1
  113. package/esm/utils/is-object.d.ts +0 -4
  114. package/esm/utils/is-object.js +0 -7
  115. package/esm/utils/is-object.js.map +0 -1
  116. package/esm/utils/to-number.d.ts +0 -4
  117. package/esm/utils/to-number.js +0 -13
  118. package/esm/utils/to-number.js.map +0 -1
  119. package/src/stories/accordion/accordion.stories.jsx +0 -17
  120. package/src/stories/behaviour/cleaning/cleaning.stories.jsx +0 -69
  121. package/src/stories/behaviour/controls/controls.stories.jsx +0 -81
  122. package/src/stories/behaviour/filter/dataLoop.json +0 -14
  123. package/src/stories/behaviour/filter/filter.stories.jsx +0 -36
  124. package/src/stories/behaviour/missing/missing.stories.jsx +0 -69
  125. package/src/stories/behaviour/others/V2_DeclarationsSimples.json +0 -908
  126. package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +0 -489
  127. package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +0 -3919
  128. package/src/stories/behaviour/others/V2_TCMRallyeGames.json +0 -2760
  129. package/src/stories/behaviour/others/test-dylan.json +0 -538
  130. package/src/stories/behaviour/others/test.stories.jsx +0 -78
  131. package/src/stories/behaviour/paste/source.json +0 -32
  132. package/src/stories/behaviour/paste/test.stories.jsx +0 -62
  133. package/src/stories/behaviour/performance/performance.stories.jsx +0 -26
  134. package/src/stories/behaviour/resizing/resizing.stories.jsx +0 -60
  135. package/src/stories/behaviour/slots.stories.jsx +0 -32
  136. package/src/stories/checkbox-boolean/checkboxBoolean.stories.jsx +0 -17
  137. package/src/stories/checkbox-group/checkbox-group.stories.jsx +0 -77
  138. package/src/stories/checkbox-one/checkboxOne.stories.jsx +0 -53
  139. package/src/stories/date-picker/data.json +0 -3
  140. package/src/stories/date-picker/datepicker.stories.jsx +0 -26
  141. package/src/stories/declaration/data.json +0 -1
  142. package/src/stories/declaration/input.stories.jsx +0 -18
  143. package/src/stories/disabled/data.json +0 -16
  144. package/src/stories/disabled/disabled.stories.jsx +0 -18
  145. package/src/stories/dropdown/data.json +0 -8
  146. package/src/stories/dropdown/dropdown.stories.jsx +0 -25
  147. package/src/stories/duration/duration.stories.jsx +0 -25
  148. package/src/stories/filter-description/filter-description.stories.jsx +0 -37
  149. package/src/stories/input/data.json +0 -1
  150. package/src/stories/input/input.stories.jsx +0 -18
  151. package/src/stories/input-number/input-number.stories.jsx +0 -23
  152. package/src/stories/loop/loop.stories.jsx +0 -29
  153. package/src/stories/loop/roster-for-loop.stories.jsx +0 -46
  154. package/src/stories/markdown/markdown.stories.jsx +0 -20
  155. package/src/stories/overview/data.json +0 -1
  156. package/src/stories/overview/dataLoop.json +0 -93
  157. package/src/stories/overview/overview.stories.jsx +0 -44
  158. package/src/stories/overview/source.json +0 -25
  159. package/src/stories/pairwise/data.json +0 -12
  160. package/src/stories/pairwise/pairwise-links.stories.jsx +0 -48
  161. package/src/stories/question/question.stories.jsx +0 -16
  162. package/src/stories/questionnaires/logement/logement.stories.jsx +0 -59
  163. package/src/stories/questionnaires/recensement/data.json +0 -12
  164. package/src/stories/questionnaires/recensement/recensement.stories.jsx +0 -35
  165. package/src/stories/questionnaires/rp/data.json +0 -5
  166. package/src/stories/questionnaires/rp/rp.stories.jsx +0 -23
  167. package/src/stories/questionnaires/simpsons/simpsons.stories.jsx +0 -246
  168. package/src/stories/radio/radio.stories.jsx +0 -78
  169. package/src/stories/roundabout/data1.json +0 -13
  170. package/src/stories/roundabout/data2.json +0 -16
  171. package/src/stories/roundabout/roundabout.stories.jsx +0 -32
  172. package/src/stories/sequence/sequence.stories.jsx +0 -29
  173. package/src/stories/suggester/suggester.stories.jsx +0 -71
  174. package/src/stories/summary/data.json +0 -16
  175. package/src/stories/summary/summary.stories.jsx +0 -23
  176. package/src/stories/switch/README.md +0 -29
  177. package/src/stories/switch/data-forced.json +0 -40
  178. package/src/stories/switch/source.json +0 -64
  179. package/src/stories/switch/switch.stories.jsx +0 -17
  180. package/src/stories/table/data.json +0 -1
  181. package/src/stories/table/table.stories.jsx +0 -30
  182. package/src/stories/text/data-roster.json +0 -5
  183. package/src/stories/text/text.stories.jsx +0 -20
  184. package/src/stories/textarea/data.json +0 -1
  185. package/src/stories/textarea/textarea.stories.jsx +0 -18
  186. package/src/stories/utils/SchemaValidator.jsx +0 -40
  187. package/src/stories/utils/default-arg-types.js +0 -39
  188. package/src/stories/utils/default-args.js +0 -3
  189. package/src/stories/utils/options.js +0 -19
  190. package/src/stories/utils/orchestrator.jsx +0 -267
  191. package/src/stories/utils/orchestrator.scss +0 -66
  192. package/src/stories/utils/overview.jsx +0 -39
  193. package/src/stories/utils/overview.scss +0 -37
  194. package/src/stories/utils/referentiel.js +0 -7
  195. package/src/tests/utils/e2e.js +0 -91
  196. package/src/tests/utils/lunatic.ts +0 -33
  197. package/src/use-lunatic/replace-component-sequence.ts +0 -25
  198. package/src/use-lunatic/test.utils.ts +0 -17
  199. package/src/utils/is-object.ts +0 -6
  200. package/src/utils/to-number.ts +0 -12
  201. package/stories/overview/sourceWithHierarchy.json +0 -5151
  202. package/tests/utils/lunatic.d.ts +0 -15
  203. package/tests/utils/lunatic.js +0 -31
  204. package/tests/utils/lunatic.js.map +0 -1
  205. package/use-lunatic/replace-component-sequence.d.ts +0 -36
  206. package/use-lunatic/replace-component-sequence.js +0 -22
  207. package/use-lunatic/replace-component-sequence.js.map +0 -1
  208. package/use-lunatic/test.utils.d.ts +0 -2
  209. package/use-lunatic/test.utils.js +0 -17
  210. package/use-lunatic/test.utils.js.map +0 -1
  211. package/utils/is-object.d.ts +0 -4
  212. package/utils/is-object.js +0 -10
  213. package/utils/is-object.js.map +0 -1
  214. package/utils/to-number.d.ts +0 -4
  215. package/utils/to-number.js +0 -16
  216. package/utils/to-number.js.map +0 -1
  217. /package/src/stories/behaviour/cleaning/{loop.json → source-loop-scopes.json} +0 -0
  218. /package/src/stories/behaviour/controls/{boucles-n.json → source-boucles-n.json} +0 -0
  219. /package/src/stories/behaviour/controls/{loop.json → source-loop.json} +0 -0
  220. /package/src/stories/behaviour/controls/{roundabout.json → source-roundabout.json} +0 -0
  221. /package/src/stories/behaviour/controls/{simple-numeric.json → source-simple-numeric.json} +0 -0
  222. /package/src/stories/behaviour/controls/{simple.json → source-simple.json} +0 -0
  223. /package/src/stories/{disabled → behaviour/disabled}/source.json +0 -0
  224. /package/src/stories/{checkbox-boolean → checkbox}/source.json +0 -0
  225. /package/src/stories/{checkbox-group/source.json → checkbox/sourceGroup.json} +0 -0
  226. /package/src/stories/{checkbox-group/sourceCondition.json → checkbox/sourceGroupCondition.json} +0 -0
  227. /package/src/stories/{checkbox-group/sourceDetail.json → checkbox/sourceGroupDetail.json} +0 -0
  228. /package/src/stories/{checkbox-one/source.json → checkbox/sourceOne.json} +0 -0
  229. /package/src/stories/{checkbox-one/sourceDetail.json → checkbox/sourceOneDetail.json} +0 -0
  230. /package/src/stories/{date-picker → datepicker}/source.json +0 -0
  231. /package/src/stories/{markdown/source.json → declaration/sourceMarkdown.json} +0 -0
  232. /package/src/stories/duration/{mois.json → sourceMonths.json} +0 -0
  233. /package/src/stories/duration/{time.json → sourceTime.json} +0 -0
  234. /package/src/stories/filter-description/{source-options.json → sourceOptions.json} +0 -0
  235. /package/src/stories/table/{table-dynamique.json → source-dynamic.json} +0 -0
@@ -1,15 +0,0 @@
1
- import type { LunaticData } from '../../use-lunatic/type';
2
- /**
3
- * Generate LunaticData from a record of values
4
- */
5
- export declare function generateData<T extends Record<string, unknown>>(data: T): LunaticData;
6
- export declare function generateVariable({ type, name }: {
7
- type?: string | undefined;
8
- name?: string | undefined;
9
- }): {
10
- variableType: string;
11
- name: string;
12
- values: {
13
- COLLECTED: null;
14
- };
15
- };
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateData = generateData;
4
- exports.generateVariable = generateVariable;
5
- /**
6
- * Generate LunaticData from a record of values
7
- */
8
- function generateData(data) {
9
- return {
10
- COLLECTED: Object.fromEntries(Object.entries(data).map(([key, value]) => [
11
- key,
12
- {
13
- CALCULATED: null,
14
- EXTERNAL: null,
15
- COLLECTED: value,
16
- },
17
- ])),
18
- CALCULATED: {},
19
- EXTERNAL: {},
20
- };
21
- }
22
- function generateVariable({ type = 'COLLECTED', name = 'VARIABLE' }) {
23
- return {
24
- variableType: type,
25
- name: name,
26
- values: {
27
- COLLECTED: null,
28
- },
29
- };
30
- }
31
- //# sourceMappingURL=lunatic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lunatic.js","sourceRoot":"","sources":["../../src/tests/utils/lunatic.ts"],"names":[],"mappings":";;AAKA,oCAiBC;AAED,4CAQC;AA9BD;;GAEG;AACH,SAAgB,YAAY,CAC3B,IAAO;IAEP,OAAO;QACN,SAAS,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YAC1C,GAAG;YACH;gBACC,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI;gBACd,SAAS,EAAE,KAAK;aAChB;SACD,CAAC,CACqB;QACxB,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACZ,CAAC;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE,IAAI,GAAG,UAAU,EAAE;IACzE,OAAO;QACN,YAAY,EAAE,IAAI;QAClB,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACP,SAAS,EAAE,IAAI;SACf;KACD,CAAC;AACH,CAAC"}
@@ -1,36 +0,0 @@
1
- import type { LunaticComponentDefinition } from './type';
2
- /**
3
- * Pour le Question : les composants du fieldset n'existe pas dans pages.
4
- * Ils échappent donc aux controls. On les substitue ici au Question.
5
- * On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
6
- * des composant à part entière.
7
- * D'autres composant pourraient un jour figurer ici.
8
- */
9
- export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): (import("../type.source").ComponentInputDefinition | import("../type.source").ComponentSequenceDefinition | import("../type.source").ComponentRoundaboutDefinition | ({
10
- componentType: "Loop";
11
- loopDependencies?: string[];
12
- } & import("../type.source").ComponentDefinitionBase & {
13
- components: import("../type.source").ComponentDefinitionWithPage[];
14
- iterations: import("../type.source").VTLScalarExpression;
15
- maxPage: string;
16
- paginatedLoop: true;
17
- }) | ({
18
- componentType: "Loop";
19
- loopDependencies?: string[];
20
- } & import("../type.source").ComponentDefinitionBase & {
21
- paginatedLoop: false;
22
- components: import("../type.source").ComponentDefinition[];
23
- } & {
24
- lines: {
25
- min: import("../type.source").VTLExpression;
26
- max: import("../type.source").VTLExpression;
27
- };
28
- }) | ({
29
- componentType: "Loop";
30
- loopDependencies?: string[];
31
- } & import("../type.source").ComponentDefinitionBase & {
32
- paginatedLoop: false;
33
- components: import("../type.source").ComponentDefinition[];
34
- } & {
35
- iterations: import("../type.source").VTLExpression;
36
- }) | import("../type.source").ComponentRosterForLoopDefinition | import("../type.source").ComponentTableDefinition | import("../type.source").ComponentNumberDefinition | import("../type.source").ComponentDurationDefinition | import("../type.source").ComponentDatePickerDefinition | import("../type.source").ComponentCheckboxGroupDefinition | import("../type.source").ComponentCheckboxBooleanDefinition | import("../type.source").ComponentRadioDefinition | import("../type.source").ComponentDropdownDefinition | import("../type.source").ComponentQuestionDefinition | import("../type.source").ComponentCheckboxOneDefinition | import("../type.source").ComponentSuggesterDefinition | import("../type.source").ComponentPairWiseLinksDefinition | import("../type.source").ComponentSummaryDefinition | import("../type.source").ComponentText | import("../type.source").ComponentAccordion | import("../type.source").ComponentFilterDescriptionDefinition)[];
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replaceComponentSequence = replaceComponentSequence;
4
- /**
5
- * Pour le Question : les composants du fieldset n'existe pas dans pages.
6
- * Ils échappent donc aux controls. On les substitue ici au Question.
7
- * On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
8
- * des composant à part entière.
9
- * D'autres composant pourraient un jour figurer ici.
10
- */
11
- function replaceComponentSequence(components) {
12
- return components.reduce(function (acc, component) {
13
- const { componentType } = component;
14
- switch (componentType) {
15
- case 'Question':
16
- return [...acc, ...component.components];
17
- default:
18
- return [...acc, component];
19
- }
20
- }, []);
21
- }
22
- //# sourceMappingURL=replace-component-sequence.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replace-component-sequence.js","sourceRoot":"","sources":["../src/use-lunatic/replace-component-sequence.ts"],"names":[],"mappings":";;AASA,4DAeC;AAtBD;;;;;;GAMG;AACH,SAAgB,wBAAwB,CACvC,UAA6C;IAE7C,OAAO,UAAU,CAAC,MAAM,CAAC,UACxB,GAAsC,EACtC,SAAS;QAET,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;QACpC,QAAQ,aAAa,EAAE,CAAC;YACvB,KAAK,UAAU;gBACd,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;YAC1C;gBACC,OAAO,CAAC,GAAG,GAAG,EAAE,SAAS,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC,EAAE,EAAE,CAAC,CAAC;AACR,CAAC"}
@@ -1,2 +0,0 @@
1
- import { LunaticData } from './type';
2
- export declare const dataFromObject: (o: Record<string, unknown>) => LunaticData;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataFromObject = void 0;
4
- const dataFromObject = (o) => {
5
- return {
6
- EXTERNAL: {},
7
- COLLECTED: Object.keys(o).reduce((acc, k) => ({
8
- ...acc,
9
- [k]: {
10
- COLLECTED: o[k],
11
- },
12
- }), {}),
13
- CALCULATED: {},
14
- };
15
- };
16
- exports.dataFromObject = dataFromObject;
17
- //# sourceMappingURL=test.utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.utils.js","sourceRoot":"","sources":["../src/use-lunatic/test.utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,CAA0B,EAAe,EAAE;IACzE,OAAO;QACN,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACZ,GAAG,GAAG;YACN,CAAC,CAAC,CAAC,EAAE;gBACJ,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;aACf;SACD,CAAC,EACF,EAAE,CACF;QACD,UAAU,EAAE,EAAE;KACd,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB"}
@@ -1,4 +0,0 @@
1
- /**
2
- * isObject function with type narrowing
3
- */
4
- export declare function isObject(v: unknown): v is Record<string, unknown>;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isObject = isObject;
4
- /**
5
- * isObject function with type narrowing
6
- */
7
- function isObject(v) {
8
- return typeof v === 'object' && v !== null;
9
- }
10
- //# sourceMappingURL=is-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-object.js","sourceRoot":"","sources":["../src/utils/is-object.ts"],"names":[],"mappings":";;AAGA,4BAEC;AALD;;GAEG;AACH,SAAgB,QAAQ,CAAC,CAAU;IAClC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;AAC5C,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Convert an unknown value into a number
3
- */
4
- export declare function toNumber(v: unknown): number | null;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toNumber = toNumber;
4
- /**
5
- * Convert an unknown value into a number
6
- */
7
- function toNumber(v) {
8
- if (typeof v === 'number') {
9
- return v;
10
- }
11
- if (typeof v === 'string') {
12
- return parseInt(v, 10);
13
- }
14
- return null;
15
- }
16
- //# sourceMappingURL=to-number.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-number.js","sourceRoot":"","sources":["../src/utils/to-number.ts"],"names":[],"mappings":";;AAGA,4BAQC;AAXD;;GAEG;AACH,SAAgB,QAAQ,CAAC,CAAU;IAClC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACV,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}