@vannizhang/living-atlas-content-validator 1.5.21 → 1.5.23
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/configureSettings.d.ts +0 -103
- package/dist/configureSettings.js +1 -43
- package/dist/configureSettings.js.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/accessInformation/isValidAccessInformation.d.ts +0 -8
- package/dist/lib/accessInformation/isValidAccessInformation.js +0 -12
- package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
- package/dist/lib/accessInformation/scoringConfig.js +0 -4
- package/dist/lib/accessInformation/scoringConfig.js.map +1 -1
- package/dist/lib/checkProfanities/checkProfanities.d.ts +0 -5
- package/dist/lib/checkProfanities/checkProfanities.js +0 -8
- package/dist/lib/checkProfanities/checkProfanities.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js +0 -35
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/config.d.ts +0 -84
- package/dist/lib/checkTitleAndSnippetSearchability/config.js +0 -17
- package/dist/lib/checkTitleAndSnippetSearchability/config.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/data.js +0 -692
- package/dist/lib/checkTitleAndSnippetSearchability/data.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +0 -94
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +0 -105
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +1 -111
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js +1 -113
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js +0 -113
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.d.ts +0 -30
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js +1 -115
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js +0 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -1
- package/dist/lib/config.d.ts +0 -16
- package/dist/lib/config.js +0 -140
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.d.ts +0 -8
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +0 -11
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
- package/dist/lib/deleteProtection/scoringConfig.js +0 -1
- package/dist/lib/deleteProtection/scoringConfig.js.map +1 -1
- package/dist/lib/deprecated/isDeprecated.d.ts +0 -8
- package/dist/lib/deprecated/isDeprecated.js +0 -9
- package/dist/lib/deprecated/isDeprecated.js.map +1 -1
- package/dist/lib/deprecated/scoringConfig.js +0 -1
- package/dist/lib/deprecated/scoringConfig.js.map +1 -1
- package/dist/lib/description/findDataSource.d.ts +0 -10
- package/dist/lib/description/findDataSource.js +0 -22
- package/dist/lib/description/findDataSource.js.map +1 -1
- package/dist/lib/description/isValidDescription.d.ts +0 -17
- package/dist/lib/description/isValidDescription.js +0 -52
- package/dist/lib/description/isValidDescription.js.map +1 -1
- package/dist/lib/description/scoringConfig.js +0 -1
- package/dist/lib/description/scoringConfig.js.map +1 -1
- package/dist/lib/description/scoringRulesConfig.js +0 -47
- package/dist/lib/description/scoringRulesConfig.js.map +1 -1
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.d.ts +0 -8
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.js +0 -12
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.js.map +1 -1
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.d.ts +0 -6
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.js +0 -12
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.js.map +1 -1
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.d.ts +0 -8
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.js +0 -16
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.js.map +1 -1
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.d.ts +0 -5
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.js +0 -9
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +0 -23
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +0 -43
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/helpers.d.ts +0 -16
- package/dist/lib/featureServiceFieldAliases/helpers.js +5 -21
- package/dist/lib/featureServiceFieldAliases/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +0 -22
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +0 -58
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/helpers.d.ts +0 -17
- package/dist/lib/featureServiceFieldDescriptions/helpers.js +5 -22
- package/dist/lib/featureServiceFieldDescriptions/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.d.ts +0 -8
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.js +0 -8
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.js.map +1 -1
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.d.ts +0 -5
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.js +0 -6
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +0 -19
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +0 -40
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/helpers.d.ts +0 -13
- package/dist/lib/featureServiceFieldValueTypes/helpers.js +2 -15
- package/dist/lib/featureServiceFieldValueTypes/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js.map +1 -1
- package/dist/lib/itemExtent/checkItemExtent.d.ts +0 -25
- package/dist/lib/itemExtent/checkItemExtent.js +0 -30
- package/dist/lib/itemExtent/checkItemExtent.js.map +1 -1
- package/dist/lib/itemExtent/checkItemExtentHelpers.d.ts +0 -31
- package/dist/lib/itemExtent/checkItemExtentHelpers.js +0 -36
- package/dist/lib/itemExtent/checkItemExtentHelpers.js.map +1 -1
- package/dist/lib/licenseInfo/isValidLicenseInfo.d.ts +0 -32
- package/dist/lib/licenseInfo/isValidLicenseInfo.js +2 -49
- package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
- package/dist/lib/licenseInfo/scoringConfig.js +0 -1
- package/dist/lib/licenseInfo/scoringConfig.js.map +1 -1
- package/dist/lib/licenseInfo/scoringRulesConfig.js +0 -47
- package/dist/lib/licenseInfo/scoringRulesConfig.js.map +1 -1
- package/dist/lib/sharing/isValidAccess.d.ts +0 -20
- package/dist/lib/sharing/isValidAccess.js +2 -28
- package/dist/lib/sharing/isValidAccess.js.map +1 -1
- package/dist/lib/sharing/scoringConfig.js +0 -1
- package/dist/lib/sharing/scoringConfig.js.map +1 -1
- package/dist/lib/sharing/scoringRulesConfig.js +0 -47
- package/dist/lib/sharing/scoringRulesConfig.js.map +1 -1
- package/dist/lib/ssl/isValidSSL.d.ts +0 -12
- package/dist/lib/ssl/isValidSSL.js +6 -31
- package/dist/lib/ssl/isValidSSL.js.map +1 -1
- package/dist/lib/ssl/scoringConfig.js +0 -4
- package/dist/lib/ssl/scoringConfig.js.map +1 -1
- package/dist/lib/ssl/scoringRulesConfig.js +0 -41
- package/dist/lib/ssl/scoringRulesConfig.js.map +1 -1
- package/dist/lib/summary/isValidSummary.d.ts +0 -15
- package/dist/lib/summary/isValidSummary.js +1 -47
- package/dist/lib/summary/isValidSummary.js.map +1 -1
- package/dist/lib/summary/scoringConfig.js +0 -1
- package/dist/lib/summary/scoringConfig.js.map +1 -1
- package/dist/lib/summary/scoringRulesConfig.js +0 -53
- package/dist/lib/summary/scoringRulesConfig.js.map +1 -1
- package/dist/lib/tags/isValidTags.d.ts +0 -12
- package/dist/lib/tags/isValidTags.js +1 -20
- package/dist/lib/tags/isValidTags.js.map +1 -1
- package/dist/lib/tags/scoringConfig.js +0 -5
- package/dist/lib/tags/scoringConfig.js.map +1 -1
- package/dist/lib/tags/scoringRulesConfig.js +0 -41
- package/dist/lib/tags/scoringRulesConfig.js.map +1 -1
- package/dist/lib/thumbnail/isValidThumbnail.d.ts +0 -8
- package/dist/lib/thumbnail/isValidThumbnail.js +1 -30
- package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
- package/dist/lib/thumbnail/scoringConfig.js +0 -9
- package/dist/lib/thumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/thumbnail/scoringRulesConfig.js +0 -41
- package/dist/lib/thumbnail/scoringRulesConfig.js.map +1 -1
- package/dist/lib/title/isValidTitle.d.ts +0 -21
- package/dist/lib/title/isValidTitle.js +1 -55
- package/dist/lib/title/isValidTitle.js.map +1 -1
- package/dist/lib/title/scoringConfig.js +0 -1
- package/dist/lib/title/scoringConfig.js.map +1 -1
- package/dist/lib/title/scoringRulesConfig.js +0 -52
- package/dist/lib/title/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.d.ts +0 -21
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +2 -76
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.js +0 -1
- package/dist/lib/userProfileDescription/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringRulesConfig.js +0 -59
- package/dist/lib/userProfileDescription/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileName/isValidUserProfileName.d.ts +0 -8
- package/dist/lib/userProfileName/isValidUserProfileName.js +2 -26
- package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
- package/dist/lib/userProfileName/scoringConfig.js +0 -5
- package/dist/lib/userProfileName/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileName/scoringRulesConfig.js +0 -41
- package/dist/lib/userProfileName/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.d.ts +0 -12
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +3 -27
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringConfig.js +0 -4
- package/dist/lib/userProfileThumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js +0 -35
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js.map +1 -1
- package/dist/lib/util/assertString.d.ts +0 -10
- package/dist/lib/util/assertString.js +0 -11
- package/dist/lib/util/assertString.js.map +1 -1
- package/dist/lib/util/checkIsLayer.d.ts +0 -5
- package/dist/lib/util/checkIsLayer.js +0 -5
- package/dist/lib/util/checkIsLayer.js.map +1 -1
- package/dist/lib/util/contains.d.ts +0 -6
- package/dist/lib/util/contains.js +0 -7
- package/dist/lib/util/contains.js.map +1 -1
- package/dist/lib/util/containsNonEnglishCharacters.d.ts +0 -12
- package/dist/lib/util/containsNonEnglishCharacters.js +2 -16
- package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -1
- package/dist/lib/util/countSentences.d.ts +0 -22
- package/dist/lib/util/countSentences.js +4 -36
- package/dist/lib/util/countSentences.js.map +1 -1
- package/dist/lib/util/createWordBoundaryRegex.d.ts +0 -40
- package/dist/lib/util/createWordBoundaryRegex.js +0 -47
- package/dist/lib/util/createWordBoundaryRegex.js.map +1 -1
- package/dist/lib/util/escapeSpecialCharacters.d.ts +0 -6
- package/dist/lib/util/escapeSpecialCharacters.js +0 -8
- package/dist/lib/util/escapeSpecialCharacters.js.map +1 -1
- package/dist/lib/util/getAllValidationRuleIds.d.ts +0 -4
- package/dist/lib/util/getAllValidationRuleIds.js +0 -4
- package/dist/lib/util/getAllValidationRuleIds.js.map +1 -1
- package/dist/lib/util/getFeatureLayerFieldValueTypes.d.ts +0 -8
- package/dist/lib/util/getFeatureLayerFieldValueTypes.js +0 -8
- package/dist/lib/util/getFeatureLayerFieldValueTypes.js.map +1 -1
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.d.ts +0 -17
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js +0 -17
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -1
- package/dist/lib/util/getNumberOfWords.d.ts +0 -5
- package/dist/lib/util/getNumberOfWords.js +1 -15
- package/dist/lib/util/getNumberOfWords.js.map +1 -1
- package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +0 -11
- package/dist/lib/util/getRelevantFeatureLayerFields.js +0 -11
- package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -1
- package/dist/lib/util/getScoringRules.d.ts +0 -17
- package/dist/lib/util/getScoringRules.js +0 -105
- package/dist/lib/util/getScoringRules.js.map +1 -1
- package/dist/lib/util/getThumbnailFileName.d.ts +0 -14
- package/dist/lib/util/getThumbnailFileName.js +0 -14
- package/dist/lib/util/getThumbnailFileName.js.map +1 -1
- package/dist/lib/util/isArcGISDomain.d.ts +0 -5
- package/dist/lib/util/isArcGISDomain.js +0 -5
- package/dist/lib/util/isArcGISDomain.js.map +1 -1
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.d.ts +0 -5
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js +0 -5
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js.map +1 -1
- package/dist/lib/util/isDefined.d.ts +0 -7
- package/dist/lib/util/isDefined.js +0 -7
- package/dist/lib/util/isDefined.js.map +1 -1
- package/dist/lib/util/isEmail.d.ts +0 -5
- package/dist/lib/util/isEmail.js +0 -5
- package/dist/lib/util/isEmail.js.map +1 -1
- package/dist/lib/util/isEmpty.d.ts +0 -5
- package/dist/lib/util/isEmpty.js +0 -5
- package/dist/lib/util/isEmpty.js.map +1 -1
- package/dist/lib/util/isFeatureCollection.d.ts +0 -5
- package/dist/lib/util/isFeatureCollection.js +0 -5
- package/dist/lib/util/isFeatureCollection.js.map +1 -1
- package/dist/lib/util/isFeatureService.d.ts +0 -11
- package/dist/lib/util/isFeatureService.js +0 -13
- package/dist/lib/util/isFeatureService.js.map +1 -1
- package/dist/lib/util/isHosted.d.ts +0 -5
- package/dist/lib/util/isHosted.js +0 -5
- package/dist/lib/util/isHosted.js.map +1 -1
- package/dist/lib/util/isLatin.d.ts +0 -5
- package/dist/lib/util/isLatin.js +0 -5
- package/dist/lib/util/isLatin.js.map +1 -1
- package/dist/lib/util/isLayer.d.ts +0 -10
- package/dist/lib/util/isLayer.js +1 -13
- package/dist/lib/util/isLayer.js.map +1 -1
- package/dist/lib/util/isSecureProtocol.d.ts +0 -5
- package/dist/lib/util/isSecureProtocol.js +0 -5
- package/dist/lib/util/isSecureProtocol.js.map +1 -1
- package/dist/lib/util/isUppercase.d.ts +0 -3
- package/dist/lib/util/isUppercase.js +0 -3
- package/dist/lib/util/isUppercase.js.map +1 -1
- package/dist/lib/util/isUrl.d.ts +0 -8
- package/dist/lib/util/isUrl.js +1 -11
- package/dist/lib/util/isUrl.js.map +1 -1
- package/dist/lib/util/isValidRegexPattern.d.ts +0 -6
- package/dist/lib/util/isValidRegexPattern.js +0 -6
- package/dist/lib/util/isValidRegexPattern.js.map +1 -1
- package/dist/lib/util/matches.d.ts +0 -11
- package/dist/lib/util/matches.js +0 -11
- package/dist/lib/util/matches.js.map +1 -1
- package/dist/lib/util/round.js +0 -4
- package/dist/lib/util/round.js.map +1 -1
- package/dist/lib/util/sanitizeTags.d.ts +0 -5
- package/dist/lib/util/sanitizeTags.js +0 -5
- package/dist/lib/util/sanitizeTags.js.map +1 -1
- package/dist/lib/util/shouldValidateByBetaRules.d.ts +0 -7
- package/dist/lib/util/shouldValidateByBetaRules.js +0 -31
- package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
- package/dist/lib/util/stringsConfig.d.ts +0 -21
- package/dist/lib/util/stringsConfig.js +0 -38
- package/dist/lib/util/stringsConfig.js.map +1 -1
- package/dist/lib/util/toString.d.ts +0 -10
- package/dist/lib/util/toString.js +0 -10
- package/dist/lib/util/toString.js.map +1 -1
- package/dist/lib/validate/validate.d.ts +0 -64
- package/dist/lib/validate/validate.js +1 -52
- package/dist/lib/validate/validate.js.map +1 -1
- package/dist/lib/validate/validateHelpers.d.ts +0 -57
- package/dist/lib/validate/validateHelpers.js +1 -72
- package/dist/lib/validate/validateHelpers.js.map +1 -1
- package/dist/package-info.json +1 -1
- package/dist/services/content-validator-assets/config.d.ts +0 -3
- package/dist/services/content-validator-assets/config.js +0 -3
- package/dist/services/content-validator-assets/config.js.map +1 -1
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.d.ts +0 -93
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +0 -33
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -1
- package/dist/services/content-validator-assets/fetchProfanitiesData.d.ts +0 -24
- package/dist/services/content-validator-assets/fetchProfanitiesData.js +0 -19
- package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -1
- package/dist/services/content-validator-assets/helpers.d.ts +0 -14
- package/dist/services/content-validator-assets/helpers.js +1 -15
- package/dist/services/content-validator-assets/helpers.js.map +1 -1
- package/dist/services/custom-terms/config.d.ts +0 -11
- package/dist/services/custom-terms/config.js +0 -41
- package/dist/services/custom-terms/config.js.map +1 -1
- package/dist/services/custom-terms/customTerms.d.ts +0 -170
- package/dist/services/custom-terms/customTerms.js +4 -169
- package/dist/services/custom-terms/customTerms.js.map +1 -1
- package/dist/services/custom-terms/helpers.d.ts +0 -6
- package/dist/services/custom-terms/helpers.js +0 -6
- package/dist/services/custom-terms/helpers.js.map +1 -1
- package/dist/services/custom-terms-review-results/config.d.ts +0 -16
- package/dist/services/custom-terms-review-results/config.js +0 -42
- package/dist/services/custom-terms-review-results/config.js.map +1 -1
- package/dist/services/custom-terms-review-results/customTermsReviewResults.d.ts +0 -93
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js +0 -87
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -1
- package/dist/services/custom-terms-review-results/helpers.d.ts +0 -15
- package/dist/services/custom-terms-review-results/helpers.js +0 -16
- package/dist/services/custom-terms-review-results/helpers.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.d.ts +0 -12
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.js +3 -13
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +0 -12
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +5 -32
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.d.ts +0 -14
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.js +5 -30
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.js.map +1 -1
- package/dist/services/feature-service/getFeatureServerURL.d.ts +0 -11
- package/dist/services/feature-service/getFeatureServerURL.js +2 -14
- package/dist/services/feature-service/getFeatureServerURL.js.map +1 -1
- package/dist/services/shared/addFeatures.d.ts +0 -11
- package/dist/services/shared/addFeatures.js +0 -11
- package/dist/services/shared/addFeatures.js.map +1 -1
- package/dist/services/shared/applyEdits.d.ts +0 -11
- package/dist/services/shared/applyEdits.js +0 -11
- package/dist/services/shared/applyEdits.js.map +1 -1
- package/dist/services/shared/config.d.ts +0 -38
- package/dist/services/shared/config.js +0 -22
- package/dist/services/shared/config.js.map +1 -1
- package/dist/services/shared/getItemInfo.d.ts +0 -12
- package/dist/services/shared/getItemInfo.js +1 -16
- package/dist/services/shared/getItemInfo.js.map +1 -1
- package/dist/types/index.d.ts +1 -330
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,14 +4,6 @@ exports.checkFeatureServiceFieldIndexes = void 0;
|
|
|
4
4
|
const isFeatureService_1 = require("../util/isFeatureService");
|
|
5
5
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
6
6
|
const featureServiceFieldIndexesHelpers_1 = require("./featureServiceFieldIndexesHelpers");
|
|
7
|
-
/**
|
|
8
|
-
* Check if feature layers have appropriate field indexes set.
|
|
9
|
-
* @param item ArcGIS Online item to validate
|
|
10
|
-
* @param featureLayers Array of feature layers JSON objects from the feature service
|
|
11
|
-
* @returns ValidationInfo object containing the validation result
|
|
12
|
-
*
|
|
13
|
-
* @see https://developers.arcgis.com/documentation/portal-and-data-services/data-services/feature-services/field-and-spatial-indexes/
|
|
14
|
-
*/
|
|
15
7
|
const checkFeatureServiceFieldIndexes = (item, featureLayers) => {
|
|
16
8
|
const strings = (0, stringsConfig_1.getStringsConfig)();
|
|
17
9
|
const { LABEL, TITLE, IMRPOVE_FIELD_INDEXES } = strings.featureServiceFieldIndexes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceFieldIndexes.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.ts"],"names":[],"mappings":";;;AAOA,+DAA4D;AAC5D,yDAAyD;AACzD,2FAAwF;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceFieldIndexes.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.ts"],"names":[],"mappings":";;;AAOA,+DAA4D;AAC5D,yDAAyD;AACzD,2FAAwF;AAUjF,MAAM,+BAA+B,GAAG,CAC3C,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACzC,OAAO,CAAC,0BAA0B,CAAC;IAEvC,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,+BAA+B;QACjD,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,CAAC;QAChB,MAAM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
* This function filters out system field indexes from the provided array of field indexes.
|
|
4
|
-
* @param fieldIndexes Field indexes array from Feature Layer JSON
|
|
5
|
-
* @returns Non-system field indexes
|
|
6
|
-
*/
|
|
7
2
|
export declare const getNonSystemAttributeFieldIndexes: (fieldIndexes: FeatureLayerFieldIndex[]) => FeatureLayerFieldIndex[];
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNonSystemAttributeFieldIndexes = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This function filters out system field indexes from the provided array of field indexes.
|
|
6
|
-
* @param fieldIndexes Field indexes array from Feature Layer JSON
|
|
7
|
-
* @returns Non-system field indexes
|
|
8
|
-
*/
|
|
9
4
|
const getNonSystemAttributeFieldIndexes = (fieldIndexes) => {
|
|
10
5
|
if (!Array.isArray(fieldIndexes) || fieldIndexes.length === 0) {
|
|
11
6
|
return [];
|
|
12
7
|
}
|
|
13
|
-
// filter out system indexes
|
|
14
8
|
const nonSystemIndexes = fieldIndexes.filter((index) => {
|
|
15
9
|
const { indexType, fields } = index;
|
|
16
10
|
const fieldsUpperCase = fields.toUpperCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featureServiceFieldIndexesHelpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"featureServiceFieldIndexesHelpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.ts"],"names":[],"mappings":";;;AAOO,MAAM,iCAAiC,GAAG,CAC7C,YAAsC,EACd,EAAE;IAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,CAAC;IACd,CAAC;IAGD,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACnD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAEpC,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAE7C,OAAO,CACH,SAAS,KAAK,WAAW;YACzB,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC;YACrC,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC;YAClC,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC;YACrC,CAAC,eAAe,CAAC,QAAQ,CAAC,aAAa,CAAC;YACxC,CAAC,eAAe,CAAC,QAAQ,CAAC,eAAe,CAAC,CAC7C,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAxBW,QAAA,iCAAiC,qCAwB5C"}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
1
|
import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* requires 90% of field value types to be present to receive a full score
|
|
4
|
-
*/
|
|
5
2
|
export declare const FIELD_VALUE_TYPES_REQUIRED_PERCENT = 0.9;
|
|
6
|
-
/**
|
|
7
|
-
* Validates the presence and completeness of `fieldValueType` descriptions for relevant fields
|
|
8
|
-
* in the provided feature layers of an ArcGIS item. The validation assigns a scoring factor based
|
|
9
|
-
* on the proportion of relevant fields that have a `fieldValueType` defined in their field description.
|
|
10
|
-
*
|
|
11
|
-
* - If the item is not a feature layer, the rule is skipped (weight 0).
|
|
12
|
-
* - If there are no feature layers, a message is added and the rule is considered incomplete.
|
|
13
|
-
* - If there are no relevant fields to check, the rule is considered fully satisfied.
|
|
14
|
-
* - If none of the relevant fields have a `fieldValueType`, a message is added and the score is 0.
|
|
15
|
-
* - If less than 80% of relevant fields have a `fieldValueType`, a message is added and the score is halved.
|
|
16
|
-
* - If at least 80% of relevant fields have a `fieldValueType`, the rule is considered fully satisfied.
|
|
17
|
-
*
|
|
18
|
-
* @param item - The ArcGIS item to validate.
|
|
19
|
-
* @param featureLayers - The feature layers associated with the item.
|
|
20
|
-
* @returns ValidationInfo object containing the validation result, messages, and scoring factor.
|
|
21
|
-
*/
|
|
22
3
|
export declare const checkFeatureServiceFieldValueTypes: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
|
|
@@ -6,26 +6,7 @@ const isFeatureService_1 = require("../util/isFeatureService");
|
|
|
6
6
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
7
7
|
const helpers_1 = require("./helpers");
|
|
8
8
|
const scoringConfig_1 = require("./scoringConfig");
|
|
9
|
-
/**
|
|
10
|
-
* requires 90% of field value types to be present to receive a full score
|
|
11
|
-
*/
|
|
12
9
|
exports.FIELD_VALUE_TYPES_REQUIRED_PERCENT = 0.9;
|
|
13
|
-
/**
|
|
14
|
-
* Validates the presence and completeness of `fieldValueType` descriptions for relevant fields
|
|
15
|
-
* in the provided feature layers of an ArcGIS item. The validation assigns a scoring factor based
|
|
16
|
-
* on the proportion of relevant fields that have a `fieldValueType` defined in their field description.
|
|
17
|
-
*
|
|
18
|
-
* - If the item is not a feature layer, the rule is skipped (weight 0).
|
|
19
|
-
* - If there are no feature layers, a message is added and the rule is considered incomplete.
|
|
20
|
-
* - If there are no relevant fields to check, the rule is considered fully satisfied.
|
|
21
|
-
* - If none of the relevant fields have a `fieldValueType`, a message is added and the score is 0.
|
|
22
|
-
* - If less than 80% of relevant fields have a `fieldValueType`, a message is added and the score is halved.
|
|
23
|
-
* - If at least 80% of relevant fields have a `fieldValueType`, the rule is considered fully satisfied.
|
|
24
|
-
*
|
|
25
|
-
* @param item - The ArcGIS item to validate.
|
|
26
|
-
* @param featureLayers - The feature layers associated with the item.
|
|
27
|
-
* @returns ValidationInfo object containing the validation result, messages, and scoring factor.
|
|
28
|
-
*/
|
|
29
10
|
const checkFeatureServiceFieldValueTypes = (item, featureLayers) => {
|
|
30
11
|
const strings = (0, stringsConfig_1.getStringsConfig)();
|
|
31
12
|
const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
|
|
@@ -42,8 +23,6 @@ const checkFeatureServiceFieldValueTypes = (item, featureLayers) => {
|
|
|
42
23
|
isBinaryCheck: false,
|
|
43
24
|
isAdvisory: false,
|
|
44
25
|
};
|
|
45
|
-
// Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
|
|
46
|
-
// if the item is not a feature layer.
|
|
47
26
|
if (!(0, isFeatureService_1.isFeatureService)(item)) {
|
|
48
27
|
return Object.assign(Object.assign({}, validationResult), { weight: 0 });
|
|
49
28
|
}
|
|
@@ -60,33 +39,14 @@ const checkFeatureServiceFieldValueTypes = (item, featureLayers) => {
|
|
|
60
39
|
});
|
|
61
40
|
return validationResult;
|
|
62
41
|
}
|
|
63
|
-
// // get the count of fields with descriptions provided
|
|
64
|
-
// const countOfFieldsWithValueType = relevantFields
|
|
65
|
-
// .filter((field) => field.description)
|
|
66
|
-
// .filter((field) => field.description?.fieldValueType).length;
|
|
67
|
-
// const percentWithValueType =
|
|
68
|
-
// countOfFieldsWithValueType / relevantFields.length;
|
|
69
42
|
const percentWithValueType = (0, helpers_1.getPercentFieldsWithValueType)(relevantFields);
|
|
70
|
-
// // if percentWithValueType is 0, then there are no fields with aliases
|
|
71
|
-
// // it should receive a score of 0 and a message to add field aliases
|
|
72
|
-
// if (percentWithValueType === 0) {
|
|
73
|
-
// validationResult.messages.push({
|
|
74
|
-
// message: strings.featureLayerFieldTypes.ADD_FIELD_TYPE,
|
|
75
|
-
// });
|
|
76
|
-
// return validationResult;
|
|
77
|
-
// }
|
|
78
|
-
// if percentWithValueType is less than 0.9, then there are some fields with aliases
|
|
79
|
-
// it should receive half of score and a message to improve field aliases
|
|
80
43
|
if (percentWithValueType < exports.FIELD_VALUE_TYPES_REQUIRED_PERCENT) {
|
|
81
44
|
validationResult.messages.push({
|
|
82
45
|
message: strings.featureLayerFieldTypes.IMRPOVE_FIELD_TYPE,
|
|
83
46
|
});
|
|
84
47
|
validationResult.scoringFactor = 0;
|
|
85
|
-
// scoringFactors.CONTAINS_FIELD_VALUE_TYPES / 2;
|
|
86
48
|
return validationResult;
|
|
87
49
|
}
|
|
88
|
-
// if percentWithValueType is greater than 0.8, then there are most fields with aliases
|
|
89
|
-
// it should receive full score
|
|
90
50
|
validationResult.scoringFactor = 1;
|
|
91
51
|
return validationResult;
|
|
92
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceFieldValueTypes.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,uCAA0D;AAC1D,mDAAgD;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceFieldValueTypes.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,uCAA0D;AAC1D,mDAAgD;AAKnC,QAAA,kCAAkC,GAAG,GAAG,CAAC;AAkB/C,MAAM,kCAAkC,GAAG,CAC9C,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,mCAAmC;QACrD,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK;QAC3C,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK;QAC3C,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,aAAa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
1
1
|
import { FeatureLayerFieldFormatted } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if the provided field information object has a valid field value type.
|
|
4
|
-
*
|
|
5
|
-
* @param fieldInfo - The field information object to validate.
|
|
6
|
-
* @returns `true` if the field information contains a valid `fieldValueType` in its description; otherwise, `false`.
|
|
7
|
-
*/
|
|
8
2
|
export declare const isValidFieldValueType: (fieldInfo: FeatureLayerFieldFormatted) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Calculates the proportion of fields in the provided array that have a valid field value type assigned.
|
|
11
|
-
*
|
|
12
|
-
* @param fields - An array of `FeatureLayerFieldFormatted` objects to be evaluated.
|
|
13
|
-
* @returns The proportion (between 0 and 1) of fields that have a valid value type.
|
|
14
|
-
* Returns 0 if the input array is empty, not an array, or undefined.
|
|
15
|
-
*/
|
|
16
3
|
export declare const getPercentFieldsWithValueType: (fields: FeatureLayerFieldFormatted[]) => number;
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPercentFieldsWithValueType = exports.isValidFieldValueType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Checks if the provided field information object has a valid field value type.
|
|
6
|
-
*
|
|
7
|
-
* @param fieldInfo - The field information object to validate.
|
|
8
|
-
* @returns `true` if the field information contains a valid `fieldValueType` in its description; otherwise, `false`.
|
|
9
|
-
*/
|
|
10
4
|
const isValidFieldValueType = (fieldInfo) => {
|
|
11
5
|
var _a;
|
|
12
6
|
if (!fieldInfo ||
|
|
13
7
|
!(fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.description) ||
|
|
14
8
|
!((_a = fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.description) === null || _a === void 0 ? void 0 : _a.fieldValueType)) {
|
|
15
|
-
return false;
|
|
9
|
+
return false;
|
|
16
10
|
}
|
|
17
|
-
return true;
|
|
11
|
+
return true;
|
|
18
12
|
};
|
|
19
13
|
exports.isValidFieldValueType = isValidFieldValueType;
|
|
20
|
-
/**
|
|
21
|
-
* Calculates the proportion of fields in the provided array that have a valid field value type assigned.
|
|
22
|
-
*
|
|
23
|
-
* @param fields - An array of `FeatureLayerFieldFormatted` objects to be evaluated.
|
|
24
|
-
* @returns The proportion (between 0 and 1) of fields that have a valid value type.
|
|
25
|
-
* Returns 0 if the input array is empty, not an array, or undefined.
|
|
26
|
-
*/
|
|
27
14
|
const getPercentFieldsWithValueType = (fields) => {
|
|
28
15
|
if (!fields || !Array.isArray(fields) || fields.length === 0) {
|
|
29
16
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/helpers.ts"],"names":[],"mappings":";;;AAQO,MAAM,qBAAqB,GAAG,CACjC,SAAqC,EAC9B,EAAE;;IACT,IACI,CAAC,SAAS;QACV,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,CAAA;QACvB,CAAC,CAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,0CAAE,cAAc,CAAA,EACzC,CAAC;QACC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAZW,QAAA,qBAAqB,yBAYhC;AASK,MAAM,6BAA6B,GAAG,CACzC,MAAoC,EAC9B,EAAE;IACR,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,CAAC;IACb,CAAC;IAED,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACvD,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAC/B,CAAC,MAAM,CAAC;IAET,OAAO,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC;AACtD,CAAC,CAAC;AAZW,QAAA,6BAA6B,iCAYxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/scoringConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/scoringConfig.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,0BAA0B,EAAE,CAAC;SAChC;KACJ;CACJ,CAAC"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
1
|
import { IItem, ValidationInfo } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Validation function to check if an item has a valid extent and is not set to the world extent
|
|
4
|
-
*
|
|
5
|
-
* The socring logic is as follows:
|
|
6
|
-
* - If the item does not have an extent or the extent is not an array of two arrays, a message is added and the it receives no score.
|
|
7
|
-
* - If the extent is not a valid extent object (not an array of two coordinate pairs, or coordinates are out of range), a message is added and receives no score.
|
|
8
|
-
* - If the extent is valid, the rule receives a scoring factor for having a valid extent.
|
|
9
|
-
* - If the extent is not set to the world extent, the rule receives an additional scoring factor for having an appropriate extent.
|
|
10
|
-
*
|
|
11
|
-
* @param item - item to validate
|
|
12
|
-
* @returns validation info object
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* import { validateItemExtent } from 'living-atlas-content-validator';
|
|
17
|
-
*
|
|
18
|
-
* const item = {
|
|
19
|
-
* extent: [[-10, -10], [10, 10]]
|
|
20
|
-
* };
|
|
21
|
-
*
|
|
22
|
-
* const result = validateItemExtent(item);
|
|
23
|
-
* console.log(result);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
2
|
export declare const checkItemExtent: (item: IItem) => ValidationInfo;
|
|
@@ -4,34 +4,8 @@ exports.checkItemExtent = void 0;
|
|
|
4
4
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
5
5
|
const checkItemExtentHelpers_1 = require("./checkItemExtentHelpers");
|
|
6
6
|
const scoringConfig_1 = require("./scoringConfig");
|
|
7
|
-
/**
|
|
8
|
-
* Validation function to check if an item has a valid extent and is not set to the world extent
|
|
9
|
-
*
|
|
10
|
-
* The socring logic is as follows:
|
|
11
|
-
* - If the item does not have an extent or the extent is not an array of two arrays, a message is added and the it receives no score.
|
|
12
|
-
* - If the extent is not a valid extent object (not an array of two coordinate pairs, or coordinates are out of range), a message is added and receives no score.
|
|
13
|
-
* - If the extent is valid, the rule receives a scoring factor for having a valid extent.
|
|
14
|
-
* - If the extent is not set to the world extent, the rule receives an additional scoring factor for having an appropriate extent.
|
|
15
|
-
*
|
|
16
|
-
* @param item - item to validate
|
|
17
|
-
* @returns validation info object
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { validateItemExtent } from 'living-atlas-content-validator';
|
|
22
|
-
*
|
|
23
|
-
* const item = {
|
|
24
|
-
* extent: [[-10, -10], [10, 10]]
|
|
25
|
-
* };
|
|
26
|
-
*
|
|
27
|
-
* const result = validateItemExtent(item);
|
|
28
|
-
* console.log(result);
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
7
|
const checkItemExtent = (item) => {
|
|
33
8
|
const extent = item === null || item === void 0 ? void 0 : item.extent;
|
|
34
|
-
// Retrieve localized strings
|
|
35
9
|
const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
|
|
36
10
|
const strings = stringsConfig.itemExtent;
|
|
37
11
|
const validationOutput = {
|
|
@@ -57,7 +31,6 @@ const checkItemExtent = (item) => {
|
|
|
57
31
|
});
|
|
58
32
|
return validationOutput;
|
|
59
33
|
}
|
|
60
|
-
// check if extent objectis is valid
|
|
61
34
|
if ((0, checkItemExtentHelpers_1.isValidExtentDataObject)(extent) === false) {
|
|
62
35
|
validationOutput.messages.push({
|
|
63
36
|
message: strings.INVALID_EXTENT_MESSAGE,
|
|
@@ -82,17 +55,14 @@ const checkItemExtent = (item) => {
|
|
|
82
55
|
});
|
|
83
56
|
return validationOutput;
|
|
84
57
|
}
|
|
85
|
-
// extent is valid so it get the first scoring factor
|
|
86
58
|
validationOutput.scoringFactor +=
|
|
87
59
|
scoringConfig_1.scoringConfig.scoringFactors.DEFAULT.HAS_VALID_EXTENT;
|
|
88
|
-
// check if extent is set to world
|
|
89
60
|
if ((0, checkItemExtentHelpers_1.isExtentSetToWorld)(item.extent)) {
|
|
90
61
|
validationOutput.messages.push({
|
|
91
62
|
message: strings.EXTENT_SET_TO_WORLD_MESSAGE,
|
|
92
63
|
});
|
|
93
64
|
}
|
|
94
65
|
else {
|
|
95
|
-
// extent is not set to world so it get the second scoring factor
|
|
96
66
|
validationOutput.scoringFactor +=
|
|
97
67
|
scoringConfig_1.scoringConfig.scoringFactors.DEFAULT.HAS_EXTENT_NOT_SET_TO_WORLD;
|
|
98
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkItemExtent.js","sourceRoot":"","sources":["../../../src/lib/itemExtent/checkItemExtent.ts"],"names":[],"mappings":";;;AACA,yDAAyD;AACzD,qEAOkC;AAClC,mDAAgD;
|
|
1
|
+
{"version":3,"file":"checkItemExtent.js","sourceRoot":"","sources":["../../../src/lib/itemExtent/checkItemExtent.ts"],"names":[],"mappings":";;;AACA,yDAAyD;AACzD,qEAOkC;AAClC,mDAAgD;AA2BzC,MAAM,eAAe,GAAG,CAAC,IAAW,EAAkB,EAAE;IAC3D,MAAM,MAAM,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAC;IAG5B,MAAM,aAAa,GAAG,IAAA,gCAAgB,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jC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,uBAAuB;SAC3C,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,IAAI,IAAA,+CAAsB,EAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC;QAC3C,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,4BAA4B;SAChD,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAGD,gBAAgB,CAAC,aAAa;QAC1B,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAG1D,IAAI,IAAA,2CAAkB,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,2BAA2B;SAC/C,CAAC,CAAC;IACP,CAAC;SAAM,CAAC;QAEJ,gBAAgB,CAAC,aAAa;YAC1B,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC,2BAA2B,CAAC;IACzE,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AA/EW,QAAA,eAAe,mBA+E1B"}
|
|
@@ -1,38 +1,7 @@
|
|
|
1
1
|
import { IItem } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Check if the extent coordinates are within valid ranges
|
|
4
|
-
* @param extent
|
|
5
|
-
* @returns boolean indicating if extent is within valid range
|
|
6
|
-
*/
|
|
7
2
|
export declare const isExtentWithinValidRange: (extent: number[][]) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Check if the extent represents a valid rectangle (min values are less than max values)
|
|
10
|
-
* @param extent extent to check
|
|
11
|
-
* @returns boolean indicating if extent is a valid rectangle
|
|
12
|
-
*/
|
|
13
3
|
export declare const isExtentValidRectangle: (extent: number[][]) => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Check if the extent represents a single point (min values equal max values)
|
|
16
|
-
* @param extent extent to check
|
|
17
|
-
* @returns boolean indicating if extent is a point
|
|
18
|
-
*/
|
|
19
4
|
export declare const isExtentPoint: (extent: number[][]) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Check if the extent object is a valid extent data object
|
|
22
|
-
* @param extent - extent object to validate
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
5
|
export declare const isValidExtentDataObject: (extent: number[][]) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Check if the extent is set to the world extent
|
|
28
|
-
*
|
|
29
|
-
* @param extent - extent object to check
|
|
30
|
-
* @returns true if extent is set to world extent, false otherwise
|
|
31
|
-
*/
|
|
32
6
|
export declare const isExtentSetToWorld: (extent: number[][]) => boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Check if the item extent should be checked based on item type
|
|
35
|
-
* @param item - item to check
|
|
36
|
-
* @returns true if the item extent should be checked, false otherwise
|
|
37
|
-
*/
|
|
38
7
|
export declare const shouldCheckItemExtent: (item: IItem) => boolean;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.shouldCheckItemExtent = exports.isExtentSetToWorld = exports.isValidExtentDataObject = exports.isExtentPoint = exports.isExtentValidRectangle = exports.isExtentWithinValidRange = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Threshold values to consider an extent as world extent
|
|
6
|
-
* These values are slightly less than the actual world extent to account for minor inaccuracies
|
|
7
|
-
* in the extent values that may still represent a global extent.
|
|
8
|
-
*/
|
|
9
4
|
const WORLD_EXTENT_THRESHOLD = [
|
|
10
5
|
[-175, -85],
|
|
11
6
|
[175, 85],
|
|
12
7
|
];
|
|
13
|
-
/**
|
|
14
|
-
* Check if the extent coordinates are within valid ranges
|
|
15
|
-
* @param extent
|
|
16
|
-
* @returns boolean indicating if extent is within valid range
|
|
17
|
-
*/
|
|
18
8
|
const isExtentWithinValidRange = (extent) => {
|
|
19
9
|
if (!extent || extent.length !== 2) {
|
|
20
10
|
return false;
|
|
@@ -32,11 +22,6 @@ const isExtentWithinValidRange = (extent) => {
|
|
|
32
22
|
maxY <= 90);
|
|
33
23
|
};
|
|
34
24
|
exports.isExtentWithinValidRange = isExtentWithinValidRange;
|
|
35
|
-
/**
|
|
36
|
-
* Check if the extent represents a valid rectangle (min values are less than max values)
|
|
37
|
-
* @param extent extent to check
|
|
38
|
-
* @returns boolean indicating if extent is a valid rectangle
|
|
39
|
-
*/
|
|
40
25
|
const isExtentValidRectangle = (extent) => {
|
|
41
26
|
if (!extent || extent.length !== 2) {
|
|
42
27
|
return false;
|
|
@@ -47,11 +32,6 @@ const isExtentValidRectangle = (extent) => {
|
|
|
47
32
|
return minX < maxX && minY < maxY;
|
|
48
33
|
};
|
|
49
34
|
exports.isExtentValidRectangle = isExtentValidRectangle;
|
|
50
|
-
/**
|
|
51
|
-
* Check if the extent represents a single point (min values equal max values)
|
|
52
|
-
* @param extent extent to check
|
|
53
|
-
* @returns boolean indicating if extent is a point
|
|
54
|
-
*/
|
|
55
35
|
const isExtentPoint = (extent) => {
|
|
56
36
|
if (!extent || extent.length !== 2) {
|
|
57
37
|
return false;
|
|
@@ -62,11 +42,6 @@ const isExtentPoint = (extent) => {
|
|
|
62
42
|
return minX === maxX && minY === maxY;
|
|
63
43
|
};
|
|
64
44
|
exports.isExtentPoint = isExtentPoint;
|
|
65
|
-
/**
|
|
66
|
-
* Check if the extent object is a valid extent data object
|
|
67
|
-
* @param extent - extent object to validate
|
|
68
|
-
* @returns
|
|
69
|
-
*/
|
|
70
45
|
const isValidExtentDataObject = (extent) => {
|
|
71
46
|
const isValidExtentObject = extent &&
|
|
72
47
|
Array.isArray(extent) &&
|
|
@@ -84,12 +59,6 @@ const isValidExtentDataObject = (extent) => {
|
|
|
84
59
|
return isValidExtentObject;
|
|
85
60
|
};
|
|
86
61
|
exports.isValidExtentDataObject = isValidExtentDataObject;
|
|
87
|
-
/**
|
|
88
|
-
* Check if the extent is set to the world extent
|
|
89
|
-
*
|
|
90
|
-
* @param extent - extent object to check
|
|
91
|
-
* @returns true if extent is set to world extent, false otherwise
|
|
92
|
-
*/
|
|
93
62
|
const isExtentSetToWorld = (extent) => {
|
|
94
63
|
if (!(0, exports.isValidExtentDataObject)(extent) ||
|
|
95
64
|
(0, exports.isExtentPoint)(extent) === true ||
|
|
@@ -109,11 +78,6 @@ const isExtentSetToWorld = (extent) => {
|
|
|
109
78
|
maxY > worldMaxY);
|
|
110
79
|
};
|
|
111
80
|
exports.isExtentSetToWorld = isExtentSetToWorld;
|
|
112
|
-
/**
|
|
113
|
-
* Check if the item extent should be checked based on item type
|
|
114
|
-
* @param item - item to check
|
|
115
|
-
* @returns true if the item extent should be checked, false otherwise
|
|
116
|
-
*/
|
|
117
81
|
const shouldCheckItemExtent = (item) => {
|
|
118
82
|
const type = item === null || item === void 0 ? void 0 : item.type;
|
|
119
83
|
if (type === 'Desktop Style' ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkItemExtentHelpers.js","sourceRoot":"","sources":["../../../src/lib/itemExtent/checkItemExtentHelpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"checkItemExtentHelpers.js","sourceRoot":"","sources":["../../../src/lib/itemExtent/checkItemExtentHelpers.ts"],"names":[],"mappings":";;;AAQA,MAAM,sBAAsB,GAAG;IAC3B,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;IACX,CAAC,GAAG,EAAE,EAAE,CAAC;CACZ,CAAC;AAOK,MAAM,wBAAwB,GAAG,CAAC,MAAkB,EAAW,EAAE;IACpE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC;IACpC,MAA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M,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC;IAC9B,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC;IAE9B,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,sBAAsB,CAAC;IAC9D,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC;IAC7C,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC;IAE7C,OAAO,CACH,IAAI,GAAG,SAAS;QAChB,IAAI,GAAG,SAAS;QAChB,IAAI,GAAG,SAAS;QAChB,IAAI,GAAG,SAAS,CACnB,CAAC;AACN,CAAC,CAAC;AAxBW,QAAA,kBAAkB,sBAwB7B;AAOK,MAAM,qBAAqB,GAAG,CAAC,IAAW,EAAW,EAAE;IAC1D,MAAM,IAAI,GACN,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAoC,CAAC;IAE/C,IACI,IAAI,KAAK,eAAe;QACxB,IAAI,KAAK,OAAO;QAChB,IAAI,KAAK,uBAAuB;QAChC,IAAI,KAAK,0BAA0B;QACnC,IAAI,KAAK,UAAU;QACnB,IAAI,KAAK,gBAAgB;QACzB,IAAI,KAAK,yBAAyB;QAClC,IAAI,KAAK,WAAW,EACtB,CAAC;QACC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAlBW,QAAA,qBAAqB,yBAkBhC"}
|
|
@@ -1,34 +1,2 @@
|
|
|
1
1
|
import { IItem, ValidationInfo } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* @function isValidLicenseInfo
|
|
4
|
-
*
|
|
5
|
-
* @summary Validate an item's "Terms of Use (license info)"
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* Validate an item's "Terms of Use (license info)"
|
|
9
|
-
* <br />
|
|
10
|
-
* <b>item property:</b> <code>licenseInfo</code>
|
|
11
|
-
* <br />
|
|
12
|
-
*
|
|
13
|
-
* <b>Description</b><br />
|
|
14
|
-
* Any license information or restrictions.
|
|
15
|
-
* <br />
|
|
16
|
-
*
|
|
17
|
-
* <b>ArcGIS Online specific rules</b><br />
|
|
18
|
-
* Not available
|
|
19
|
-
* <br />
|
|
20
|
-
*
|
|
21
|
-
* <b>Living Atlas specific</b>
|
|
22
|
-
* <li>Cannot be empty</li>
|
|
23
|
-
* <li>Must have 2 or more words</li>
|
|
24
|
-
* <li>Must contain at least one link</li>
|
|
25
|
-
* <br />
|
|
26
|
-
*
|
|
27
|
-
* <b>Living Atlas specific (international)</b>
|
|
28
|
-
* <li>Must contain at least one link</li>
|
|
29
|
-
*
|
|
30
|
-
* @param {JSON} item - ArcGIS Online item
|
|
31
|
-
* @return {JSON} JSON object containing the results
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
2
|
export declare const isValidLicenseInfo: (item: IItem) => ValidationInfo;
|
|
@@ -5,54 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.isValidLicenseInfo = void 0;
|
|
7
7
|
const sanitize_html_1 = __importDefault(require("sanitize-html"));
|
|
8
|
-
// import scoringRulesConfig from './scoringRulesConfig';
|
|
9
8
|
const getScoringRules_1 = require("../util/getScoringRules");
|
|
10
9
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
11
10
|
const assertString_1 = require("../util/assertString");
|
|
12
11
|
const isEmpty_1 = require("../util/isEmpty");
|
|
13
12
|
const getNumberOfWords_1 = require("../util/getNumberOfWords");
|
|
14
13
|
const scoringConfig_1 = require("./scoringConfig");
|
|
15
|
-
/**
|
|
16
|
-
* @function isValidLicenseInfo
|
|
17
|
-
*
|
|
18
|
-
* @summary Validate an item's "Terms of Use (license info)"
|
|
19
|
-
*
|
|
20
|
-
* @description
|
|
21
|
-
* Validate an item's "Terms of Use (license info)"
|
|
22
|
-
* <br />
|
|
23
|
-
* <b>item property:</b> <code>licenseInfo</code>
|
|
24
|
-
* <br />
|
|
25
|
-
*
|
|
26
|
-
* <b>Description</b><br />
|
|
27
|
-
* Any license information or restrictions.
|
|
28
|
-
* <br />
|
|
29
|
-
*
|
|
30
|
-
* <b>ArcGIS Online specific rules</b><br />
|
|
31
|
-
* Not available
|
|
32
|
-
* <br />
|
|
33
|
-
*
|
|
34
|
-
* <b>Living Atlas specific</b>
|
|
35
|
-
* <li>Cannot be empty</li>
|
|
36
|
-
* <li>Must have 2 or more words</li>
|
|
37
|
-
* <li>Must contain at least one link</li>
|
|
38
|
-
* <br />
|
|
39
|
-
*
|
|
40
|
-
* <b>Living Atlas specific (international)</b>
|
|
41
|
-
* <li>Must contain at least one link</li>
|
|
42
|
-
*
|
|
43
|
-
* @param {JSON} item - ArcGIS Online item
|
|
44
|
-
* @return {JSON} JSON object containing the results
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
14
|
const isValidLicenseInfo = (item) => {
|
|
48
15
|
const { licenseInfo } = item;
|
|
49
|
-
// scoring rules locale
|
|
50
16
|
const locale = (0, getScoringRules_1.getScoringRulesLocale)(item.culture);
|
|
51
17
|
const scoringFactors = locale === 'en'
|
|
52
18
|
? scoringConfig_1.scoringConfig.scoringFactors.DEFAULT
|
|
53
19
|
: scoringConfig_1.scoringConfig.scoringFactors.INTERNATIONAL;
|
|
54
|
-
// scoring rules
|
|
55
|
-
// const SCORING = getScoringRules(item, scoringRulesConfig);
|
|
56
20
|
const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
|
|
57
21
|
const validationOutput = {
|
|
58
22
|
validationRuleId: 'item-license-info',
|
|
@@ -61,36 +25,26 @@ const isValidLicenseInfo = (item) => {
|
|
|
61
25
|
maxScore: 0,
|
|
62
26
|
score: 0,
|
|
63
27
|
messages: [],
|
|
64
|
-
weight: scoringConfig_1.scoringConfig.weight,
|
|
28
|
+
weight: scoringConfig_1.scoringConfig.weight,
|
|
65
29
|
scoringFactor: 0,
|
|
66
|
-
// the status will be updated afterward based on the validation result
|
|
67
30
|
status: 'unknown',
|
|
68
31
|
isBinaryCheck: false,
|
|
69
32
|
isAdvisory: false,
|
|
70
33
|
};
|
|
71
|
-
// remove html tags
|
|
72
34
|
const sanitizedStr = (0, sanitize_html_1.default)(licenseInfo, {
|
|
73
35
|
allowedTags: [],
|
|
74
36
|
});
|
|
75
|
-
// check if the item's property is the right type (String)
|
|
76
|
-
// check if the item's property is null or undefined
|
|
77
37
|
if (!(0, assertString_1.assertString)(licenseInfo) ||
|
|
78
38
|
(0, isEmpty_1.isEmpty)(licenseInfo) ||
|
|
79
39
|
(0, isEmpty_1.isEmpty)(sanitizedStr)) {
|
|
80
|
-
// validationOutput.score = SCORING.EMPTY_STRING_SCORE;
|
|
81
40
|
validationOutput.messages.push({
|
|
82
|
-
// code: stringsConfig.licenseInfo.EMPTY_STRING_CODE,
|
|
83
41
|
message: stringsConfig.licenseInfo.EMPTY_STRING_MESSAGE,
|
|
84
42
|
});
|
|
85
43
|
return validationOutput;
|
|
86
44
|
}
|
|
87
|
-
validationOutput.scoringFactor += scoringFactors.MUST_EXIST_FACTOR;
|
|
88
|
-
// The search() method searches a string for a specified value, and returns the position of the match.
|
|
89
|
-
// The search value can be string or a regular expression.
|
|
90
|
-
// This method returns -1 if no match is found.
|
|
45
|
+
validationOutput.scoringFactor += scoringFactors.MUST_EXIST_FACTOR;
|
|
91
46
|
if (licenseInfo.search('href') < 0) {
|
|
92
47
|
validationOutput.messages.push({
|
|
93
|
-
// code: stringsConfig.licenseInfo.CONTAINS_NO_LINKS_CODE,
|
|
94
48
|
message: stringsConfig.licenseInfo.CONTAINS_NO_LINKS_MESSAGE,
|
|
95
49
|
});
|
|
96
50
|
}
|
|
@@ -99,7 +53,6 @@ const isValidLicenseInfo = (item) => {
|
|
|
99
53
|
}
|
|
100
54
|
if (locale === 'en' && (0, getNumberOfWords_1.getNumberOfWords)(sanitizedStr) < 2) {
|
|
101
55
|
validationOutput.messages.push({
|
|
102
|
-
// code: stringsConfig.licenseInfo.MINIMUM_WORD_COUNT_CODE,
|
|
103
56
|
message: stringsConfig.licenseInfo.MINIMUM_WORD_COUNT_MESSAGE,
|
|
104
57
|
});
|
|
105
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isValidLicenseInfo.js","sourceRoot":"","sources":["../../../src/lib/licenseInfo/isValidLicenseInfo.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;
|
|
1
|
+
{"version":3,"file":"isValidLicenseInfo.js","sourceRoot":"","sources":["../../../src/lib/licenseInfo/isValidLicenseInfo.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AAEzC,6DAGiC;AAEjC,yDAAyD;AACzD,uDAAoD;AACpD,6CAA0C;AAC1C,+DAA4D;AAC5D,mDAAgD;AAkCzC,MAAM,kBAAkB,GAAG,CAAC,IAAW,EAAkB,EAAE;IAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAG7B,MAAM,MAAM,GAAG,IAAA,uCAAqB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEnD,MAAM,cAAc,GAChB,MAAM,KAAK,IAAI;QACX,CAAC,CAAC,6BAAa,CAAC,cAAc,CAAC,OAAO;QACtC,CAAC,CAAC,6BAAa,CAAC,cAAc,CAAC,aAAa,CAAC;IAKrD,MAAM,aAAa,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEzC,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,mBAAmB;QACrC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK;QACtC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK;QACtC,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,aAAa,EAAE,CAAC;QAEhB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;QACpB,UAAU,E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ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/licenseInfo/scoringConfig.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,iBAAiB,EAAE,IAAI;YACvB,iBAAiB,EAAE,GAAG;YACtB,eAAe,EAAE,IAAI;SACxB;QACD,aAAa,EAAE;YACX,iBAAiB,EAAE,IAAI;YACvB,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,IAAI;SACxB;KACJ;CACJ,CAAC"}
|