{"id":16629182,"url":"https://github.com/bradgarropy/adobe-rules","last_synced_at":"2026-04-04T20:32:42.245Z","repository":{"id":93265380,"uuid":"400847069","full_name":"bradgarropy/adobe-rules","owner":"bradgarropy","description":"🧠 adobe interview question - rule evaluator","archived":false,"fork":false,"pushed_at":"2021-09-17T17:47:01.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T17:42:16.805Z","etag":null,"topics":["adobe","eslint","interview","jest","logic","node","prettier","rules","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/bradgarropy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license","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},"funding":{"github":"bradgarropy"}},"created_at":"2021-08-28T17:05:52.000Z","updated_at":"2023-02-11T12:21:54.000Z","dependencies_parsed_at":"2023-05-01T03:02:16.421Z","dependency_job_id":null,"html_url":"https://github.com/bradgarropy/adobe-rules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"bradgarropy/node-library-starter","purl":"pkg:github/bradgarropy/adobe-rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgarropy%2Fadobe-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgarropy%2Fadobe-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgarropy%2Fadobe-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgarropy%2Fadobe-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradgarropy","download_url":"https://codeload.github.com/bradgarropy/adobe-rules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradgarropy%2Fadobe-rules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31413269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["adobe","eslint","interview","jest","logic","node","prettier","rules","typescript"],"created_at":"2024-10-12T04:40:07.161Z","updated_at":"2026-04-04T20:32:42.236Z","avatar_url":"https://github.com/bradgarropy.png","language":"TypeScript","funding_links":["https://github.com/sponsors/bradgarropy"],"categories":[],"sub_categories":[],"readme":"# 🧠 adobe rule evaluator\n\n_During an interview with [Adobe][adobe], I was asked to express logical statements as objects, and create a function that evaluated them against a set of data. Modeling the objects was tough, but after that everything else fell into place!_\n\n[![github actions][github-actions-badge]][github-actions]\n[![coverage][codecov-badge]][codecov]\n[![contributing][contributing-badge]][contributing]\n[![contributors][contributors-badge]][contributors]\n[![discord][discord-badge]][discord]\n\n## ❓ question\n\nYou've most likely written logical statements in code before, like the one shown below.\n\n```javascript\nmonth === \"August\" \u0026\u0026 (day \u003e 15 || [1, 5, 9].include(hour))\n```\n\nNow imagine you are implementing a rule builder that allows the user to create logical statements. Model the logical statements as objects, and then create a function that evaluates them against a set of data.\n\n## 🤔 assumptions\n\nI made a few basic assumptions to bound the complexity of the problem.\n\nFirst, I decided to limit my support to the following logical operators.\n\n-   `and`\n-   `or`\n\nAdditionally, I decided to support only the following comparison operators.\n\n-   `eq`\n-   `neq`\n-   `gt`\n-   `lt`\n-   `gte`\n-   `lte`\n-   `inc`\n-   `ninc`\n\nAnd finally, I limited the input data types to `string`, `number`, and `boolean`.\n\n## 💀 execution\n\n```bash\ngit clone https://github.com/bradgarropy/adobe-rules.git\ncd adobe-rules\nnpm install\nnpm run test\n```\n\n## ✨ contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://bradgarropy.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/11336745?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBrad Garropy\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/bradgarropy/adobe-rules/commits?author=bradgarropy\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/bradgarropy/adobe-rules/commits?author=bradgarropy\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/bradgarropy/adobe-rules/commits?author=bradgarropy\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#infra-bradgarropy\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n[codecov]: https://app.codecov.io/gh/bradgarropy/adobe-rules\n[contributing]: https://github.com/bradgarropy/adobe-rules/blob/master/contributing.md\n[contributors]: #-contributors\n[codecov-badge]: https://img.shields.io/codecov/c/github/bradgarropy/adobe-rules?style=flat-square\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[contributors-badge]: https://img.shields.io/github/all-contributors/bradgarropy/adobe-rules?style=flat-square\n[issues]: https://github.com/bradgarropy/adobe-rules/issues\n[twitter]: https://twitter.com/bradgarropy\n[ama]: https://bradgarropy.com/ama\n[github-actions]: https://github.com/bradgarropy/adobe-rules/actions\n[github-actions-badge]: https://img.shields.io/github/workflow/status/bradgarropy/adobe-rules/%F0%9F%9A%80%20release?style=flat-square\n[discord]: https://bradgarropy.com/discord\n[discord-badge]: https://img.shields.io/discord/748196643140010015?style=flat-square\n[adobe]: https://www.adobe.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradgarropy%2Fadobe-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradgarropy%2Fadobe-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradgarropy%2Fadobe-rules/lists"}