axyseo 2.1.53 → 2.1.54

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.
@@ -52,6 +52,7 @@ class RelatedKeywordsDensityAssessment extends _assessment.default {
52
52
  } = relatedKeywords;
53
53
  let status = 'good';
54
54
  const totalWords = Object.values(words).filter(word => word.percentage === 0);
55
+ console.log("Related keyword density check: ", !hasDescription, (0, _lodash.isEmpty)(words), totalWords.length > 0);
55
56
  if (!hasDescription || (0, _lodash.isEmpty)(words) || totalWords.length > 0) {
56
57
  status = 'bad';
57
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedKeywordsDensityAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","RelatedKeywordsDensityAssessment","Assessment","constructor","config","defaultConfig","id","RELATED_KEYWORDS_DENSITY_ID","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","merge","calculateResult","data","relatedKeywords","hasDescription","words","status","totalWords","Object","values","filter","word","percentage","isEmpty","length","score","getScore","MAIN_CONTENT_POINTS","getResult","paper","researcher","getResearch","getData","result","assessmentResult","AssessmentResult","setScore","setStatus","setData","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, RELATED_KEYWORDS_DENSITY_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsDensityAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: RELATED_KEYWORDS_DENSITY_ID,\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#related-keywords',\n priority: 'high',\n title: 'Related keywords density',\n content: {\n good: 'Related keywords density optimized',\n bad:\n 'Use each secondary keyword from 0.5% to 1%. Place where it reads naturally.',\n improve: ''\n }\n };\n\n this.identifier = RELATED_KEYWORDS_DENSITY_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param hasDescription\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(data, relatedKeywords, hasDescription) {\n const {words} = relatedKeywords;\n let status = 'good';\n const totalWords = Object.values(words).filter(word => word.percentage === 0);\n if(!hasDescription || isEmpty(words) || totalWords.length > 0){\n status = 'bad';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n const hasDescription = paper.hasDescription();\n const result = this.calculateResult(data, relatedKeywords, hasDescription);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setData(result.words);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAwF,SAAAE,uBAAAG,CAAA,W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;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEa,SAASA,CAAC;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,MAAMjB,eAAe,GAAGiB,UAAU,CAACC,WAAW,CAAC,sBAAsB,CAAC;IACtE,MAAMnB,IAAI,GAAGiB,KAAK,CAACG,OAAO,CAAC,CAAC;IAC5B,MAAMlB,cAAc,GAAGe,KAAK,CAACf,cAAc,CAAC,CAAC;IAC7C,MAAMmB,MAAM,GAAG,IAAI,CAACtB,eAAe,CAACC,IAAI,EAAEC,eAAe,EAAEC,cAAc,CAAC;IAC1E,MAAMoB,gBAAgB,GAAG,IAAIC,yBAAgB,CAAC;MAACxC,MAAM,EAAE,IAAI,CAACc;IAAO,CAAC,CAAC;IAErEyB,gBAAgB,CAACE,QAAQ,CAACH,MAAM,CAACR,KAAK,CAAC;IACvCS,gBAAgB,CAACG,SAAS,CAACJ,MAAM,CAACjB,MAAM,CAAC;IACzCkB,gBAAgB,CAACI,OAAO,CAACL,MAAM,CAAClB,KAAK,CAAC;IAEtC,OAAOmB,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,YAAYA,CAACV,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF;AAACU,OAAA,CAAAjD,OAAA,GAAAC,gCAAA","ignoreList":[]}
1
+ {"version":3,"file":"RelatedKeywordsDensityAssessment.js","names":["_lodash","require","_AssessmentResult","_interopRequireDefault","_assessment","_analysis","e","__esModule","default","RelatedKeywordsDensityAssessment","Assessment","constructor","config","defaultConfig","id","RELATED_KEYWORDS_DENSITY_ID","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","merge","calculateResult","data","relatedKeywords","hasDescription","words","status","totalWords","Object","values","filter","word","percentage","console","log","isEmpty","length","score","getScore","MAIN_CONTENT_POINTS","getResult","paper","researcher","getResearch","getData","result","assessmentResult","AssessmentResult","setScore","setStatus","setData","isApplicable","exports"],"sources":["../../../../../src/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, RELATED_KEYWORDS_DENSITY_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsDensityAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: RELATED_KEYWORDS_DENSITY_ID,\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#related-keywords',\n priority: 'high',\n title: 'Related keywords density',\n content: {\n good: 'Related keywords density optimized',\n bad:\n 'Use each secondary keyword from 0.5% to 1%. Place where it reads naturally.',\n improve: ''\n }\n };\n\n this.identifier = RELATED_KEYWORDS_DENSITY_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param hasDescription\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(data, relatedKeywords, hasDescription) {\n const {words} = relatedKeywords;\n let status = 'good';\n const totalWords = Object.values(words).filter(word => word.percentage === 0);\n console.log(\"Related keyword density check: \", !hasDescription, isEmpty(words), totalWords.length > 0);\n if(!hasDescription || isEmpty(words) || totalWords.length > 0){\n status = 'bad';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n const hasDescription = paper.hasDescription();\n const result = this.calculateResult(data, relatedKeywords, hasDescription);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setData(result.words);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAwF,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExF;AACA;AACA;AACe,MAAMG,gCAAgC,SAASC,mBAAU,CAAC;EACvE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEC,qCAA2B;MAC/BC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,8FAA8F;MAChGC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,0BAA0B;MACjCC,OAAO,EAAE;QACPC,IAAI,EAAE,oCAAoC;QAC1CC,GAAG,EACD,6EAA6E;QAC/EC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGV,qCAA2B;IAC7C,IAAI,CAACW,OAAO,GAAG,IAAAC,aAAK,EAACd,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEgB,eAAeA,CA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AACnB,MAAM,CAAC;IACzCoB,gBAAgB,CAACI,OAAO,CAACL,MAAM,CAACpB,KAAK,CAAC;IAEtC,OAAOqB,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,YAAYA,CAACV,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF;AAACU,OAAA,CAAAnD,OAAA,GAAAC,gCAAA","ignoreList":[]}
@@ -46,6 +46,7 @@ export default class RelatedKeywordsDensityAssessment extends Assessment {
46
46
  } = relatedKeywords;
47
47
  let status = 'good';
48
48
  const totalWords = Object.values(words).filter(word => word.percentage === 0);
49
+ console.log("Related keyword density check: ", !hasDescription, isEmpty(words), totalWords.length > 0);
49
50
  if (!hasDescription || isEmpty(words) || totalWords.length > 0) {
50
51
  status = 'bad';
51
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedKeywordsDensityAssessment.js","names":["isEmpty","merge","AssessmentResult","Assessment","MAIN_CONTENT_POINTS","RELATED_KEYWORDS_DENSITY_ID","RelatedKeywordsDensityAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","data","relatedKeywords","hasDescription","words","status","totalWords","Object","values","filter","word","percentage","length","score","getScore","getResult","paper","researcher","getResearch","getData","result","assessmentResult","setScore","setStatus","setData","isApplicable"],"sources":["../../../../../src/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, RELATED_KEYWORDS_DENSITY_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsDensityAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: RELATED_KEYWORDS_DENSITY_ID,\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#related-keywords',\n priority: 'high',\n title: 'Related keywords density',\n content: {\n good: 'Related keywords density optimized',\n bad:\n 'Use each secondary keyword from 0.5% to 1%. Place where it reads naturally.',\n improve: ''\n }\n };\n\n this.identifier = RELATED_KEYWORDS_DENSITY_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param hasDescription\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(data, relatedKeywords, hasDescription) {\n const {words} = relatedKeywords;\n let status = 'good';\n const totalWords = Object.values(words).filter(word => word.percentage === 0);\n if(!hasDescription || isEmpty(words) || totalWords.length > 0){\n status = 'bad';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n const hasDescription = paper.hasDescription();\n const result = this.calculateResult(data, relatedKeywords, hasDescription);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setData(result.words);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return true;\n }\n}\n"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,KAAK,QAAO,QAAQ;AACrC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC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C;IAACC,KAAK;IAAEC;EAAU,CAAC,EAAE;IAC7B,MAAMf,eAAe,GAAGe,UAAU,CAACC,WAAW,CAAC,sBAAsB,CAAC;IACtE,MAAMjB,IAAI,GAAGe,KAAK,CAACG,OAAO,CAAC,CAAC;IAC5B,MAAMhB,cAAc,GAAGa,KAAK,CAACb,cAAc,CAAC,CAAC;IAC7C,MAAMiB,MAAM,GAAG,IAAI,CAACpB,eAAe,CAACC,IAAI,EAAEC,eAAe,EAAEC,cAAc,CAAC;IAC1E,MAAMkB,gBAAgB,GAAG,IAAIzC,gBAAgB,CAAC;MAACM,MAAM,EAAE,IAAI,CAACa;IAAO,CAAC,CAAC;IAErEsB,gBAAgB,CAACC,QAAQ,CAACF,MAAM,CAACP,KAAK,CAAC;IACvCQ,gBAAgB,CAACE,SAAS,CAACH,MAAM,CAACf,MAAM,CAAC;IACzCgB,gBAAgB,CAACG,OAAO,CAACJ,MAAM,CAAChB,KAAK,CAAC;IAEtC,OAAOiB,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACT,KAAK,EAAEC,UAAU,EAAE;IAC9B,OAAO,IAAI;EACb;AACF","ignoreList":[]}
1
+ {"version":3,"file":"RelatedKeywordsDensityAssessment.js","names":["isEmpty","merge","AssessmentResult","Assessment","MAIN_CONTENT_POINTS","RELATED_KEYWORDS_DENSITY_ID","RelatedKeywordsDensityAssessment","constructor","config","defaultConfig","id","fixPosition","ctaType","docUrl","priority","title","content","good","bad","improve","identifier","_config","calculateResult","data","relatedKeywords","hasDescription","words","status","totalWords","Object","values","filter","word","percentage","console","log","length","score","getScore","getResult","paper","researcher","getResearch","getData","result","assessmentResult","setScore","setStatus","setData","isApplicable"],"sources":["../../../../../src/scoring/assessments/seo/RelatedKeywordsDensityAssessment.js"],"sourcesContent":["import {isEmpty, merge} from 'lodash';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\nimport {MAIN_CONTENT_POINTS, RELATED_KEYWORDS_DENSITY_ID} from '@axyseo/const/analysis';\n\n/**\n * Represents the assessment that checks whether there are enough transition words in the text.\n */\nexport default class RelatedKeywordsDensityAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: RELATED_KEYWORDS_DENSITY_ID,\n fixPosition: 'description',\n ctaType: 'fix',\n docUrl:\n 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#related-keywords',\n priority: 'high',\n title: 'Related keywords density',\n content: {\n good: 'Related keywords density optimized',\n bad:\n 'Use each secondary keyword from 0.5% to 1%. Place where it reads naturally.',\n improve: ''\n }\n };\n\n this.identifier = RELATED_KEYWORDS_DENSITY_ID;\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param data\n * @param relatedKeywords\n * @param hasDescription\n * @returns {{score: number, status: string, words}}\n */\n calculateResult(data, relatedKeywords, hasDescription) {\n const {words} = relatedKeywords;\n let status = 'good';\n const totalWords = Object.values(words).filter(word => word.percentage === 0);\n console.log(\"Related keyword density check: \", !hasDescription, isEmpty(words), totalWords.length > 0);\n if(!hasDescription || isEmpty(words) || totalWords.length > 0){\n status = 'bad';\n }\n const score = this.getScore(MAIN_CONTENT_POINTS, status);\n\n return {\n score,\n status,\n words\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher}) {\n const relatedKeywords = researcher.getResearch('checkRelatedKeywords');\n const data = paper.getData();\n const hasDescription = paper.hasDescription();\n const result = this.calculateResult(data, relatedKeywords, hasDescription);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(result.score);\n assessmentResult.setStatus(result.status);\n assessmentResult.setData(result.words);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the transition words assessment is applicable to the paper. Language-specific length requirements and methods of counting text length\n * may apply (e.g. for Japanese, the text should be counted in characters instead of words, which also makes the minimum required length higher).\n *\n * @param {Paper} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {boolean} Returns true if the language is available, the paper is not empty and the text is longer than the minimum required length.\n */\n isApplicable(paper, researcher) {\n return true;\n }\n}\n"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,KAAK,QAAO,QAAQ;AACrC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;AACjB,SAAQC,mBAAmB,EAAEC,2BAA2B;;AAExD;AACA;AACA;AACA,eAAe,MAAMC,gCAAgC,SAASH,UAAU,CAAC;EACvE;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAEL,2BAA2B;MAC/BM,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE,KAAK;MACdC,MAAM,EACJ,8FAA8F;MAChGC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE,0BAA0B;MACjCC,OAAO,EAAE;QACPC,IAAI,EAAE,oCAAoC;QAC1CC,GAAG,EACD,6EAA6E;QAC/EC,OAAO,EAAE;MACX;IACF,CAAC;IAED,IAAI,CAACC,UAAU,GAAGf,2BAA2B;IAC7C,IAAI,CAACgB,OAAO,GAAGpB,KAAK,CAACQ,aAAa,EAAED,MAAM,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEc,eAAeA,CAACC,IAAI,EAAEC,eAAe,EAAEC,cAAc,EAAE;IACrD,MAAM;MAACC;IAAK,CAAC,GAAGF,eAAe;IAC/B,IAAIG,MAAM,GAAG,MAAM;IACnB,MAAMC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAACJ,KAAK,CAAC,CAACK,MAAM,CAACC,IAAI,IAAIA,IAAI,CAACC,UAAU,KAAK,CAAC,CAAC;IAC7EC,OAAO,CAACC,GAAG,CAAC,iCAAiC,EAAE,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
- "version": "2.1.53",
3
+ "version": "2.1.54",
4
4
  "main": "build/cjs/index.js",
5
5
  "module": "build/esm/index.js",
6
6
  "exports": {