{"id":20691356,"url":"https://github.com/metafizzy/fizzy-ui-utils","last_synced_at":"2025-04-07T06:11:27.081Z","repository":{"id":26256043,"uuid":"29703219","full_name":"metafizzy/fizzy-ui-utils","owner":"metafizzy","description":"UI utilities \u0026 helpers","archived":false,"fork":false,"pushed_at":"2022-11-10T10:53:39.000Z","size":85,"stargazers_count":46,"open_issues_count":6,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T05:04:21.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/metafizzy.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}},"created_at":"2015-01-22T22:16:51.000Z","updated_at":"2024-07-24T08:40:20.000Z","dependencies_parsed_at":"2022-08-29T08:51:05.303Z","dependency_job_id":null,"html_url":"https://github.com/metafizzy/fizzy-ui-utils","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Ffizzy-ui-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Ffizzy-ui-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Ffizzy-ui-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Ffizzy-ui-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metafizzy","download_url":"https://codeload.github.com/metafizzy/fizzy-ui-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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-16T23:16:23.024Z","updated_at":"2025-04-07T06:11:27.064Z","avatar_url":"https://github.com/metafizzy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fizzy UI utils\n\nUI utility \u0026 helper functions\n\nUsed in [Flickity](https://flickity.metafizzy.co), [Isotope](https://isotope.metafizzy.co), [Masonry](https://masonry.desandro.com), [Draggabilly](https://draggabilly.desandro.com)\n\n## Install\n\nnpm: `npm install fizzy-ui-utils`\n\nYarn: `yarn add fizzy-ui-utils`\n\n## API\n\n``` js\n// browser global\nconst utils = window.fizzyUIUtils;\n\n// CommonJS\nconst utils = require('fizzy-ui-utils');\n\n// JavaScript module\nimport utils from 'fizzy-ui-utils';\n\n// ---- ---- //\n\nutils.makeArray( obj )\n// make array from object\n// makeArray('single object') =\u003e [ 'single object' ]\n\nutils.modulo( num, div )\n// num [modulo] div\n\nutils.removeFrom( ary, obj )\n// remove object from array\n\nutils.getQueryElement( elem )\n// if elem is a string, use it as a selector and return element\n\nMyClass.prototype.handleEvent = utils.handleEvent;\n// enable MyClass.onclick when element.addEventListener( 'click', this, false )\n\nutils.filterFindElements( elems, selector )\n// iterate through elems, filter and find all elements that match selector\n\nutils.debounceMethod( MyClass, methodName, threhold )\n// debounce a class method\n\nutils.docReady( callback )\n// trigger callback on document ready\n\nutils.toDashed( str )\n// 'camelCaseString' -\u003e 'camel-case-string'\n\nutils.htmlInit( MyClass, namespace )\n// on document ready, initialize MyClass on every element\n// that matches [data-my-class] attribute\n// pass in JSON options from attribute value\n```\n\n**Legacy API** The following methods were available in v2, and still available in v3, but should be avoided in favor of native browser API\n\n``` js\nutils.extend( a, b )\n// extend object\n// use Object.assign() or { ...obj } instead\n\nutils.getParent( elem, selector )\n// get parent element of an element, given a selector string\n// use elem.closest( selector ) instead\n```\n\n## Browser support\n\nFizzy UI utils uses ES2018 features like spread operators and arrow functions. As such its browser support is: Chrome 46+, Firefox 34+, Safari 10+, and Edge 12+.\n\nFor older browser support, including IE10 and Android 4, [try v2](https://github.com/metafizzy/fizzy-ui-utils/tree/v2.0.7).\n\n---\n\n[MIT license](https://desandro.mit-license.org/). Have at it.\n\nBy [Metafizzy 🌈🐻](https://metafizzy.co)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafizzy%2Ffizzy-ui-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetafizzy%2Ffizzy-ui-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafizzy%2Ffizzy-ui-utils/lists"}