@vannizhang/living-atlas-content-validator 1.5.19-beta.12 → 1.5.19-beta.13

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.d.ts CHANGED
@@ -39,10 +39,11 @@ import { getPercentOfValidFieldDescriptions, isValidFieldDescription } from './l
39
39
  import { checkFeatureServiceFieldAliases } from './lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases';
40
40
  import { getPercentOfValidFieldAliases, isValidFieldAlias } from './lib/featureServiceFieldAliases/helpers';
41
41
  import { checkFeatureServiceFieldValueTypes } from './lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes';
42
+ import { getPercentFieldsWithValueType, isValidFieldValueType } from './lib/featureServiceFieldValueTypes/helpers';
42
43
  import { fetchFeatureServiceLayersAndTables } from './services/feature-service/fetchFeatureServiceLayersAndTables';
43
44
  import { getRelevantFeatureLayerFields } from './lib/util/getRelevantFeatureLayerFields';
44
45
  import { getFeatureLayerFieldValueTypes } from './lib/util/getFeatureLayerFieldValueTypes';
45
- export { configureSettings, validate, isValidTitle, isValidAccessInformation, isValidDescription, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, isDeprecated, isDeleteProtectionEnabled, checkTitleAndSnippetSearchability, matchLocationInfo, matchDateTimeInfo, matchSourceInfo, matchTopicInfo, isRecognizedLocation, isRecognizedDateTimeInfo, isRecognizedSource, isRecognizedTopic, isRejectedLocationInfo, isRejectedDateTimeInfo, isRejectedSourceInfo, isRejectedTopicInfo, isEligibleForCheckingTitleAndSnippetSearchability, getLivingAtlasSupportedItemTypes, checkIsLivingAtlasSupportedItemType, sanitizeTags, getStringsConfig, getDefaultStringsConfig, checkFeatureServiceFieldAliases, checkFeatureServiceFieldDescriptions, checkFeatureServiceFieldValueTypes, fetchFeatureServiceLayersAndTables, getRelevantFeatureLayerFields, getFeatureLayerFieldValueTypes, getPercentOfValidFieldDescriptions, isValidFieldDescription, getPercentOfValidFieldAliases, isValidFieldAlias, };
46
+ export { configureSettings, validate, isValidTitle, isValidAccessInformation, isValidDescription, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, isDeprecated, isDeleteProtectionEnabled, checkTitleAndSnippetSearchability, matchLocationInfo, matchDateTimeInfo, matchSourceInfo, matchTopicInfo, isRecognizedLocation, isRecognizedDateTimeInfo, isRecognizedSource, isRecognizedTopic, isRejectedLocationInfo, isRejectedDateTimeInfo, isRejectedSourceInfo, isRejectedTopicInfo, isEligibleForCheckingTitleAndSnippetSearchability, getLivingAtlasSupportedItemTypes, checkIsLivingAtlasSupportedItemType, sanitizeTags, getStringsConfig, getDefaultStringsConfig, checkFeatureServiceFieldAliases, checkFeatureServiceFieldDescriptions, checkFeatureServiceFieldValueTypes, fetchFeatureServiceLayersAndTables, getRelevantFeatureLayerFields, getFeatureLayerFieldValueTypes, getPercentOfValidFieldDescriptions, isValidFieldDescription, getPercentOfValidFieldAliases, isValidFieldAlias, getPercentFieldsWithValueType, isValidFieldValueType, };
46
47
  export { fetchAdditonalPatterns4TitleAndSnippetSearchability, fetchProfanitiesData, getSubmittedCustomTerms, getMyCustomTerms, addCustomTerms2FeatureTable, updateStatusOfCustomTermsInFeatureTable, getPackagedReviewResults, getReviewedReviewResults, getUnarchivedReviewResults, getDeployedReviewResults, getReviewResultsByTermAndCategory, addReviewResults2FeatureTable, updateReviewResultsInFeatureTable, getCustomTermsFeatureTableItemInfo, getCustomTermsReviewResultsFeatureTableItemInfo, containsProfanity, };
47
48
  export { isValidRegexPattern, escapeSpecialCharacters };
48
49
  export type { ValidationMessage, ValidationInfo, ValidationResult, ValidationRulesStringJSON, ValidationResultStatus, MatchResult, CustomTermFeature, CustomTermCategory, CustomTermStatus, CustomTermsReviewResultLifecycle, CustomTermReviewResultFeature, AdditionalPatterns4TitleAndSnippetSearchability, AddFeaturesResponse, LivingAtlasSupportedItemType, FeatureLayerFieldRaw, FeatureLayerFieldFormatted, FeatureLayerJSON, FeatureLayerFieldValueType, FeatureServiceJSON, };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addCustomTerms2FeatureTable = exports.getMyCustomTerms = exports.getSubmittedCustomTerms = exports.fetchProfanitiesData = exports.fetchAdditonalPatterns4TitleAndSnippetSearchability = exports.isValidFieldAlias = exports.getPercentOfValidFieldAliases = exports.isValidFieldDescription = exports.getPercentOfValidFieldDescriptions = exports.getFeatureLayerFieldValueTypes = exports.getRelevantFeatureLayerFields = exports.fetchFeatureServiceLayersAndTables = exports.checkFeatureServiceFieldValueTypes = exports.checkFeatureServiceFieldDescriptions = exports.checkFeatureServiceFieldAliases = exports.getDefaultStringsConfig = exports.getStringsConfig = exports.sanitizeTags = exports.checkIsLivingAtlasSupportedItemType = exports.getLivingAtlasSupportedItemTypes = exports.isEligibleForCheckingTitleAndSnippetSearchability = exports.isRejectedTopicInfo = exports.isRejectedSourceInfo = exports.isRejectedDateTimeInfo = exports.isRejectedLocationInfo = exports.isRecognizedTopic = exports.isRecognizedSource = exports.isRecognizedDateTimeInfo = exports.isRecognizedLocation = exports.matchTopicInfo = exports.matchSourceInfo = exports.matchDateTimeInfo = exports.matchLocationInfo = exports.checkTitleAndSnippetSearchability = exports.isDeleteProtectionEnabled = exports.isDeprecated = exports.isValidUserProfileThumbnail = exports.isValidUserProfileName = exports.isValidUserProfileDescription = exports.isValidThumbnail = exports.isValidTags = exports.isValidSummary = exports.isValidSSL = exports.isValidAccess = exports.isValidLicenseInfo = exports.isValidDescription = exports.isValidAccessInformation = exports.isValidTitle = exports.validate = exports.configureSettings = void 0;
4
- exports.escapeSpecialCharacters = exports.isValidRegexPattern = exports.containsProfanity = exports.getCustomTermsReviewResultsFeatureTableItemInfo = exports.getCustomTermsFeatureTableItemInfo = exports.updateReviewResultsInFeatureTable = exports.addReviewResults2FeatureTable = exports.getReviewResultsByTermAndCategory = exports.getDeployedReviewResults = exports.getUnarchivedReviewResults = exports.getReviewedReviewResults = exports.getPackagedReviewResults = exports.updateStatusOfCustomTermsInFeatureTable = void 0;
3
+ exports.getSubmittedCustomTerms = exports.fetchProfanitiesData = exports.fetchAdditonalPatterns4TitleAndSnippetSearchability = exports.isValidFieldValueType = exports.getPercentFieldsWithValueType = exports.isValidFieldAlias = exports.getPercentOfValidFieldAliases = exports.isValidFieldDescription = exports.getPercentOfValidFieldDescriptions = exports.getFeatureLayerFieldValueTypes = exports.getRelevantFeatureLayerFields = exports.fetchFeatureServiceLayersAndTables = exports.checkFeatureServiceFieldValueTypes = exports.checkFeatureServiceFieldDescriptions = exports.checkFeatureServiceFieldAliases = exports.getDefaultStringsConfig = exports.getStringsConfig = exports.sanitizeTags = exports.checkIsLivingAtlasSupportedItemType = exports.getLivingAtlasSupportedItemTypes = exports.isEligibleForCheckingTitleAndSnippetSearchability = exports.isRejectedTopicInfo = exports.isRejectedSourceInfo = exports.isRejectedDateTimeInfo = exports.isRejectedLocationInfo = exports.isRecognizedTopic = exports.isRecognizedSource = exports.isRecognizedDateTimeInfo = exports.isRecognizedLocation = exports.matchTopicInfo = exports.matchSourceInfo = exports.matchDateTimeInfo = exports.matchLocationInfo = exports.checkTitleAndSnippetSearchability = exports.isDeleteProtectionEnabled = exports.isDeprecated = exports.isValidUserProfileThumbnail = exports.isValidUserProfileName = exports.isValidUserProfileDescription = exports.isValidThumbnail = exports.isValidTags = exports.isValidSummary = exports.isValidSSL = exports.isValidAccess = exports.isValidLicenseInfo = exports.isValidDescription = exports.isValidAccessInformation = exports.isValidTitle = exports.validate = exports.configureSettings = void 0;
4
+ exports.escapeSpecialCharacters = exports.isValidRegexPattern = exports.containsProfanity = exports.getCustomTermsReviewResultsFeatureTableItemInfo = exports.getCustomTermsFeatureTableItemInfo = exports.updateReviewResultsInFeatureTable = exports.addReviewResults2FeatureTable = exports.getReviewResultsByTermAndCategory = exports.getDeployedReviewResults = exports.getUnarchivedReviewResults = exports.getReviewedReviewResults = exports.getPackagedReviewResults = exports.updateStatusOfCustomTermsInFeatureTable = exports.addCustomTerms2FeatureTable = exports.getMyCustomTerms = void 0;
5
5
  const isValidTitle_1 = require("./lib/title/isValidTitle");
6
6
  Object.defineProperty(exports, "isValidTitle", { enumerable: true, get: function () { return isValidTitle_1.isValidTitle; } });
7
7
  const isValidAccessInformation_1 = require("./lib/accessInformation/isValidAccessInformation");
@@ -101,6 +101,9 @@ Object.defineProperty(exports, "getPercentOfValidFieldAliases", { enumerable: tr
101
101
  Object.defineProperty(exports, "isValidFieldAlias", { enumerable: true, get: function () { return helpers_3.isValidFieldAlias; } });
102
102
  const checkFeatureServiceFieldValueTypes_1 = require("./lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes");
103
103
  Object.defineProperty(exports, "checkFeatureServiceFieldValueTypes", { enumerable: true, get: function () { return checkFeatureServiceFieldValueTypes_1.checkFeatureServiceFieldValueTypes; } });
104
+ const helpers_4 = require("./lib/featureServiceFieldValueTypes/helpers");
105
+ Object.defineProperty(exports, "getPercentFieldsWithValueType", { enumerable: true, get: function () { return helpers_4.getPercentFieldsWithValueType; } });
106
+ Object.defineProperty(exports, "isValidFieldValueType", { enumerable: true, get: function () { return helpers_4.isValidFieldValueType; } });
104
107
  const fetchFeatureServiceLayersAndTables_1 = require("./services/feature-service/fetchFeatureServiceLayersAndTables");
105
108
  Object.defineProperty(exports, "fetchFeatureServiceLayersAndTables", { enumerable: true, get: function () { return fetchFeatureServiceLayersAndTables_1.fetchFeatureServiceLayersAndTables; } });
106
109
  const getRelevantFeatureLayerFields_1 = require("./lib/util/getRelevantFeatureLayerFields");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAiBA,2DAAwD;AA0HpD,6FA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AA+DjD,iHAjEA,mEAAgC,OAiEA;AAChC,oHAjEA,sEAAmC,OAiEA;AA5DvC,qIAAkI;AAiE9H,qHAjEK,2EAAoC,OAiEL;AAhExC,2EAGuD;AAkEnD,mHApEA,4CAAkC,OAoEA;AAClC,wGApEA,iCAAuB,OAoEA;AAjE3B,sHAAmH;AA0D/G,gHA1DK,iEAA+B,OA0DL;AAxDnC,sEAGkD;AA6D9C,8GA/DA,uCAA6B,OA+DA;AAC7B,kGA/DA,2BAAiB,OA+DA;AA5DrB,+HAA4H;AAqDxH,mHArDK,uEAAkC,OAqDL;AAnDtC,yEAGqD;AAwDjD,8GA1DA,uCAA6B,OA0DA;AAC7B,sGA1DA,+BAAqB,OA0DA;AAvDzB,sHAAmH;AA+C/G,mHA/CK,uEAAkC,OA+CL;AA7CtC,4FAAyF;AA8CrF,8GA9CK,6DAA6B,OA8CL;AA5CjC,8FAA2F;AA6CvF,+GA7CK,+DAA8B,OA6CL"}
@@ -4,6 +4,7 @@ exports.checkFeatureServiceFieldValueTypes = exports.FIELD_VALUE_TYPES_REQUIRED_
4
4
  const getRelevantFeatureLayerFields_1 = require("../util/getRelevantFeatureLayerFields");
5
5
  const isFeatureService_1 = require("../util/isFeatureService");
6
6
  const stringsConfig_1 = require("../util/stringsConfig");
7
+ const helpers_1 = require("./helpers");
7
8
  const scoringConfig_1 = require("./scoringConfig");
8
9
  /**
9
10
  * requires 90% of field value types to be present to receive a full score
@@ -58,11 +59,13 @@ const checkFeatureServiceFieldValueTypes = (item, featureLayers) => {
58
59
  });
59
60
  return validationResult;
60
61
  }
61
- // get the count of fields with descriptions provided
62
- const countOfFieldsWithValueType = relevantFields
63
- .filter((field) => field.description)
64
- .filter((field) => { var _a; return (_a = field.description) === null || _a === void 0 ? void 0 : _a.fieldValueType; }).length;
65
- const percentWithValueType = countOfFieldsWithValueType / relevantFields.length;
62
+ // // get the count of fields with descriptions provided
63
+ // const countOfFieldsWithValueType = relevantFields
64
+ // .filter((field) => field.description)
65
+ // .filter((field) => field.description?.fieldValueType).length;
66
+ // const percentWithValueType =
67
+ // countOfFieldsWithValueType / relevantFields.length;
68
+ const percentWithValueType = (0, helpers_1.getPercentFieldsWithValueType)(relevantFields);
66
69
  // if percentWithValueType is 0, then there are no fields with aliases
67
70
  // it should receive a score of 0 and a message to add field aliases
68
71
  if (percentWithValueType === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"checkFeatureServiceFieldValueTypes.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,mDAAgD;AAEhD;;GAEG;AACU,QAAA,kCAAkC,GAAG,GAAG,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACI,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,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;KACvB,CAAC;IAEF,uGAAuG;IACvG,sCAAsC;IACtC,IAAI,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,uCACO,gBAAgB,KACnB,MAAM,EAAE,CAAC,IACX;IACN,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAA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QACH,gBAAgB,CAAC,aAAa;YAC1B,cAAc,CAAC,0BAA0B,GAAG,CAAC,CAAC;QAClD,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,uFAAuF;IACvF,+BAA+B;IAC/B,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AA/EW,QAAA,kCAAkC,sCA+E7C"}
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;AAEhD;;GAEG;AACU,QAAA,kCAAkC,GAAG,GAAG,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACI,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,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;KACvB,CAAC;IAEF,uGAAuG;IACvG,sCAAsC;IACtC,IAAI,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,uCACO,gBAAgB,KACnB,MAAM,EAAE,CAAC,IACX;IACN,CAAC;IA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uFAAuF;IACvF,+BAA+B;IAC/B,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAjFW,QAAA,kCAAkC,sCAiF7C"}
@@ -0,0 +1,16 @@
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
+ 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
+ export declare const getPercentFieldsWithValueType: (fields: FeatureLayerFieldFormatted[]) => number;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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
+ const isValidFieldValueType = (fieldInfo) => {
11
+ var _a;
12
+ if (!fieldInfo ||
13
+ !(fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.description) ||
14
+ !((_a = fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.description) === null || _a === void 0 ? void 0 : _a.fieldValueType)) {
15
+ return false; // Invalid field or missing value type
16
+ }
17
+ return true; // Valid field with a value type
18
+ };
19
+ 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
+ const getPercentFieldsWithValueType = (fields) => {
28
+ if (!fields || !Array.isArray(fields) || fields.length === 0) {
29
+ return 0;
30
+ }
31
+ const countOfFieldsWithValueType = fields.filter((field) => (0, exports.isValidFieldValueType)(field)).length;
32
+ return countOfFieldsWithValueType / fields.length;
33
+ };
34
+ exports.getPercentFieldsWithValueType = getPercentFieldsWithValueType;
35
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/helpers.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,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,CAAC,sCAAsC;IACxD,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,gCAAgC;AACjD,CAAC,CAAC;AAZW,QAAA,qBAAqB,yBAYhC;AAEF;;;;;;GAMG;AACI,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
- {"lastCompiledTime":1749162278338}
1
+ {"lastCompiledTime":1749163188846}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vannizhang/living-atlas-content-validator",
3
- "version": "1.5.19-beta.12",
3
+ "version": "1.5.19-beta.13",
4
4
  "description": "Validation and Scoring rules for curating content in the ArcGIS Living Atlas",
5
5
  "repository": {
6
6
  "type": "git",