UNPKG

@o3r/rules-engine

Version:

This module provides a rule engine that can be executed on your Otter application to customize your application (translations, placeholders and configs) based on a json file generated by your CMS.

21 lines 879 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ruleFactMetadataComparator = void 0; /** * Returns an array of ruleFact metadata from a metadata file. * @param content Content of a migration metadata file */ const getRuleFactArray = (content) => content; const getRuleFactName = (ruleFact) => ruleFact.name; const isRelevantContentType = (contentType) => contentType === 'RULE_FACT'; const isMigrationRuleFactDataMatch = (ruleFact, migrationData) => getRuleFactName(ruleFact) === migrationData.name; /** * Comparator used to compare one version of ruleFact metadata with another */ exports.ruleFactMetadataComparator = { getArray: getRuleFactArray, getIdentifier: getRuleFactName, isRelevantContentType, isMigrationDataMatch: isMigrationRuleFactDataMatch }; //# sourceMappingURL=rulefact-metadata-comparison.helper.js.map