Git Product home page Git Product logo

simplejson's People

Contributors

henrikpoulsen avatar l4d15 avatar quinkennedy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplejson's Issues

How to check if JSONNode contains a key quickly?

Hey, been using this repo for a while in projects and it works a treat, I was looking at ways to check quickly if a JSON Node contains a key, and wasn't able to find a way to do that with your version - I tried the below script but there is no definition for node.Keys in your repo.

This works with the Bunny83 SimpleJSON latest version, but we ran into another issue with their version of SimpleJSON where checking if the JSON Node was null in an if statement always returned false even if the JSON was empty! Bunny83/SimpleJSON#45 - I have reported that issue to them there referencing your repo

So your version is great for checking if a JSON Node is null, but there is no way I could see to check quickly if a JSONNode contains a key with yours other than looping through the JSON Node by a section I defined and checking if values contain a string which feels slow - any tips?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace SimpleJSON
{
public class JSONNodeExtension : MonoBehaviour {

	public static bool ContainsKey(SimpleJSON.JSONNode node, string checkKey)
	{
		foreach (string key in node.Keys)
		{
			if (key == checkKey)
				return true;
		}
		return false;
	}

}

}

Thanks for the great and robust version of SimpleJSON

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.