{"_id":"@flourish/search","_rev":"69-5bc3de6da0b798b6c3df81c4dbe9765e","name":"@flourish/search","dist-tags":{"latest":"2.0.0"},"versions":{"0.0.1":{"name":"@flourish/search","version":"0.0.1","author":{"name":"Flourish team"},"license":"UNLICENSED","_id":"@flourish/search@0.0.1","maintainers":[{"name":"liakouras","email":"ilias@kiln.it"},{"name":"bobbysebolao","email":"bobbysebolao@gmail.com"},{"name":"luptilu","email":"luisabider@hotmail.com"},{"name":"larsvers","email":"lars@datamake.io"},{"name":"animateddata","email":"hello@animateddata.co.uk"},{"name":"mark-kiln","email":"mark@kiln.it"},{"name":"robinhouston","email":"robin@kiln.digital"},{"name":"duncanclark","email":"duncan@kiln.digital"},{"name":"daanlouter","email":"daan.louter@gmail.com"},{"name":"annaps","email":"anna@anna.ps"},{"name":"timbrock","email":"info@datatodisplay.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"}],"dist":{"shasum":"f988e891b5efae86f209cdae4dceb183d06a4eee","tarball":"https://registry.npmjs.org/@flourish/search/-/search-0.0.1.tgz","fileCount":11,"integrity":"sha512-5OIalT58NT+n4dnEykCzvbm8MGTStbVXJNKAKDCymK+plfBuGCJXbjE64cfvh6hF57VO9B0p487WvfWtgeE3OA==","signatures":[{"sig":"MEUCIE8IOASM/zQOdS5R87UrTRrphWyrbCTUuZMF+tM3iqIsAiEAp82ROrS8O4fW1+J5AJbB9QEPyMRtDO6n5mDx7xshJd0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0SQcCRA9TVsSAnZWagAA1Q8P/RLzwMd5pkvnUuLH7v67\nKTF44GZJUxKo353gYFqtn/0jy5BQ/4tDY3ZjzYIIxATm/gGO4YL4HhaBPqXm\niJUX6esasDAVkuaDpUKWHYkEayqVyRneBa91uttdQZeuyv01xTBlXDOw65DW\n5mMHKo4xTegHIrFTfhoEK0a1FdIvI+mo2oEkK24qGJ9gis2Qa2Hp4jLvvpWm\nYTdsYrhZ3ClYY+WherKW36BhEJJWJUMhp9lE/i1QRW2a2mbqjiyeBCy3u6e5\nvmzs8cP9+/b3uVVEVKk3J35PyhvePvHr1AUJY81Kb6L0bJ/PQuGvHT0zJd/a\nAO33g0TixyxIDCpSnyefmeCd2UXmTMFRHtMVBM227fcy+kzMxMRqufD87cSO\nc0hZl/Sxu4mUWnhNmDGbBeA/nArRrFty4S8lbLK0N0glkjEP3WYxbzQlXZrD\nyAkn+2CT2ml4mnDsEVECkTAVbriplr/rwcZBMc2uyIJQ3zN23dJ9bMKFhbM8\n/T/S1BA/SqyQeslPtfELfkfj4PZbtLJrHZ4cntFwnF9arpaekUqZqhjWB+NA\nMCxkd54eJ3gqNxG9qu4PpYRE1S6jBEvmlejipMD4sttx1dDp+ycFyIFKvKX3\nVwF70/R+b3Yu+EhuOntggF4CRVJFNxToe3t9sPPkgHAuB4g4RlQvM76ujofx\nPkYX\r\n=CQUo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"search.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"src/index.js","gitHead":"efdcf2a652a52080adb93d4cb0faea953955dee5","scripts":{"lint":"eslint src","test":"mocha","build":"rollup -c","minify":"terser -m -o search.min.js search.js","prepare":"npm run build && npm run minify","pretest":"npm run build","precommit":"lint-staged"},"_npmUser":{"name":"timbrock","email":"info@datatodisplay.com"},"_npmVersion":"6.9.0","description":"Search for matching strings in arrays of data","directories":{},"lint-staged":{"*.js":"npm run lint --"},"_nodeVersion":"10.16.3","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","husky":"^4.2.5","mocha":"^7.2.0","eslint":"^7.1.0","rollup":"^2.10.9","terser":"^4.7.0","lint-staged":"^8.1.5","rollup-plugin-node-resolve":"^5.2.0","@flourish/eslint-plugin-flourish":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/search_0.0.1_1590764571628_0.7689860657654783","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@flourish/search","version":"1.0.0","author":{"name":"Flourish team"},"license":"UNLICENSED","_id":"@flourish/search@1.0.0","maintainers":[{"name":"animateddata","email":"hello@animateddata.co.uk"},{"name":"annaps","email":"anna@anna.ps"},{"name":"bobbysebolao","email":"bobbysebolao@gmail.com"},{"name":"daanlouter","email":"daan.louter@gmail.com"},{"name":"duncanclark","email":"duncan@kiln.digital"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"larsvers","email":"lars@datamake.io"},{"name":"liakouras","email":"ilias@kiln.it"},{"name":"luptilu","email":"luisabider@hotmail.com"},{"name":"mark-kiln","email":"mark@kiln.it"},{"name":"robinhouston","email":"robin@kiln.digital"},{"name":"timbrock","email":"info@datatodisplay.com"}],"dist":{"shasum":"f13c40bde185b915d72d2a2dd999f0512aa49187","tarball":"https://registry.npmjs.org/@flourish/search/-/search-1.0.0.tgz","fileCount":11,"integrity":"sha512-1MUDZG9i5WumFNMcIFB9LGQkZMvQ6GwZA5r+d2ftV0sJZ3TwiO0KJ4MiDQMftELayJ31ls3QGwwM71J8w/4itQ==","signatures":[{"sig":"MEUCIFvflcMU1JxD7u9Q7PR5VSj0bTe0Im7WRGZX9EcejrL2AiEAvKWbdGpGf/kcbuVb+VmR7yC8vEulhx+qyyF46q1h+BM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3lUuCRA9TVsSAnZWagAA3XMP/jmu+iSdZbHOr8GDpMPI\n3RkSf5S3IpmNJj7Dg0ykJIeHtnHjJu8lGxo8+TDBCch/TPcUXYY7rNOaLQyW\nqpDfOh5aUUzMWrryZk8c/cBnXDv+VSaZX2jVnYtwmhlf0A+XOsc5R1BjPzdv\nV0IW39fhrYuUrdbNEqQMvBoCsNQiUarrfN56JEE7FdFuIPl/opvKOoV2REeq\nMJJmWBVyisKLgEbfIX/wd46CqOs1W/cEEbW+pxtodYNMbYgUUEWITCWQq6co\n6cS68w2jQMU9A6wMueflLg+q/m037Cb+1AMW1vyqZp5iFA4OndWo6X1iDIYW\nkH0U/ZQXSdVQigsoqgBIOimKInCxmjljZo3bFlJk4KJbJ2gOAQs8TmEbk4YS\nfGx/Qye3ZPX12yX2dQWpHmSSQbFnXs/YfTL7fOANNoj1k83B7e78QZygE5yI\nijjuxeyCR45xYVbBBSCxRA4fl1cRL6lpN47uzQAlu5VYEz8cMT3AtibqWfBp\nhqQRtlbFyntHPlG/gRLgSvTwfl3OIiB5Vx3Fb/wE4sqJf7bxEcGyKeX7K3ZA\ncVqp0kN3KBCeJw7oMgbBmfdRcpxhSfoUxn1jWhIZaezCuEAMhlZDlT84KGVW\nhofwyU4nrHJIyBTlczuTx09X/NFKVYKVxkVS3xiw2KQoe9KuzdZhZbTlDuLw\nF/FA\r\n=ujJe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"search.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"src/index.js","gitHead":"f9edc6464ab01e6df393816e0a03f94e7d1b1ed3","scripts":{"lint":"eslint src","test":"mocha","build":"rollup -c","minify":"terser -m -o search.min.js search.js","prepare":"npm run build && npm run minify","pretest":"npm run build","precommit":"lint-staged"},"_npmUser":{"name":"timbrock","email":"info@datatodisplay.com"},"_npmVersion":"6.9.0","description":"Search for matching strings in arrays of data","directories":{},"lint-staged":{"*.js":"npm run lint --"},"_nodeVersion":"10.16.3","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","husky":"^4.2.5","mocha":"^7.2.0","eslint":"^7.1.0","rollup":"^2.10.9","terser":"^4.7.0","lint-staged":"^8.1.5","rollup-plugin-node-resolve":"^5.2.0","@flourish/eslint-plugin-flourish":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/search_1.0.0_1591629101883_0.8381095166666073","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@flourish/search","version":"1.0.1","author":{"name":"Flourish team"},"license":"LicenseRef-LICENSE","_id":"@flourish/search@1.0.1","maintainers":[{"name":"jontyt","email":"jonty@canva.com"},{"name":"jwitcombe","email":"josephw@canva.com"},{"name":"katietannercanva","email":"katietanner@canva.com"},{"name":"b3n-canva","email":"ben.lloyd@canva.com"},{"name":"caletilford","email":"cale.tilford@gmail.com"},{"name":"flourish-canva","email":"canva-npm@kiln.digital"},{"name":"declanvong","email":"declan@canva.com"},{"name":"florin.oprina","email":"florin@kiln.digital"},{"name":"robinhouston","email":"robin@kiln.digital"},{"name":"duncanclark","email":"duncan@kiln.digital"},{"name":"daanlouter","email":"daan.louter@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mark-kiln","email":"mark@kiln.it"},{"name":"animateddata","email":"hello@animateddata.co.uk"},{"name":"larsvers","email":"lars@datamake.io"},{"name":"luptilu","email":"luisabider@hotmail.com"},{"name":"bobbysebolao","email":"bobbysebolao@gmail.com"},{"name":"liakouras","email":"ilias@kiln.it"},{"name":"oliviajanelawlor","email":"oliviajanelawlor@gmail.com"},{"name":"hrobertson","email":"h.robertson@icloud.com"},{"name":"oampo","email":"joe@oampo.co.uk"},{"name":"wearymonkey","email":"toby.rahilly@gmail.com"},{"name":"mattcarter-canva","email":"matt.c@canva.com"},{"name":"marcfallows","email":"mail@marcfallows.com"},{"name":"mafecafe","email":"mariafcallejon@gmail.com"},{"name":"connormj","email":"connor@kiln.digital"},{"name":"simonaats","email":"simona@kiln.digital"}],"dist":{"shasum":"bf320d7ec11dfc29f0630d6c059d209e26ef3b69","tarball":"https://registry.npmjs.org/@flourish/search/-/search-1.0.1.tgz","fileCount":12,"integrity":"sha512-tpkQKbXvZP77M0QrIVVMAZNz222uTG3qsNfJuCyCBXlkftC3KFCJcArPoDUBnVoVTsTOrmXi3ow2wYKbfd2tzw==","signatures":[{"sig":"MEUCIQDWljVknxIBY3fOHWa7kS6W/UmacqMhuQF91Kb+366tngIgXCVaIFOyZCNDSsNvybPQiivgs48XYwsnTk6fWatNI/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22460},"main":"search.js","_from":"file:flourish-search-1.0.1.tgz","module":"src/index.js","private":false,"scripts":{"lint":"eslint src","build":"rollup -c","minify":"terser -m -o search.min.js search.js","pretest":"npm run build","localtest":"mocha"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"_resolved":"/private/var/folders/w2/_5t_b7v91bz2nqh278qx4l7m0000gn/T/eb8d8cc2d7a148ab6764d03e8991e361/flourish-search-1.0.1.tgz","_integrity":"sha512-tpkQKbXvZP77M0QrIVVMAZNz222uTG3qsNfJuCyCBXlkftC3KFCJcArPoDUBnVoVTsTOrmXi3ow2wYKbfd2tzw==","_npmVersion":"9.6.0","description":"Search for matching strings in arrays of data","directories":{},"_nodeVersion":"16.19.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","mocha":"^7.2.0","eslint":"^8.35.0","rollup":"^2.10.9","terser":"^4.7.0","rollup-plugin-node-resolve":"^5.2.0","@flourish/eslint-plugin-flourish":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/search_1.0.1_1684223986177_0.1840703773112502","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@flourish/search","version":"2.0.0","author":{"name":"Flourish team"},"license":"LicenseRef-LICENSE","_id":"@flourish/search@2.0.0","maintainers":[{"name":"scottb-flourish","email":"scottb@canva.com"},{"name":"jontyt","email":"jonty@canva.com"},{"name":"rushlet","email":"becky.rush14@yahoo.co.uk"},{"name":"winna_canva","email":"winna@canva.com"},{"name":"bruno-riddy","email":"brunoriddy@canva.com"},{"name":"libruca","email":"liamb@canva.com"},{"name":"jwitcombe","email":"josephw@canva.com"},{"name":"katietannercanva","email":"katietanner@canva.com"},{"name":"b3n-canva","email":"ben.lloyd@canva.com"},{"name":"caletilford","email":"cale.tilford@gmail.com"},{"name":"florin.oprina","email":"florin@kiln.digital"},{"name":"robinhouston","email":"robin@kiln.digital"},{"name":"duncanclark","email":"duncan@kiln.digital"},{"name":"daanlouter","email":"daan.louter@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mark-kiln","email":"mark@kiln.it"},{"name":"animateddata","email":"hello@animateddata.co.uk"},{"name":"larsvers","email":"lars@datamake.io"},{"name":"luptilu","email":"luisabider@hotmail.com"},{"name":"bobbysebolao","email":"bobbysebolao@gmail.com"},{"name":"hrobertson","email":"h.robertson@icloud.com"},{"name":"oampo","email":"joe@oampo.co.uk"}],"dist":{"shasum":"5fe2372e773836985cac66f15855d5a30ba62341","tarball":"https://registry.npmjs.org/@flourish/search/-/search-2.0.0.tgz","fileCount":11,"integrity":"sha512-HTaRBlB0DdqavI9w4QbrAULY8ni+jt9vJcNS6rSy5hAW11D0SXUbQqH2cGdQOA9tUIxcnuaOSy6alY53Kh+7wA==","signatures":[{"sig":"MEQCIDC/EUaPtAJrlIxJj8ZiAHdelCsDE/QGTiNbYyre9cc+AiAQjDCgYoZaYlqzJhHk6I1gxyRSskdZ8JqCkHDRh0RfNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24752},"main":"search.js","_from":"file:flourish-search-2.0.0.tgz","module":"src/index.js","exports":"./src/index.js","private":false,"scripts":{"lint":"eslint .","build":"rollup -c","minify":"terser -m -o search.min.js search.js","pretest":"npm run build","localtest":"mocha"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"_resolved":"/private/var/folders/w2/_5t_b7v91bz2nqh278qx4l7m0000gn/T/cc854fa8ca3822ddcf2022742cf96b7b/flourish-search-2.0.0.tgz","_integrity":"sha512-HTaRBlB0DdqavI9w4QbrAULY8ni+jt9vJcNS6rSy5hAW11D0SXUbQqH2cGdQOA9tUIxcnuaOSy6alY53Kh+7wA==","_npmVersion":"10.2.4","description":"Search for matching strings in arrays of data","directories":{},"_nodeVersion":"18.19.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","mocha":"^10.2.0","eslint":"^8.35.0","rollup":"^4.6.1","terser":"^5.19.2","@babel/core":"^7.23.6","@babel/preset-env":"^7.23.6","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-node-resolve":"^15.2.3","@flourish/eslint-plugin-flourish":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/search_2.0.0_1722437113355_0.1845063052706999","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-05-29T15:02:51.627Z","modified":"2026-08-19T18:13:31.007Z","0.0.1":"2020-05-29T15:02:51.728Z","1.0.0":"2020-06-08T15:11:41.972Z","1.0.1":"2023-05-16T07:59:46.342Z","2.0.0":"2024-07-31T14:45:13.572Z"},"author":{"name":"Flourish team"},"license":"LicenseRef-LICENSE","description":"Search for matching strings in arrays of data","maintainers":[{"email":"duncan@kiln.digital","name":"duncanclark"},{"email":"daan.louter@gmail.com","name":"daanlouter"},{"email":"hello@animateddata.co.uk","name":"animateddata"},{"email":"lars@datamake.io","name":"larsvers"},{"email":"luisabider@hotmail.com","name":"luptilu"},{"email":"h.robertson@icloud.com","name":"hrobertson"},{"email":"florin@kiln.digital","name":"florin.oprina"},{"email":"ben.lloyd@canva.com","name":"b3n-canva"},{"email":"brunoriddy@canva.com","name":"bruno-riddy"},{"email":"katietanner@canva.com","name":"katietannercanva"},{"email":"josephw@canva.com","name":"jwitcombe"},{"email":"becky.rush14@yahoo.co.uk","name":"rushlet"},{"email":"winna@canva.com","name":"winna_canva"},{"email":"jonty@canva.com","name":"jontyt"},{"email":"scottb@canva.com","name":"scottb-flourish"},{"email":"gwyneth@canva.com","name":"gwyneth.bassett"},{"email":"snavad@canva.com","name":"sega-canva"},{"email":"ci@kiln.it","name":"kiln-ci"},{"email":"niamhb@canva.com","name":"niamhb"},{"email":"guy.n@canva.com","name":"guyneedhamcanva"}],"readme":"# Flourish search\n\nSearch for matching strings in arrays of data.\n\n## How to install\n\n`npm install -s @flourish/search`\n\nThen import it with:\n\n```js\nimport createSearch from \"@flourish/search\";\n```\n\n## Usage\n\nCreate a new search function by calling `createSearch` with an array of items and an optional accessor function:\n```js\nlet search = createSearch(array, accessorFunction);\n```\n\nThe `accessorFunction` instructs the `createFunction` on how to create a one-to-one mapping from each element of `array` to a string or array of strings that can be searched over. The default value of `accessorFunction` is `x => x`. (If the value returned when calling the `accessorFunction` is an array it will be `slice`d).\n\n\n## `search(value)`\n\nFilter `array` based on whether it's accessor-mapped values match the search string. For the default accessor this just means return all values of `array` that match (see below) `value`.\n\n## Types of matching\n\nMatching is, by default, case-insensitive but this can be changed throught the `normalizer` method. The match can be searched for \"anywhere\" (the default) in the mapped string, at the \"start\" of that string or it can be a \"whole\"-string match.\n\n### `search.normalizer([value])`\n\nIf value is `undefined` then this function returns the current `normalizer` function (by default `x => x`). Otherwise, the `normalizer` function is set to `value`. The normalizer function determines how mapped items and search terms should be manipulated _before_ being compared. For example, you can do case-insensitive searching by passing in the function `x => x.toLowercase`.\n\nWhen `value` is defined the `search` function is `return`ed to allow for method chaining.\n\n### `search.mode([value])`\nIf `value` is `undefined` then this function returns a string describing the search mode being used. The three options are:\n- \"anywhere\": search for the specified string anywhere in the mapped string;\n- \"start\": search for the specified string at the start of the mapped string;\n- \"whole\": search for the exact specified string (after case (in)sensitivity has been accounted for).\n\nThe default mode is \"anywhere\".\n\nIf `value` is defined and is one of these three specified strings then the mode is set to that value. If `value` is any other value (excluding `undefined`) then an error is thrown.\n\nWhen `value` is defined the `search` function is `return`ed to allow for method chaining.\n\n### `search.arrayMode([value])`\nIf `value` is `undefined` then this function returns a string describing the array mode being used. The two options are:\n- \"some\": only one string in an array of mapped strings needs to match the search string for a match;\n- \"every\": every string in an array of mapped strings needs to match the search string for a match;\n\nThe default mode is \"some\".\n\nIf `value` is defined and is one of the two specified strings then the mode is set to that value. If `value` is any other value (excluding `undefined`) then an error is thrown.\n\nWhen `value` is defined the `search` function is `return`ed to allow for method chaining.\n","readmeFilename":"README.md"}