From 3e1d128f884bcf5e9e56147a3471c100260a864b Mon Sep 17 00:00:00 2001 From: Ryan Van Etten Date: Fri, 23 Jul 2021 16:34:24 -0400 Subject: [PATCH] cache constant variables --- api.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/api.js b/api.js index 3e41c00..4df2177 100644 --- a/api.js +++ b/api.js @@ -1,20 +1,15 @@ !function(esta) { - var api = create() - var nombre = "numerologia" - typeof module != "undefined" && module.exports - ? module.exports = api - : esta[nombre] = api + var latin = "abcdefghijklmnopqrstuvwxyz" + var join = "".join + var split = "".split + var lower = "".toLowerCase + var digit = /^\d+$/ + var round = Math.round + var repeating = /^(.)\1+$/ + var glyph = /[\u0300-\u036f]/g + var norm = "".normalize function create(bet) { - var latin = "abcdefghijklmnopqrstuvwxyz" - var join = "".join - var split = "".split - var lower = "".toLowerCase - var digit = /^\d+$/ - var round = Math.round - var repeating = /^(.)\1+$/ - var glyph = /[\u0300-\u036f]/g - var norm = "".normalize var base = norm ? bass : basic bet = bet ? lower.call(bet) : latin @@ -93,7 +88,12 @@ api.root = raiz api.sum = suma api.suma = suma - return api } + + var api = create() + var nombre = "numerologia" + typeof module != "undefined" && module.exports + ? module.exports = api + : esta[nombre] = api }(this)