From a6a78f160e996d837a17896562af1017eb6fde25 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 11 Jul 2025 14:45:07 -0300 Subject: src/sjs.mjs: Add isNumeric() --- src/sjs.mjs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sjs.mjs') diff --git a/src/sjs.mjs b/src/sjs.mjs index 0b2c705..2c9d551 100644 --- a/src/sjs.mjs +++ b/src/sjs.mjs @@ -1,6 +1,10 @@ export const max = (a, b) => a > b ? a : b; export const min = (a, b) => a < b ? a : b; +export const isNumeric = c => + c.charCodeAt(0) >= "0".charCodeAt(0) && + c.charCodeAt(0) <= "9".charCodeAt(0); + export const explode = s => s.split(""); export const getIn = (obj, path) => -- cgit v1.2.3