Skip to content

Instantly share code, notes, and snippets.

View naveen-ithappu's full-sized avatar
🎯
Focusing on RichTextEditor for React Native

Naveen Ithapu naveen-ithappu

🎯
Focusing on RichTextEditor for React Native
  • Hyderabad
View GitHub Profile
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@naveen-ithappu
naveen-ithappu / ArrayToHashMap
Last active February 29, 2024 08:50
Converts Array of Objects to HashMap
function isFunction(func){
return Object.prototype.toString.call(func) === '[object Function]';
}
/**
* This function converts an array to hash map
* @param {String | function} key describes the key to be evaluated in each object to use as key for hasmap
* @returns Object
* @Example
* [{id:123, name:'naveen'}, {id:345, name:"kumar"}].toHashMap("id")
@naveen-ithappu
naveen-ithappu / trace.js
Created August 30, 2017 11:49 — forked from guybedford/trace.js
RequireJS tracer
/*
* requireJS trace
*
* Given a configuration object, as would be passed to the optimizer,
* runs a raw build trace on the configuration, returning the traced
* dependency trees.
*
* Loaded as a requirejs module on the server.
*
* eg: