{"id":18296238,"url":"https://github.com/ruanyl/array-fuzzy-match","last_synced_at":"2025-04-09T08:42:48.910Z","repository":{"id":57183963,"uuid":"82821544","full_name":"ruanyl/array-fuzzy-match","owner":"ruanyl","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-02T11:31:30.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T08:15:47.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ruanyl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T15:39:05.000Z","updated_at":"2019-03-02T11:31:31.000Z","dependencies_parsed_at":"2022-08-23T01:20:44.271Z","dependency_job_id":null,"html_url":"https://github.com/ruanyl/array-fuzzy-match","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Farray-fuzzy-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Farray-fuzzy-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Farray-fuzzy-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Farray-fuzzy-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanyl","download_url":"https://codeload.github.com/ruanyl/array-fuzzy-match/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008550,"owners_count":21032553,"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":[],"created_at":"2024-11-05T14:39:58.234Z","updated_at":"2025-04-09T08:42:48.894Z","avatar_url":"https://github.com/ruanyl.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# array fuzzy match\n\n```\nnpm i array-fuzzy-match\n```\n\n```\nimport isMatch from 'array-fuzzy-match'\n\ntest('should return true if matches words', t =\u003e {\n  const arr = ['zhong', 'guo', 'zhong', 'che']\n  t.true(isMatch(arr, 'zhong'))\n  t.true(isMatch(arr, 'guo'))\n  t.true(isMatch(arr, 'zhongg'))\n  t.true(isMatch(arr, 'guozhong'))\n})\n\ntest('should return true if matches words case-insensitive', t =\u003e {\n  const arr = ['zhong', 'guo', 'zhong', 'che']\n  t.true(isMatch(arr, 'Zhong'))\n  t.true(isMatch(arr, 'GUO'))\n  t.true(isMatch(arr, 'ZHONGG'))\n  t.true(isMatch(arr, 'guoZhong'))\n})\n\ntest('should matches first letter of each word from beginning', t =\u003e {\n  const arr = ['zhong', 'guo', 'zhong', 'che']\n  t.true(isMatch(arr, 'ZG'))\n  t.true(isMatch(arr, 'ZGZC'))\n  t.false(isMatch(arr, 'GZ'))\n})\n\ntest('should match from the beginning', t =\u003e {\n  const arr = ['zhong', 'guo', 'zhong', 'che']\n  const config = { wordFromStart: true }\n  t.true(isMatch(arr, 'zhong', config))\n  t.false(isMatch(arr, 'guo', config))\n  t.true(isMatch(arr, 'zhongg', config))\n  t.false(isMatch(arr, 'guozhong', config))\n})\n\ntest('should matches first letter of each word', t =\u003e {\n  const arr = ['zhong', 'guo', 'zhong', 'che']\n  const config = { letterFromStart: false }\n  t.true(isMatch(arr, 'ZG', config))\n  t.true(isMatch(arr, 'ZGZC', config))\n  t.true(isMatch(arr, 'GZ', config))\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanyl%2Farray-fuzzy-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanyl%2Farray-fuzzy-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanyl%2Farray-fuzzy-match/lists"}