Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const [prefix, keyName] = splitOnColon(dataNodeItem)
const dataNodeName = has(prefix, sourceData)
? prefix
: resolveDataAlias(prefix)
if (isUndefined(dataNodeName)) {
const availableKeys = without([SCOPES, ALIASES])(
concat(keys(sourceData), keys(config.data[ALIASES]))
)
throwDataError(unrecognisedDataPrefixError(prefix, availableKeys))
}
const dataNode = prop(dataNodeName, sourceData)
if (isUndefined(dataNode))
throwDataError(missingDataNodeError(dataNodeName))
const resolvedValue = prop(keyName, dataNode)
if (isUndefined(resolvedValue))
throwDataError(missingDataItemKeyError(dataNodeName, keyName))
// eslint-disable-next-line no-use-before-define
return expandDataNodeItem(sourceData)(resolvedValue)
}
const expandToken = sourceData => dataNodeItem => {
const [prefix, keyName] = splitOnColon(dataNodeItem)
const dataNodeName = has(prefix, sourceData)
? prefix
: resolveDataAlias(prefix)
if (isUndefined(dataNodeName)) {
const availableKeys = without([SCOPES, ALIASES])(
concat(keys(sourceData), keys(config.data[ALIASES]))
)
throwDataError(unrecognisedDataPrefixError(prefix, availableKeys))
}
const dataNode = prop(dataNodeName, sourceData)
if (isUndefined(dataNode))
throwDataError(missingDataNodeError(dataNodeName))
const resolvedValue = prop(keyName, dataNode)
if (isUndefined(resolvedValue))
throwDataError(missingDataItemKeyError(dataNodeName, keyName))
// eslint-disable-next-line no-use-before-define
return expandDataNodeItem(sourceData)(resolvedValue)
}
const expandToken = sourceData => dataNodeItem => {
const [prefix, keyName] = splitOnColon(dataNodeItem)
const dataNodeName = has(prefix, sourceData)
? prefix
: resolveDataAlias(prefix)
if (isUndefined(dataNodeName)) {
const availableKeys = without([SCOPES, ALIASES])(
concat(keys(sourceData), keys(config.data[ALIASES]))
)
throwDataError(unrecognisedDataPrefixError(prefix, availableKeys))
}
const dataNode = prop(dataNodeName, sourceData)
if (isUndefined(dataNode))
throwDataError(missingDataNodeError(dataNodeName))
const resolvedValue = prop(keyName, dataNode)
if (isUndefined(resolvedValue))
throwDataError(missingDataItemKeyError(dataNodeName, keyName))
// eslint-disable-next-line no-use-before-define
return expandDataNodeItem(sourceData)(resolvedValue)
}
function MonetEitherT(monad, isRightValue = true) {
if (isUndefined(new.target)) {
if (isNotNull(FlutureTMonetEither) && isFuture(monad)) {
return FlutureTMonetEither.fromFuture(monad);
} else if (monad instanceof Identity.fn.init) {
return Either.of(monad.get());
} else if (monad instanceof Either.fn.init && isNotNull(FlutureTMonetEither)) {
return FlutureTMonetEither.fromEither(monad);
}
return new MonetEitherT(monad);
}
this.run = monad;
this.isRightValue = isRightValue;
}
function FlutureTMonetEither(monad) {
if (isUndefined(new.target)) {
if (isFuture(monad)) {
return FlutureTMonetEither.fromFuture(monad);
} else if (monad instanceof Identity.fn.init) {
return FlutureTMonetEither.fromValue(monad.get());
} else if (monad instanceof Either.fn.init) {
return FlutureTMonetEither.fromEither(monad);
}
throw new Error('FlutureTMonetEither can transform only specific monad types');
}
this.run = monad;
this['@@type'] = this.constructor['@@type'];
}