summaryrefslogtreecommitdiff
path: root/src/sjs.mjs
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-07-11 14:45:07 -0300
committerEuAndreh <eu@euandre.org>2025-07-11 14:45:07 -0300
commita6a78f160e996d837a17896562af1017eb6fde25 (patch)
tree8a69cdcca72c250115064353fc6937dc9a704cf2 /src/sjs.mjs
parentUse .mjs extension; add reduce(); finish tests; export names correctly. (diff)
downloadsjs-a6a78f160e996d837a17896562af1017eb6fde25.tar.gz
sjs-a6a78f160e996d837a17896562af1017eb6fde25.tar.xz
src/sjs.mjs: Add isNumeric()
Diffstat (limited to 'src/sjs.mjs')
-rw-r--r--src/sjs.mjs4
1 files changed, 4 insertions, 0 deletions
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) =>