This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/env-var/lib/accessors/enum.js
T

14 lines
289 B
JavaScript

'use strict'
const asString = require('./string')
module.exports = function asEnum (value, validValues) {
const valueString = asString(value)
if (validValues.indexOf(valueString) < 0) {
throw new Error(`should be one of [${validValues.join(', ')}]`)
}
return valueString
}