From cd24c5904b79bc96f489fe8c351dd4a804d8baf5 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 13 May 2022 17:21:13 -0400 Subject: [PATCH] WIP --- src/util/pluginUtils.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/util/pluginUtils.js b/src/util/pluginUtils.js index 88701104a..a3361abd7 100644 --- a/src/util/pluginUtils.js +++ b/src/util/pluginUtils.js @@ -46,14 +46,6 @@ function resolveArbitraryValue(modifier, validate) { return undefined } -function asNegativeValue(modifier, lookup = {}, validate) { - let positiveValue = lookup[modifier] - - if (positiveValue !== undefined) { - return negateValue(positiveValue) - } -} - export function asValue(modifier, options = {}, { candidate, validate = () => true } = {}) { if (isArbitraryValue(modifier)) { let resolved = resolveArbitraryValue(modifier, validate) @@ -76,7 +68,11 @@ export function asValue(modifier, options = {}, { candidate, validate = () => tr } if (options.supportsNegativeValues && modifier.startsWith('-')) { - return asNegativeValue(modifier.slice(1), options.values, validate) + let positiveValue = options.values[modifier.slice(1)] + + if (positiveValue !== undefined) { + return negateValue(positiveValue) + } } return undefined