newrelic
Version:
New Relic agent
27 lines (22 loc) • 439 B
JavaScript
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
const VALID_ATTR_TYPES = new Set([
'string',
'number',
'boolean'
])
/**
* Checks incoming attribute value against valid types:
* string, number, & boolean.
*
* @param {*} val
*
* @return {boolean}
*/
function isValidType(val) {
return VALID_ATTR_TYPES.has(typeof val)
}
module.exports = isValidType