From 623e96feb0acfcdfbebdb8f2ace228c96b81ca9d Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 25 Jul 2016 10:46:58 -0600 Subject: [PATCH] Replaced by acs.js --- core/acs_util.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 core/acs_util.js diff --git a/core/acs_util.js b/core/acs_util.js deleted file mode 100644 index 0f91927d..00000000 --- a/core/acs_util.js +++ /dev/null @@ -1,39 +0,0 @@ -/* jslint node: true */ -'use strict'; - -// ENiGMA½ -var acsParser = require('./acs_parser.js'); - -var _ = require('lodash'); -var assert = require('assert'); - -exports.checkAcs = checkAcs; -exports.getConditionalValue = getConditionalValue; - -function checkAcs(client, acsString) { - return acsParser.parse(acsString, { client : client } ); -} - -function getConditionalValue(client, condArray, memberName) { - assert(_.isObject(client)); - assert(_.isArray(condArray)); - assert(_.isString(memberName)); - - var matchCond = _.find(condArray, function cmp(cond) { - return _.has(cond, 'acs') && acsParser.parse(cond.acs, { client : client } ); - }); - - // - // If no matchCond, look for a default entry. That is, - // a entry without a 'acs' string. - // - if(!matchCond) { - matchCond = _.find(condArray, function cmp(cond) { - return !_.has(cond, 'acs'); - }); - } - - if(matchCond) { - return matchCond[memberName]; - } -} \ No newline at end of file