{"id":16531361,"url":"https://github.com/marcbachmann/boolean-expression","last_synced_at":"2025-04-04T20:42:43.096Z","repository":{"id":66338172,"uuid":"74451531","full_name":"marcbachmann/boolean-expression","owner":"marcbachmann","description":"⋀⋁ Create a boolean expression that's safe (you can still harm your app if you don't validate) to eval.","archived":false,"fork":false,"pushed_at":"2023-12-15T17:58:30.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T10:50:33.589Z","etag":null,"topics":["boolean-expression","code-generation","parser"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcbachmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-11-22T08:36:31.000Z","updated_at":"2016-11-22T09:19:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf2aaea3-e47a-4a83-afa9-94aed2a304a2","html_url":"https://github.com/marcbachmann/boolean-expression","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"7c9e70cd85e648c912c3e26c746eece4a4572f73"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcbachmann%2Fboolean-expression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcbachmann%2Fboolean-expression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcbachmann%2Fboolean-expression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcbachmann%2Fboolean-expression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcbachmann","download_url":"https://codeload.github.com/marcbachmann/boolean-expression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249603,"owners_count":20908211,"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","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":["boolean-expression","code-generation","parser"],"created_at":"2024-10-11T18:08:36.944Z","updated_at":"2025-04-04T20:42:43.076Z","avatar_url":"https://github.com/marcbachmann.png","language":"JavaScript","readme":"# boolean-expression\n\nCreate a boolean expression that's safe to eval\n\n## expression = booleanExpression(exp)\n\nReturns a `BooleanExpression` instance with `toString` and `toTokens` methods.\n\n### expression.toString(map)\n\n```\nvar expression = booleanExpression('foo AND bar')\nvar str = expression.toString(function (token) {\n    return 'val.indexOf(' + JSON.stringify(token) + ')'\n})\n\n// str == 'val.indexOf(\"foo\") \u0026\u0026 val.indexOf(\"bar\")'\n\n```\n\n\n### expression.toTokens()\n\n```\nvar expression = booleanExpression('foo \u0026\u0026 bar \u0026\u0026 !qux')\nexpression.toTokens()\n// returns ['foo', 'bar', 'qux']\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcbachmann%2Fboolean-expression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcbachmann%2Fboolean-expression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcbachmann%2Fboolean-expression/lists"}