Skip to content

validateJSONX throws true for a valid jsonx #24

@zjaml

Description

@zjaml

Thank you for this great library. I'm reporting a bug with validateJSONX.

const jsonx = require("jsonx");

test("validate a valid jsonx shouldn't throw error", () => {
  const sampleJSONX = {
    component: "div",
    props: {
      id: "generatedJSONX",
      className: "jsonx"
    },
    asyncprops: {
      test: ["ok", "cool"]
    },
    children: [
      {
        component: "p",
        props: {
          style: {
            color: "red",
            fontWeight: "bold"
          }
        },
        children: "hello world"
      }
    ]
  };
  const validateJSONX = jsonx._jsonxUtils.validateJSONX;

 //BUG:  the following line will throw with a boolean value true.
  validateJSONX(sampleJSONX);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions