@rip-lang/api 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.rip +4 -4
- package/package.json +1 -1
package/api.rip
CHANGED
|
@@ -236,7 +236,7 @@ export prefix = (base, fn) ->
|
|
|
236
236
|
old = _prefix
|
|
237
237
|
_prefix = "#{_prefix}#{base}"
|
|
238
238
|
try
|
|
239
|
-
fn
|
|
239
|
+
fn?.()
|
|
240
240
|
finally
|
|
241
241
|
_prefix = old
|
|
242
242
|
|
|
@@ -283,7 +283,7 @@ export fetch = (req) ->
|
|
|
283
283
|
c = createContext(req, match.params)
|
|
284
284
|
|
|
285
285
|
# Run raw filter before body parsing (e.g., fix content-type)
|
|
286
|
-
_rawFilter
|
|
286
|
+
_rawFilter?.(req) if method in ['POST', 'PUT', 'PATCH']
|
|
287
287
|
|
|
288
288
|
# Pre-parse body and query for sync read() — baked in, zero ceremony
|
|
289
289
|
data = {}
|
|
@@ -342,7 +342,7 @@ export start = (opts = {}) ->
|
|
|
342
342
|
|
|
343
343
|
export App = (fn) ->
|
|
344
344
|
resetGlobals()
|
|
345
|
-
fn
|
|
345
|
+
fn?.()
|
|
346
346
|
startHandler()
|
|
347
347
|
|
|
348
348
|
# ==============================================================================
|
|
@@ -401,7 +401,7 @@ toMoney = (value, half, cents) ->
|
|
|
401
401
|
c = if neg then -c else c
|
|
402
402
|
if cents then c else c / 100
|
|
403
403
|
|
|
404
|
-
export toName = (str, type
|
|
404
|
+
export toName = (str, ...type) ->
|
|
405
405
|
s = String(str)
|
|
406
406
|
s = s.toLowerCase().replace(/\s+/g, ' ').trim()
|
|
407
407
|
s = s.replace /(^|(?<=\P{L}))(\p{L})/gu, (m, pre, ch) -> pre + ch.toUpperCase()
|