jamp/utils

Source   Edit  

Contains utils for library. Mostly for internal use

Procs

func getFullType(obj: NimNode): NimNode {....raises: [], tags: [], forbids: [].}
Fully gets the ObjectTy or symbol (if type like string of int) of an type. Doesn't recurse through seqT though Source   Edit  
func getParam(obj: NimNode; key: string): NimNode {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
func hasParam(obj: NimNode; key: string): bool {....raises: [], tags: [],
    forbids: [].}
Returns true if object has a parameter Source   Edit  
func isEmpty(obj: NimNode): bool {....raises: [], tags: [], forbids: [].}
Returns true if object is of type nnkEmpty Source   Edit  
func isJson(resp: Response | AsyncResponse): bool
Checks if the response is a json object Source   Edit  
func isNumeric(x: openArray[char]): bool {....raises: [], tags: [], forbids: [].}
Returns true if x is fully made of digits

Example:

assert "0912".isNumeric
assert not "l".isNumeric
Source   Edit  
func isSeq(x: NimNode): bool {....raises: [], tags: [], forbids: [].}
Checks if a NimNode is a seqT Source   Edit