{"id":31129140,"url":"https://github.com/devisjs/devispattern","last_synced_at":"2025-09-18T01:55:27.925Z","repository":{"id":47270989,"uuid":"67290905","full_name":"Devisjs/devisPattern","owner":"Devisjs","description":"A fast native pattern matcher addon on JavaScript object properties","archived":false,"fork":false,"pushed_at":"2025-07-21T09:03:17.000Z","size":336,"stargazers_count":11,"open_issues_count":22,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T04:36:11.929Z","etag":null,"topics":["addon","javascript","register"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Devisjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-03T13:14:42.000Z","updated_at":"2019-06-20T11:01:09.000Z","dependencies_parsed_at":"2023-12-24T20:19:47.348Z","dependency_job_id":"0c2bee1b-b2f2-42cf-8138-81d95ad359fe","html_url":"https://github.com/Devisjs/devisPattern","commit_stats":{"total_commits":74,"total_committers":2,"mean_commits":37.0,"dds":"0.013513513513513487","last_synced_commit":"872b6185354b3ffaecb7fca391f8015e5f50e769"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Devisjs/devisPattern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devisjs%2FdevisPattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devisjs%2FdevisPattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devisjs%2FdevisPattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devisjs%2FdevisPattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Devisjs","download_url":"https://codeload.github.com/Devisjs/devisPattern/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devisjs%2FdevisPattern/sbom","scorecard":{"id":40034,"data":{"date":"2025-08-11","repo":{"name":"github.com/Devisjs/devisPattern","commit":"872b6185354b3ffaecb7fca391f8015e5f50e769"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"37 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-57cf-349j-352g","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T21:16:47.562Z","repository_id":47270989,"created_at":"2025-08-14T21:16:47.563Z","updated_at":"2025-08-14T21:16:47.563Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275696225,"owners_count":25511352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","javascript","register"],"created_at":"2025-09-18T01:55:26.030Z","updated_at":"2025-09-18T01:55:27.908Z","avatar_url":"https://github.com/Devisjs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevisPattern\n \u003cimg  src=\"https://avatars3.githubusercontent.com/u/21971184?v=4\u0026amp;s=200\" href=\"http://devisjs.surge.sh\" width=\"250\" /\u003e\n\n\u003eA fast native pattern matcher addon on JavaScript object properties.\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/devisPattern\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/devisPattern.svg\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/devisPattern\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/devisPattern.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.bithound.io/github/Devisjs/devisPattern\"\u003e\u003cimg src=\"https://www.bithound.io/github/Devisjs/devisPattern/badges/score.svg\" alt=\"bitHound Overall Score\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.bithound.io/github/Devisjs/devisPattern\"\u003e\u003cimg src=\"https://www.bithound.io/github/Devisjs/devisPattern/badges/code.svg\" alt=\"bitHound Overall Score\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/Devisjs/devisPattern\"\u003e\u003cimg src=\"https://travis-ci.org/Devisjs/devisPattern.svg?branch=master\" alt=\"travis\"\u003e\u003c/a\u003e\n  \n  \u003cbr\u003e\n\n\u003c/p\u003e\n\n\nThis addon is used by the devis framework to pattern match actions.\n\n**Requirements:**\n\nIt's necessary, before using DevisPattern to install:\n- [CMake](http://www.cmake.org/download/)(*.msi version for windows: You must check the addition of the path for all users, And restart your computer after installation)\n- A proper C/C++ compiler toolchain of the given platform\n    - **Windows**:\n        - [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)\n        or a recent version of Visual C++ will do ([the free Community](https://www.visualstudio.com/products/visual-studio-community-vs) version works well)             \n    - **Unix/linux-gnu**:\n        - Clang or GCC\n        - Ninja or Make (Ninja will be picked if both present)\n        - Xcode with command line tools if you are under **mac os**\n\n\n\n## Install\n\n```sh\nnpm install devisPattern\n```\nOr, if you download the project:\n\nGenerate the appropriate project build files for the current platform. Use `configure` for that:\n```sh\nnode-gyp configure\n```\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file (on Windows) in the `build/` directory. Next invoke the build command:\n```sh\nnode-gyp build\n```\n\n### Quick example\nHere's how you register some patterns, and then search for matches:\n\n```JavaScript\nconst devisPattern =require(\"devisPattern\"); //or require(\"./devisPattern/devisPattern\"); if you download the project \n\ndevisPattern.add({\n    action: 'game',\n    cmd: 'play'\n}, (args, done) =\u003e {\n\n    done({\n        result: 'play'\n    });\n});\ndevisPattern.add({\n    action: 'game',\n    cmd: 'pause'\n}, (args, done)=\u003e {\n\n    done({\n        result: 'pause'\n    });\n});\n\ndevisPattern.call({\n    action: 'game',\n    cmd: 'play'\n}, (result)=\u003e {\n\n    console.log(result);\n\n});\n\ndevisPattern.call({\n    action: 'game',\n    cmd: 'pause'\n}, (result) =\u003e{\n\n\n    console.log(result);\n});\n\n```\n\n\n# The Why\n\nThis addon lets you build a simple decision tree so you can avoid writing if statements. It tries to make the minimum number of comparisons necessary to pick out the most specific match.\n\n# API\n\n### devisPattern\n\nGenerates a new pattern matcher instance. \n\n\n### .add( {...pattern...}, object )\n\nRegister a pattern, and the object that will be returned if an input\nmatches.  Both keys and values are considered to be strings. Other\ntypes are converted to strings.\n\n### .find( {...pattern...})\n\nReturn the unique match for this pattern, or null if not found. \n\n### .call({...pattern...},{...arguments...},callback)\n\nAct this pattern.\n\n### .list( )\n\nReturn the list of registered patterns that contain this partial\npattern.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevisjs%2Fdevispattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevisjs%2Fdevispattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevisjs%2Fdevispattern/lists"}