{"id":15837030,"url":"https://github.com/afeiship/next-abstract-search-query","last_synced_at":"2026-04-15T18:01:47.034Z","repository":{"id":57122644,"uuid":"219493678","full_name":"afeiship/next-abstract-search-query","owner":"afeiship","description":"Abstract search query for next.","archived":false,"fork":false,"pushed_at":"2021-09-09T13:05:44.000Z","size":679,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T14:22:08.034Z","etag":null,"topics":["decode","encode","filter","next","query","search"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/afeiship.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}},"created_at":"2019-11-04T12:13:26.000Z","updated_at":"2021-09-09T13:05:47.000Z","dependencies_parsed_at":"2022-08-24T14:59:30.921Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-abstract-search-query","commit_stats":null,"previous_names":["afeiship/react-range"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/next-abstract-search-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-abstract-search-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-abstract-search-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-abstract-search-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-abstract-search-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-abstract-search-query/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-abstract-search-query/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268475669,"owners_count":24256153,"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-08-02T02:00:12.353Z","response_time":74,"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":["decode","encode","filter","next","query","search"],"created_at":"2024-10-05T15:20:32.382Z","updated_at":"2026-04-15T18:01:41.985Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-abstract-search-query\n\u003e Abstract search query for next.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-abstract-search-query\n```\n\n## apis\n| api  | params      | description               |\n| ---- | ----------- | ------------------------- |\n| get  | -           | Get qs like string.       |\n| set  | (key,value) | Set key/value.            |\n| sets | (obj)       | Set key/value use object. |\n\n## usage\n```js\nimport NxAbstractSearchQuery from '@jswork/next-abstract-search-query';\n\nconst initialState = {\n  pageNo: 1,\n  pageSize: 10,\n  keyword: '',\n  types: [],\n  labels: []\n};\n\nconst nxsq = new NxAbstractSearchQuery(initialState, {\n  set: function(data,key,value){\n    nx.set(data, key, value);\n    if (!key.includes('page')) {\n      data.pageNo = 1;\n    }\n  },\n  onChange: function(inEvent){\n    console.log(inEvent.target.value);\n  }\n});\n\n// set/get\n\nnxsq.set('pageNo', 2);\nnxsq.get()\n// 'pageNo=2\u0026pageSize=10'\n\nnxsq.set('labels', ['lb1', 'lb2']);\nnxsq.get();\n// 'pageNo=1\u0026pageSize=10\u0026labels=lb1,lb2'\n\n// sets\nnxsq.sets({ pageNo:2, pageSize:20 });\n\n// get inner data\nconsole.log(nxsq.data);\n\n{\n  pageNo: 2,\n  pageSize: 10,\n  keyword: '',\n  types: [],\n  labels: ['lb1', 'lb2']\n}\n```\n\n## defaults\n```js\nconst defaults = {\n  url: null,\n  onChange: nx.noop,\n  onInit: nx.noop,\n  set: function (data, key, value) {\n    nx.set(data, key, value);\n  },\n  isEmpty: function (value) {\n    return !value || value.length === 0;\n  },\n  transform: function (key, value) {\n    var _value = Array.isArray(value) ? value.join() : value;\n    return key + '=' + _value;\n  }\n};\n```\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-abstract-search-query/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-abstract-search-query\n[version-url]: https://npmjs.org/package/@jswork/next-abstract-search-query\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-abstract-search-query\n[license-url]: https://github.com/afeiship/next-abstract-search-query/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-abstract-search-query\n[size-url]: https://github.com/afeiship/next-abstract-search-query/blob/master/dist/next-abstract-search-query.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-abstract-search-query\n[download-url]: https://www.npmjs.com/package/@jswork/next-abstract-search-query\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-abstract-search-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-abstract-search-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-abstract-search-query/lists"}