CVE-2020-17479 (JavaScript, published 2020-08-10T20:15Z)
Description: value: jpv (aka Json Pattern Validator) before 2.2.2 does not properly validate input, as demonstrated by a corrupted array.
Severity: HIGH (CVSS v3 base score: 9.8)
Weakness: CWE-20 \u2014 Improper Input Validation
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.
Repository: https://github.com/manvel-khnkoyan/jpv
Files changed:
README.md
index.js
package-lock.json
package.json
test/arrays.js
test/deprecated.js
test/functional.js
test/modes.js
test/native-types.js
test/operators.js
test/patterns.js
test/special-cases.js
Commit message: Fixed Validation Bypass Issue #10


Vulnerable code:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
  </component>
</project>
Validating a JSON object by comparing it with a pattern object, passing through all the nodes of the pattern using constious simple validation methods.
  json, // --> The JSON Object you want to validate
  pattern // --> The pattern object using the same structure as JSON with the validation patterns.
#### "and", "or", "not" operators
     key1: 'example@gmal.com',
#### Functional
#### Modes
#### Arrays
#### Debugging
            val = String(pattern)
            JSON.stringify(pattern)

            `${String(value)}} not matched with: ${val}`);
        if (value.hasOwnProperty(property)) {
                if (!pattern.hasOwnProperty(property)) {
                if ((pattern[property].constructor === Array) && (pattern[property].length > 0)) {
                    if (value[property].constructor !== Array) {
      "version": "7.9.5",
      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz",
      "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==",
        "@babel/types": "^7.9.5",
        "lodash": "^4.17.13",
      "version": "7.9.5",
      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz",
      "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==",
        "@babel/helper-get-function-arity": "^7.8.3",
        "@babel/template": "^7.8.3",
        "@babel/types": "^7.9.5"
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz",
      "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==",
        "@babel/types": "^7.8.3"
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz",
      "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==",
        "@babel/types": "^7.8.3"
      "version": "7.9.5",
      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz",
      "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==",
      "dev": true
    },
    "@babel/parser": {
      "version": "7.9.4",
      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz",
      "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==",
    "@babel/runtime": {
      "version": "7.9.2",
      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz",
      "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==",
        "regenerator-runtime": "^0.13.4"
      "version": "7.8.6",
      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz",
      "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==",
        "@babel/code-frame": "^7.8.3",
        "@babel/parser": "^7.8.6",
        "@babel/types": "^7.8.6"
      },
      "dependencies": {
        "@babel/code-frame": {
          "version": "7.8.3",
          "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
          "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
          "dev": true,
          "requires": {
            "@babel/highlight": "^7.8.3"
          }
        },
        "@babel/highlight": {
          "version": "7.9.0",
          "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz",
          "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==",
          "dev": true,
          "requires": {
            "@babel/helper-validator-identifier": "^7.9.0",
            "chalk": "^2.0.0",
            "js-tokens": "^4.0.0"
          }
        }
      "version": "7.9.5",
      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz",
      "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==",
        "@babel/code-frame": "^7.8.3",
        "@babel/generator": "^7.9.5",
        "@babel/helper-function-name": "^7.9.5",
        "@babel/helper-split-export-declaration": "^7.8.3",
        "@babel/parser": "^7.9.0",
        "@babel/types": "^7.9.5",
        "lodash": "^4.17.13"
      },
      "dependencies": {
        "@babel/code-frame": {
          "version": "7.8.3",
          "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
          "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
          "dev": true,
          "requires": {
            "@babel/highlight": "^7.8.3"
          }
        },
        "@babel/highlight": {
          "version": "7.9.0",
          "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz",
          "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==",
          "dev": true,
          "requires": {
            "@babel/helper-validator-identifier": "^7.9.0",
            "chalk": "^2.0.0",
            "js-tokens": "^4.0.0"
          }
        }
      "version": "7.9.5",
      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz",
      "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==",
        "@babel/helper-validator-identifier": "^7.9.5",
        "lodash": "^4.17.13",
      "version": "6.10.2",
      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
      "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
        "fast-deep-equal": "^2.0.1",
      "version": "1.9.1",
      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
      "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz",
      "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==",
      "version": "3.3.1",
      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz",
      "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==",
        "readdirp": "~3.3.0"
      "version": "3.0.11",
      "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.11.tgz",
      "integrity": "sha512-LZPWPR2NyGKyaABnc49dR0fpeP6UqhvGq4B5nUrTQ1UBy55z96+ga7r+/ChMdMJUwBgyJDXBi88UBgz2rs9IiQ==",
        "request": "^2.88.0"
      },
      "dependencies": {
        "minimist": {
          "version": "1.2.5",
          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
          "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
          "dev": true
        }
      "version": "6.0.5",
      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
      "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
        "nice-try": "^1.0.4",
        "path-key": "^2.0.1",
        "semver": "^5.5.0",
        "shebang-command": "^1.2.0",
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
      "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
      "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
      "version": "0.123.0",
      "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.123.0.tgz",
      "integrity": "sha512-scMjcsICxtHm141rFTfWgKnNbz9MUubgc9kNSh+0xvTYIA/L+9AzlPRK0FMcfNiqQTWjn0IMGqiwySLzMZVvtw==",
      "version": "2.123.0",
      "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.123.0.tgz",
      "integrity": "sha512-sxSSPbl8sap5P6goX+zYMRsMKtSHdbgAwHXvfGVyaPTkXM6Jz4TeODwQiVTvDiu/OLMxyXk6IKYVMkWbpWiTIQ==",
        "flow-parser": "^0.123.0",
      },
      "dependencies": {
        "cross-spawn": {
          "version": "4.0.2",
          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
          "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=",
          "dev": true,
          "requires": {
            "lru-cache": "^4.0.1",
            "which": "^1.2.9"
          }
        }
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz",
      "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
      "version": "4.2.3",
      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
      "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
      "version": "5.1.3",
      "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
      "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
        "ajv": "^6.5.5",
      "version": "3.13.1",
      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
      "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
      "version": "4.17.15",
      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
      "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
      "version": "1.43.0",
      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
      "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==",
      "version": "2.1.26",
      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
      "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
        "mime-db": "1.43.0"
      "version": "0.0.8",
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
      "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz",
      "integrity": "sha512-UFqVihv6PQgwj8/yTGvl9kPz7xIAY+R5z6XYjRInD3Gk3qx6QGSD6zEcpeG4Dy/lQnv1J6zv8ejV90hyYIKf3w==",
      "version": "0.5.1",
      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
      "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
        "minimist": "0.0.8"
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz",
      "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==",
        "picomatch": "^2.0.7"
    "regenerator-runtime": {
      "version": "0.13.5",
      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
      "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
      "dev": true
    },
      "version": "1.16.1",
      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.1.tgz",
      "integrity": "sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig==",
      "version": "2.6.3",
      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
      "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
      "version": "5.2.0",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
      "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
      "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
      "version": "0.5.17",
      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.17.tgz",
      "integrity": "sha512-bwdKOBZ5L0gFRh4KOxNap/J/MpvX9Yxsq9lFDx65s3o7F/NiHy7JRaGIS8MwW6tZPAq9UXE207Il0cfcb5yu/Q==",
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
      "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
      "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==",
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
      "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
      "version": "14.10.7",
      "resolved": "https://registry.npmjs.org/tap/-/tap-14.10.7.tgz",
      "integrity": "sha512-DVx00lfiMxFhofwFDP77pitRCruVQJn8Dcj/6auIU3dErJQWsKT94oG6Yj0MQRuYANhSec8ruIPyUjH/RI9Hrw==",
        "coveralls": "^3.0.8",
        "mkdirp": "^0.5.1",
          "version": "7.8.3",
            "@babel/highlight": "^7.8.3"
          "version": "7.8.7",
            "@babel/code-frame": "^7.8.3",
            "@babel/generator": "^7.8.7",
            "@babel/helpers": "^7.8.4",
            "@babel/parser": "^7.8.7",
            "@babel/template": "^7.8.6",
            "@babel/traverse": "^7.8.6",
            "@babel/types": "^7.8.7",
            "json5": "^2.1.0",
            "lodash": "^4.17.13",
          "version": "7.8.8",
            "@babel/types": "^7.8.7",
            "lodash": "^4.17.13",
          "version": "7.8.3",
            "@babel/types": "^7.8.3",
            "esutils": "^2.0.0"
          "version": "7.8.3",
            "@babel/helper-get-function-arity": "^7.8.3",
            "@babel/template": "^7.8.3",
            "@babel/types": "^7.8.3"
          "version": "7.8.3",
            "@babel/types": "^7.8.3"
          "version": "7.8.3",
          "version": "7.8.3",
            "@babel/types": "^7.8.3"
          "version": "7.8.4",
            "@babel/template": "^7.8.3",
            "@babel/traverse": "^7.8.4",
            "@babel/types": "^7.8.3"
          "version": "7.8.3",
            "esutils": "^2.0.2",
          "version": "7.8.8",
          "version": "7.8.3",
            "@babel/helper-plugin-utils": "^7.8.3",
            "@babel/plugin-syntax-object-rest-spread": "^7.8.0"
          "version": "7.8.3",
            "@babel/helper-plugin-utils": "^7.8.3"
          "version": "7.8.8",
            "@babel/helper-plugin-utils": "^7.8.3"
        "@babel/plugin-transform-react-jsx": {
          "version": "7.8.3",
            "@babel/helper-builder-react-jsx": "^7.8.3",
            "@babel/helper-plugin-utils": "^7.8.3",
            "@babel/plugin-syntax-jsx": "^7.8.3"
        "@babel/runtime": {
          "version": "7.8.7",
            "regenerator-runtime": "^0.13.4"
          "version": "7.8.6",
            "@babel/code-frame": "^7.8.3",
            "@babel/parser": "^7.8.6",
            "@babel/types": "^7.8.6"
          "version": "7.8.6",
            "@babel/code-frame": "^7.8.3",
            "@babel/generator": "^7.8.6",
            "@babel/helper-function-name": "^7.8.3",
            "@babel/helper-split-export-declaration": "^7.8.3",
            "@babel/parser": "^7.8.6",
            "@babel/types": "^7.8.6",
            "lodash": "^4.17.13"
          "version": "7.8.7",
            "esutils": "^2.0.2",
            "lodash": "^4.17.13",
          "version": "16.9.23",
          "version": "1.9.1",
          "version": "2.6.9",
        "esutils": {
          "version": "2.0.3",
          "bundled": true,
          "dev": true
        },
          "version": "2.1.2",
          "version": "4.17.15",
          "version": "3.1.1",
        "regenerator-runtime": {
          "version": "0.13.5",
          "bundled": true,
          "dev": true
        },
          "version": "1.15.1",
        "rimraf": {
          "version": "2.7.1",
          "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
          "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
          "dev": true,
          "requires": {
            "glob": "^7.1.3"
          }
        },
          "version": "3.0.2",
        "which": {
          "version": "2.0.2",
          "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
          "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
          "dev": true,
          "requires": {
            "isexe": "^2.0.0"
          }
        },
          "version": "1.8.2",
          "dev": true,
          "requires": {
            "@babel/runtime": "^7.8.7"
          }
          "version": "1.9.5",
            "@types/yoga-layout": "1.9.1"
      "version": "10.0.1",
      "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-10.0.1.tgz",
      "integrity": "sha512-qdT15H0DoJIi7zOqVXDn9X0gSM68JjNy1w3VemwTJlDnETjbi6SutnqmBfjDJAwkFS79NJ97gZKqie00ZCGmzg==",
      "version": "8.8.2",
      "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.2.tgz",
      "integrity": "sha512-duVj6BpSpUpD/oM4MfhO98ozgkp3Gt9qIp3jGxwU2DFvl/3IRaEAvbLa8G60uS7C77457e/m5TMowjedeRxI1Q==",
        "source-map-support": "^0.5.6",
      "version": "3.8.3",
      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz",
      "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==",
      "version": "1.3.1",
      "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
      "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
      "version": "1.9.1",
      "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.1.tgz",
      "integrity": "sha512-xbWX1ayUVoW8DPM8qxOBowac4XxSTi0mFLbiokRq880ViYglN+F3nJ4Dc2GdypXpykrknKS39d8I3lzFoHv1kA==",
      "dev": true,
      "requires": {
        "@babel/runtime": "^7.9.2"
      }
  "description": "Json Pattern Validator",
    "node",
    "validate",
    "javascript",
  "homepage": "https://github.com/manvel-khnkoyan/jpv#readme"
const { validate, is, typeOf } = require('../index.js');
    key3: 15,
}
const { validate, is, typeOf, exact } = require('../index.js');
    },

    key4: '[datetime]',
    function: () => {},
    object: [],
    object: '(object)',
    object: '(object)',
    object: typeOf('object'),
    object: typeOf('function'), // invalid
    value: or(is('lt(100)'), and( not('1000'), is('lte(999)'), is('gt(900)'))),
    value: or(is('lt(100)'), and( not('1000'), is('lt(999)'), is('gt(900)'))),
    value: or(is('lt(100)'), and( not(is('eq(999)')), is('lt(9999)'), is('gt(900)'))),



const j1 = {exist: null};
const s1 = {exist: '![exist]'};
const o1 = {exist: not(is('exist'))};
const j2 = {empty: 'yes'};
const s2 = {empty: '[empty]'};
const o2 = {empty: is('empty')};
const j3 = {empty: [1,2]};
const s3 = {empty: '[empty]'};
const o3 = {empty: is('empty')};
const j4 = {empty: 'OK'};
const s4 = {empty: '[boolean]'};
const o4 = {empty: is('boolean')};
const j5 = {empty: 'OK'};
const s5 = {empty: '[float]'};
const o5 = {empty: is('float')};
const j6 = {empty: 'OK'};
const s6 = {empty: '[double]'};
const o6 = {empty: is('double')};
const j7 = {empty: '-5'};
const s7 = {empty: '[naturalNumber]'};
const o7 = {empty: is('naturalNumber')};
const j8 = {empty: '34a'};
const s8 = {empty: '[number]'};
const o8 = {empty: is('number')};
const j9 = {empty: 1.5};
const s9 = {empty: '[integer]'};
const o9 = {empty: is('integer')};
const j10 = {empty: 'https://somedomain'};
const s10 = {empty: '[url]'};
const o10 = {empty: is('url')};
const j11 = {empty: 'root@dom.c'};
const s11 = {empty: '[email]'};
const o11 = {empty: is('email')};
const j12 = {empty: '2018'};
const s12 = {empty: '[date]'};
const o12 = {empty: is('date')};
const j13 = {empty: '2018-12-05:40'};
const s13 = {empty: '[datetime]'};
const o13 = {empty: is('datetime')};
const j14 = {empty: 'abc'};
const s14 = {empty: '[length(4)]'};
const o14 = {empty: is('length(4)')};
const j15 = {empty: 'abc'};
const s15 = {empty: '[min-length(4)]'};
const o15 = {empty: is('min-length(4)')};
const j16 = {empty: 'abc'};
const s16 = {empty: '[max-length(2)]'};
const o16 = {empty: is('max-length(2)')};
const j17 = {empty: null};
const s17 = {empty: '[eq(2)]'};
const o17 = {empty: is('eq(2)')};
const j18 = {empty: 'abc'};
const s18 = {empty: '[lt(2)]'};
const o18 = {empty: is('lt(2)')};
const j19 = {empty: 0};
const s19 = {empty: '[gt(2)]'};
const o19 = {empty: is('gt(2)')};
const j20 = {empty:  15};
const s20 = {empty: '[lte(10)]'};
const o20 = {empty: is('lte(10)')};
const j21 = {empty: '50'};
const s21 = {empty: '[gte(51)]'};
const o21 = {empty: is('gte(51)')};
const {is} = jpv;
    key2: NaN,

Fixed code:
Validating a JSON object by comparing it by source like pattern, passing through all the nodes of the pattern using constious simple validation methods.
  json,   // --> The JSON Object you want to validate
  pattern // --> The json-like pattern
### "and", "or", "not" operators
     key1: 'example@gmail.com',
### Functional
### Modes
### Arrays
### Debugging
/**
 * Custom Is Array
 * @param value
 * @returns boolean
 */
function isArray (value) {
    if (Object.prototype.hasOwnProperty.call(Array, 'isArray')) {
        return Array.isArray(value);
    }
    if (typeof value !== 'object') {
        return false;
    }
    if (Object.prototype.toString.call(value) !== '[object Array]') {
        return false;
    }
    if (!(value instanceof Array)) {
        return false;
    }
    return true;
}

            val = String(pattern);
            JSON.stringify(pattern);
                `${String(value)}} not matched with: ${val}`);
        if (isArray(pattern)) {
            return res(isArray(value));
        }

        if (Object.prototype.hasOwnProperty.call(value, String(property))) {
                if (!Object.prototype.hasOwnProperty.call(pattern, String(property))) {
                if ((isArray(pattern[property])) && (pattern[property].length > 0)) {
                    if (!isArray(value[property])) {
    "@babel/code-frame": {
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
      "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
      "dev": true,
      "requires": {
        "@babel/highlight": "^7.10.4"
      }
    },
      "version": "7.11.0",
      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz",
      "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==",
        "@babel/types": "^7.11.0",
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz",
      "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==",
        "@babel/helper-get-function-arity": "^7.10.4",
        "@babel/template": "^7.10.4",
        "@babel/types": "^7.10.4"
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz",
      "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==",
        "@babel/types": "^7.10.4"
      "version": "7.11.0",
      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz",
      "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==",
        "@babel/types": "^7.11.0"
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
      "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==",
    "@babel/highlight": {
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
      "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
        "@babel/helper-validator-identifier": "^7.10.4",
        "chalk": "^2.0.0",
        "js-tokens": "^4.0.0"
    "@babel/parser": {
      "version": "7.11.2",
      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.2.tgz",
      "integrity": "sha512-Vuj/+7vLo6l1Vi7uuO+1ngCDNeVmNbTngcJFKCR/oEtz8tKz0CJxZEGmPt9KcIloZhOZ3Zit6xbpXT2MDlS9Vw==",
      "dev": true
    },
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz",
      "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==",
        "@babel/code-frame": "^7.10.4",
        "@babel/parser": "^7.10.4",
        "@babel/types": "^7.10.4"
      "version": "7.11.0",
      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz",
      "integrity": "sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==",
        "@babel/code-frame": "^7.10.4",
        "@babel/generator": "^7.11.0",
        "@babel/helper-function-name": "^7.10.4",
        "@babel/helper-split-export-declaration": "^7.11.0",
        "@babel/parser": "^7.11.0",
        "@babel/types": "^7.11.0",
        "lodash": "^4.17.19"
      "version": "7.11.0",
      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz",
      "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==",
        "@babel/helper-validator-identifier": "^7.10.4",
        "lodash": "^4.17.19",
      "version": "6.12.3",
      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
      "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
        "fast-deep-equal": "^3.1.1",
      "version": "1.10.0",
      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz",
      "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz",
      "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
      "version": "3.4.2",
      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz",
      "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==",
        "readdirp": "~3.4.0"
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz",
      "integrity": "sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ==",
        "request": "^2.88.2"
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
      "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=",
        "lru-cache": "^4.0.1",
      },
      "dependencies": {
        "which": {
          "version": "1.3.1",
          "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
          "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
          "dev": true,
          "requires": {
            "isexe": "^2.0.0"
          }
        }
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
      "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
      "version": "0.131.0",
      "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.131.0.tgz",
      "integrity": "sha512-S61g70eHtnSn6SQqCgA+aXArupZp/0oku4Uyb8sFZH2HldSUkLUwWeh1Afl9BpQutNfNKaO+efpD2Yvek+EGuA==",
      "version": "2.131.0",
      "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.131.0.tgz",
      "integrity": "sha512-0xt+29raAMGWaxBHBwMF0/2FCFnHsbKRgsYXSAjC4WKuFqrjx7ZSqeBbtS+7ZNkFbet5/G7woRhvKXzr7iE6qQ==",
        "flow-parser": "^0.131.0",
      "version": "2.1.3",
      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
      "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
      "version": "4.2.4",
      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
      "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
      "version": "5.1.5",
      "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
      "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
        "ajv": "^6.12.3",
      },
      "dependencies": {
        "cross-spawn": {
          "version": "6.0.5",
          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
          "dev": true,
          "requires": {
            "nice-try": "^1.0.4",
            "path-key": "^2.0.1",
            "semver": "^5.5.0",
            "shebang-command": "^1.2.0",
            "which": "^1.2.9"
          }
        },
        "which": {
          "version": "1.3.1",
          "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
          "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
          "dev": true,
          "requires": {
            "isexe": "^2.0.0"
          }
        }
      "version": "3.14.0",
      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
      "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
      "version": "4.17.19",
      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
      "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
      "version": "1.44.0",
      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
      "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
      "version": "2.1.27",
      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
      "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
        "mime-db": "1.44.0"
      "version": "1.2.5",
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
      "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz",
      "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==",
      "version": "0.5.5",
      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
      "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
        "minimist": "^1.2.5"
      "version": "3.4.0",
      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz",
      "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==",
        "picomatch": "^2.2.1"
      "version": "1.17.0",
      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
      "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
      "version": "2.7.1",
      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
      "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
      "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
      "version": "0.5.19",
      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
      "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
      },
      "dependencies": {
        "which": {
          "version": "1.3.1",
          "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
          "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
          "dev": true,
          "requires": {
            "isexe": "^2.0.0"
          }
        }
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
      "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
      "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
      "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
      "version": "14.10.8",
      "resolved": "https://registry.npmjs.org/tap/-/tap-14.10.8.tgz",
      "integrity": "sha512-aamkWefJ0G8GGf9t5LWFtrNF5tfVd8ut/tDUianLF6N4621ERITIl0qkocWCVEnsM6hZnaMKa+SggSAaBlC2tA==",
        "coveralls": "^3.0.11",
        "mkdirp": "^0.5.4",
          "version": "7.10.4",
            "@babel/highlight": "^7.10.4"
          "version": "7.10.5",
            "@babel/code-frame": "^7.10.4",
            "@babel/generator": "^7.10.5",
            "@babel/helper-module-transforms": "^7.10.5",
            "@babel/helpers": "^7.10.4",
            "@babel/parser": "^7.10.5",
            "@babel/template": "^7.10.4",
            "@babel/traverse": "^7.10.5",
            "@babel/types": "^7.10.5",
            "json5": "^2.1.2",
            "lodash": "^4.17.19",
          "version": "7.10.5",
            "@babel/types": "^7.10.5",
        "@babel/helper-annotate-as-pure": {
          "version": "7.10.4",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/types": "^7.10.4"
          }
        },
          "version": "7.10.4",
            "@babel/helper-annotate-as-pure": "^7.10.4",
            "@babel/types": "^7.10.4"
          }
        },
        "@babel/helper-builder-react-jsx-experimental": {
          "version": "7.10.5",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/helper-annotate-as-pure": "^7.10.4",
            "@babel/helper-module-imports": "^7.10.4",
            "@babel/types": "^7.10.5"
          "version": "7.10.4",
            "@babel/helper-get-function-arity": "^7.10.4",
            "@babel/template": "^7.10.4",
            "@babel/types": "^7.10.4"
          "version": "7.10.4",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/types": "^7.10.4"
          }
        },
        "@babel/helper-member-expression-to-functions": {
          "version": "7.10.5",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/types": "^7.10.5"
          }
        },
        "@babel/helper-module-imports": {
          "version": "7.10.4",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/types": "^7.10.4"
          }
        },
        "@babel/helper-module-transforms": {
          "version": "7.10.5",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/helper-module-imports": "^7.10.4",
            "@babel/helper-replace-supers": "^7.10.4",
            "@babel/helper-simple-access": "^7.10.4",
            "@babel/helper-split-export-declaration": "^7.10.4",
            "@babel/template": "^7.10.4",
            "@babel/types": "^7.10.5",
            "lodash": "^4.17.19"
          }
        },
        "@babel/helper-optimise-call-expression": {
          "version": "7.10.4",
            "@babel/types": "^7.10.4"
          "version": "7.10.4",
        "@babel/helper-replace-supers": {
          "version": "7.10.4",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/helper-member-expression-to-functions": "^7.10.4",
            "@babel/helper-optimise-call-expression": "^7.10.4",
            "@babel/traverse": "^7.10.4",
            "@babel/types": "^7.10.4"
          }
        },
        "@babel/helper-simple-access": {
          "version": "7.10.4",
          "bundled": true,
          "dev": true,
          "requires": {
            "@babel/template": "^7.10.4",
            "@babel/types": "^7.10.4"
          }
        },
          "version": "7.10.4",
            "@babel/types": "^7.10.4"
        "@babel/helper-validator-identifier": {
          "version": "7.10.4",
          "bundled": true,
          "dev": true
        },
          "version": "7.10.4",
            "@babel/template": "^7.10.4",
            "@babel/traverse": "^7.10.4",
            "@babel/types": "^7.10.4"
          "version": "7.10.4",
            "@babel/helper-validator-identifier": "^7.10.4",
          "version": "7.10.5",
          "version": "7.10.4",
            "@babel/helper-plugin-utils": "^7.10.4",
            "@babel/plugin-syntax-object-rest-spread": "^7.8.0",
            "@babel/plugin-transform-parameters": "^7.10.4"
          "version": "7.10.4",
            "@babel/helper-plugin-utils": "^7.10.4"
          "version": "7.10.4",
            "@babel/helper-plugin-utils": "^7.10.4"
        "@babel/plugin-transform-parameters": {
          "version": "7.10.5",
            "@babel/helper-get-function-arity": "^7.10.4",
            "@babel/helper-plugin-utils": "^7.10.4"
        "@babel/plugin-transform-react-jsx": {
          "version": "7.10.4",
            "@babel/helper-builder-react-jsx": "^7.10.4",
            "@babel/helper-builder-react-jsx-experimental": "^7.10.4",
            "@babel/helper-plugin-utils": "^7.10.4",
            "@babel/plugin-syntax-jsx": "^7.10.4"
          "version": "7.10.4",
            "@babel/code-frame": "^7.10.4",
            "@babel/parser": "^7.10.4",
            "@babel/types": "^7.10.4"
          "version": "7.10.5",
            "@babel/code-frame": "^7.10.4",
            "@babel/generator": "^7.10.5",
            "@babel/helper-function-name": "^7.10.4",
            "@babel/helper-split-export-declaration": "^7.10.4",
            "@babel/parser": "^7.10.5",
            "@babel/types": "^7.10.5",
            "lodash": "^4.17.19"
          "version": "7.10.5",
            "@babel/helper-validator-identifier": "^7.10.4",
            "lodash": "^4.17.19",
          "version": "16.9.43",
          "version": "1.9.2",
          "version": "2.6.11",
          "version": "2.1.3",
          "version": "4.17.19",
          "version": "3.1.3",
          "version": "1.17.0",
          "version": "3.0.3",
          "version": "1.10.0",
          "dev": true
          "version": "1.9.6",
            "@types/yoga-layout": "1.9.2"
      "version": "10.1.0",
      "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-10.1.0.tgz",
      "integrity": "sha512-FujQeciDaOiOvaIVGS1Rpb0v4R6XkOjvWCWowlz5oKuhPkEJ8U6pxgqt38xuzYhPt8dWEnfHn2jqpZdJEkW7pA==",
      "version": "8.10.2",
      "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz",
      "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==",
        "source-map-support": "^0.5.17",
      "version": "3.9.7",
      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
      "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
      "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
      "version": "1.10.0",
      "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz",
      "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==",
      "dev": true
  "description": "Json Pattern Validator - JSON schema validator library",
  "homepage": "https://github.com/manvel-khnkoyan/jpv#readme",
  "devDependencies": {
    "tap": "^14.10.8"
  }

// Corrupted Array Cases

const corruptedArray1 = {
    name: 'Corrupted Array 1',
    items: {
        sneakyStuff: 'Don\'t tell anyone, but I\'m not actually an array.',
        constructor: [].constructor
    }
};

const corruptedArray2 = {
    name: 'Corrupted Array 2',
    items: '[object Array]'
};

const corruptedArray3 = {
    name: 'Corrupted Array 3',
    items: {
        constructor: 'Array'
    }
};

const normalArray1 = {
    items: ['Normal One', 1, {}]
};

const corruptedCheckPattern = {
    items: []
};

// Valid Case
tap.test('Arrays Corrupted case', function (t) {
    t.ok(!validate(corruptedArray1, corruptedCheckPattern, { debug: true }), 'Corrupted Array 1');
    t.ok(!validate(corruptedArray2, corruptedCheckPattern, { debug: true }), 'Corrupted Array 2');
    t.ok(!validate(corruptedArray3, corruptedCheckPattern, { debug: true }), 'Corrupted Array 3');
    t.ok(validate(normalArray1, corruptedCheckPattern, { debug: true }), 'Corrupted Array Normmal Case');
    t.end();
});
const { validate } = require('../index.js');
    key3: 15
};
const { validate, typeOf, exact } = require('../index.js');
    }
    key4: '[datetime]'
    function: () => { },
    object: []
    object: '(object)'
    object: '(object)'
    object: typeOf('object')
    object: typeOf('function') // invalid
    value: or(is('lt(100)'), and(not('1000'), is('lte(999)'), is('gt(900)'))),
    value: or(is('lt(100)'), and(not('1000'), is('lt(999)'), is('gt(900)'))),
    value: or(is('lt(100)'), and(not(is('eq(999)')), is('lt(9999)'), is('gt(900)'))),
const j1 = { exist: null };
const s1 = { exist: '![exist]' };
const o1 = { exist: not(is('exist')) };
const j2 = { empty: 'yes' };
const s2 = { empty: '[empty]' };
const o2 = { empty: is('empty') };
const j3 = { empty: [1, 2] };
const s3 = { empty: '[empty]' };
const o3 = { empty: is('empty') };
const j4 = { empty: 'OK' };
const s4 = { empty: '[boolean]' };
const o4 = { empty: is('boolean') };
const j5 = { empty: 'OK' };
const s5 = { empty: '[float]' };
const o5 = { empty: is('float') };
const j6 = { empty: 'OK' };
const s6 = { empty: '[double]' };
const o6 = { empty: is('double') };
const j7 = { empty: '-5' };
const s7 = { empty: '[naturalNumber]' };
const o7 = { empty: is('naturalNumber') };
const j8 = { empty: '34a' };
const s8 = { empty: '[number]' };
const o8 = { empty: is('number') };
const j9 = { empty: 1.5 };
const s9 = { empty: '[integer]' };
const o9 = { empty: is('integer') };
const j10 = { empty: 'https://somedomain' };
const s10 = { empty: '[url]' };
const o10 = { empty: is('url') };
const j11 = { empty: 'root@dom.c' };
const s11 = { empty: '[email]' };
const o11 = { empty: is('email') };
const j12 = { empty: '2018' };
const s12 = { empty: '[date]' };
const o12 = { empty: is('date') };
const j13 = { empty: '2018-12-05:40' };
const s13 = { empty: '[datetime]' };
const o13 = { empty: is('datetime') };
const j14 = { empty: 'abc' };
const s14 = { empty: '[length(4)]' };
const o14 = { empty: is('length(4)') };
const j15 = { empty: 'abc' };
const s15 = { empty: '[min-length(4)]' };
const o15 = { empty: is('min-length(4)') };
const j16 = { empty: 'abc' };
const s16 = { empty: '[max-length(2)]' };
const o16 = { empty: is('max-length(2)') };
const j17 = { empty: null };
const s17 = { empty: '[eq(2)]' };
const o17 = { empty: is('eq(2)') };
const j18 = { empty: 'abc' };
const s18 = { empty: '[lt(2)]' };
const o18 = { empty: is('lt(2)') };
const j19 = { empty: 0 };
const s19 = { empty: '[gt(2)]' };
const o19 = { empty: is('gt(2)') };
const j20 = { empty: 15 };
const s20 = { empty: '[lte(10)]' };
const o20 = { empty: is('lte(10)') };
const j21 = { empty: '50' };
const s21 = { empty: '[gte(51)]' };
const o21 = { empty: is('gte(51)') };
const { is } = jpv;
    key2: NaN