"use strict";
/**
 * Ported from https://github.com/optimizely/client-js/blob/main/src/plugins/feature_platform/matchers/platform.ts#L12
 */
/**
 * @type ConditionMatcher
 */
module.exports = {
    fieldsNeeded: ['platform'],
    /**
     * @param {Object} value
     * @param {string} value.platform
     * @param {Condition} cond
     * @return {Boolean}
     */
    match: function (value, cond) {
        var platform = value.platform;
        var targetedPlatform = cond.value, 
        // Split platform name from version.
        targetedPlatformParts = targetedPlatform.split('_'), targetedPlatformName = targetedPlatformParts[0];
        return targetedPlatformName === platform.name;
    },
};
