From 65d3e516509ed38ea840b641bae19600c9daf266 Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire Date: Mon, 27 May 2013 03:32:51 -0700 Subject: [PATCH] rename json.existsKey to hasKey, deprecates existsKey --- lib/pure/json.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pure/json.nim b/lib/pure/json.nim index d2516adfb0..df20bd8524 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -641,11 +641,13 @@ proc `[]`*(node: PJsonNode, index: Int): PJsonNode = assert(node.kind == JArray) return node.elems[index] -proc existsKey*(node: PJsonNode, key: String): Bool = +proc hasKey*(node: PJsonNode, key: String): Bool = ## Checks if `key` exists in `node`. assert(node.kind == JObject) for k, item in items(node.fields): if k == key: return True +proc existsKey*(node: PJsonNode, key: String): Bool {.deprecated.} = node.hasKey(key) + ## Deprecated for `hasKey` proc add*(father, child: PJsonNode) = ## Adds `child` to a JArray node `father`.