From 54e03f60b974838af7d32bf054b29d00da020942 Mon Sep 17 00:00:00 2001 From: Ned Palacios Date: Tue, 1 Dec 2020 22:23:59 +0800 Subject: [PATCH] x.json2: remove builder methods (#7008) --- vlib/x/json2/builder.v | 78 ------------------------------------------ 1 file changed, 78 deletions(-) delete mode 100644 vlib/x/json2/builder.v diff --git a/vlib/x/json2/builder.v b/vlib/x/json2/builder.v deleted file mode 100644 index 573e85a622..0000000000 --- a/vlib/x/json2/builder.v +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved. -// Use of this source code is governed by an MIT license -// that can be found in the LICENSE file. -module json2 - -// Inserts a string into the map. -pub fn (mut obj map[string]Any) insert_str(key string, val string) { - mut fi := Any{} - fi = val - obj[key] = fi -} - -// Inserts an int into the map. -pub fn (mut obj map[string]Any) insert_int(key string, val int) { - obj[key] = Any(val) -} - -// Inserts a float into the map. -pub fn (mut obj map[string]Any) insert_f(key string, val f64) { - obj[key] = Any(val) -} - -// Inserts a null into the map. -pub fn (mut obj map[string]Any) insert_null(key string) { - obj[key] = Any(Null{}) -} - -// Inserts a bool into the map. -pub fn (mut obj map[string]Any) insert_bool(key string, val bool) { - obj[key] = Any(val) -} - -// Inserts a map into the map. -pub fn (mut obj map[string]Any) insert_map(key string, val map[string]Any) { - obj[key] = Any(val) -} - -// Inserts an array into the map. -pub fn (mut obj map[string]Any) insert_arr(key string, val []Any) { - obj[key] = Any(val) -} - -// Inserts a string into the array. -pub fn (mut arr []Any) insert_str(val string) { - mut fi := Any{} - fi = val - arr << fi -} - -// Inserts an int into the array. -pub fn (mut arr []Any) insert_int(val int) { - arr << Any(val) -} - -// Inserts a float into the array. -pub fn (mut arr []Any) insert_f(val f64) { - arr << Any(val) -} - -// Inserts a null into the array. -pub fn (mut arr []Any) insert_null() { - arr << Any(Null{}) -} - -// Inserts a bool into the array. -pub fn (mut arr []Any) insert_bool(val bool) { - arr << Any(val) -} - -// Inserts a map into the array. -pub fn (mut arr []Any) insert_map(val map[string]Any) { - arr << Any(val) -} - -// Inserts an array into the array. -pub fn (mut arr []Any) insert_arr(val []Any) { - arr << Any(val) -}