wangzhibo
2026-05-09 53418655c061ac26f66058253f39200aced1ab1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict'
 
const partIsNotNumeric = part => /^\d+$/.test(part) === false
 
/**
 * Determines if a passed in string is a dotted decimal string.
 *
 * @param {string} value
 *
 * @returns {boolean}
 */
module.exports = function isDottedDecimal (value) {
  if (typeof value !== 'string') return false
 
  const parts = value.split('.')
  const nonNumericParts = parts.filter(partIsNotNumeric)
 
  return nonNumericParts.length === 0
}