optimized-react-component-library-xyz123 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -841,26 +841,24 @@ var normalize = (str) => {
841
841
  function CreateApiDataObject(data, specialMappedQuestions, translatedAnswers) {
842
842
  return data.reduce((acc, question) => {
843
843
  var _a;
844
- let translatedAnswer = question.Answer;
845
- if (question.Answer && typeof question.Answer === "string" && Array.isArray(question.Options) && question.QuestionId && specialMappedQuestions.has(question.QuestionId)) {
846
- const answerNormalized = normalize(question.Answer);
847
- const matchingIds = question.Options.filter(
848
- (option) => answerNormalized.includes(normalize(option.label))
849
- ).map((option) => `^${option.id}^`);
844
+ let translatedAnswer = question.answer;
845
+ if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
846
+ const answerNormalized = normalize(question.answer);
847
+ const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.label))).map((option) => `^${option.id}^`);
850
848
  if (matchingIds.length > 0) {
851
849
  translatedAnswer = matchingIds.join(",");
852
850
  }
853
851
  } else {
854
- const shouldTranslate = question.QuestionId ? translatedAnswers[question.QuestionId] : void 0;
855
- translatedAnswer = shouldTranslate ? shouldTranslate[question.Answer] || question.Answer : question.Answer;
852
+ const shouldTranslate = question.mappingId ? translatedAnswers[question.mappingId] : void 0;
853
+ translatedAnswer = shouldTranslate ? shouldTranslate[question.answer] || question.answer : question.answer;
856
854
  }
857
855
  return {
858
856
  ...acc,
859
- ...question.QuestionId && question.isDisplayed && question.Answer && {
860
- [question.QuestionId]: translatedAnswer
857
+ ...question.mappingId && question.isDisplayed && question.answer && {
858
+ [question.mappingId]: translatedAnswer
861
859
  },
862
- ...question.QuestionType === "AddFiles" && ((_a = question.Files) == null ? void 0 : _a.length) && question.Files.length > 0 && {
863
- files: question.Files
860
+ ...question.questionType === "AddFiles" && ((_a = question.files) == null ? void 0 : _a.length) && question.files.length > 0 && {
861
+ files: question.files
864
862
  }
865
863
  };
866
864
  }, {});
package/dist/index.mjs CHANGED
@@ -777,26 +777,24 @@ var normalize = (str) => {
777
777
  function CreateApiDataObject(data, specialMappedQuestions, translatedAnswers) {
778
778
  return data.reduce((acc, question) => {
779
779
  var _a;
780
- let translatedAnswer = question.Answer;
781
- if (question.Answer && typeof question.Answer === "string" && Array.isArray(question.Options) && question.QuestionId && specialMappedQuestions.has(question.QuestionId)) {
782
- const answerNormalized = normalize(question.Answer);
783
- const matchingIds = question.Options.filter(
784
- (option) => answerNormalized.includes(normalize(option.label))
785
- ).map((option) => `^${option.id}^`);
780
+ let translatedAnswer = question.answer;
781
+ if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
782
+ const answerNormalized = normalize(question.answer);
783
+ const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.label))).map((option) => `^${option.id}^`);
786
784
  if (matchingIds.length > 0) {
787
785
  translatedAnswer = matchingIds.join(",");
788
786
  }
789
787
  } else {
790
- const shouldTranslate = question.QuestionId ? translatedAnswers[question.QuestionId] : void 0;
791
- translatedAnswer = shouldTranslate ? shouldTranslate[question.Answer] || question.Answer : question.Answer;
788
+ const shouldTranslate = question.mappingId ? translatedAnswers[question.mappingId] : void 0;
789
+ translatedAnswer = shouldTranslate ? shouldTranslate[question.answer] || question.answer : question.answer;
792
790
  }
793
791
  return {
794
792
  ...acc,
795
- ...question.QuestionId && question.isDisplayed && question.Answer && {
796
- [question.QuestionId]: translatedAnswer
793
+ ...question.mappingId && question.isDisplayed && question.answer && {
794
+ [question.mappingId]: translatedAnswer
797
795
  },
798
- ...question.QuestionType === "AddFiles" && ((_a = question.Files) == null ? void 0 : _a.length) && question.Files.length > 0 && {
799
- files: question.Files
796
+ ...question.questionType === "AddFiles" && ((_a = question.files) == null ? void 0 : _a.length) && question.files.length > 0 && {
797
+ files: question.files
800
798
  }
801
799
  };
802
800
  }, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "A modern React component library using TypeScript with React 19 support.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",