{"id":21529414,"url":"https://github.com/satiewaltz/has-easing","last_synced_at":"2025-03-17T19:14:28.672Z","repository":{"id":57261477,"uuid":"127578721","full_name":"satiewaltz/has-easing","owner":"satiewaltz","description":"A tiny validator to check if a string is a valid CSS timing function.","archived":false,"fork":false,"pushed_at":"2018-04-01T02:49:55.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T18:22:39.240Z","etag":null,"topics":["checker","css","css-transitions","easing","timing-function","validator"],"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/satiewaltz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-31T23:14:23.000Z","updated_at":"2018-04-01T02:46:27.000Z","dependencies_parsed_at":"2022-08-25T05:10:59.265Z","dependency_job_id":null,"html_url":"https://github.com/satiewaltz/has-easing","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satiewaltz%2Fhas-easing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satiewaltz%2Fhas-easing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satiewaltz%2Fhas-easing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satiewaltz%2Fhas-easing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satiewaltz","download_url":"https://codeload.github.com/satiewaltz/has-easing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244094271,"owners_count":20397020,"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":["checker","css","css-transitions","easing","timing-function","validator"],"created_at":"2024-11-24T01:57:25.678Z","updated_at":"2025-03-17T19:14:28.647Z","avatar_url":"https://github.com/satiewaltz.png","language":"JavaScript","readme":"# has-easing\n\n\u003e Returns true if a string is a valid [CSS timing function](https://developer.mozilla.org/en-US/docs/Web/CSS/single-transition-timing-function).\n\n[![npm version](https://badge.fury.io/js/has-easing.svg)](https://badge.fury.io/js/has-easing) [![GitHub license](https://img.shields.io/github/license/satiewaltz/has-easing.svg)](https://github.com/satiewaltz/has-easing/blob/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/satiewaltz/has-easing.svg)](https://github.com/satiewaltz/has-easing/issues) [![Build Status](https://travis-ci.org/satiewaltz/has-easing.svg?branch=master)](https://travis-ci.org/satiewaltz/has-easing) [![codecov](https://codecov.io/gh/satiewaltz/has-easing/branch/master/graph/badge.svg)](https://codecov.io/gh/satiewaltz/has-easing)\n\n## Example:\n\n```js\nimport hasEasing from 'has-easing';\n\nhasEasing('linear'); // Returns true\nhasEasing('ease-in-out'); // Returns true\nhasEasing('spinfaster!'); // Returns false\nhasEasing(); // Returns false\nhasEasing('cubic-bezier(0.17,0.67,0.83,0.67'); // Returns true\nhasEasing('cubic-bezier(999,1.67,23,-200'); // Returns false\n```\n\n## Install\n\n```sh\nyarn add has-easing\n```\n\n## Usage\n\nThis tool is useful to validate input for an animable component or an animation library that exposes CSS transitions in their API:\n\n```jsx\n// Index.jsx\nimport Cube from 'cube';\n\n\u003cCube animatable={'width'} time={'3s'} easing={'ease-in-out'} /\u003e;\n\n// Cube.jsx\nimport hasEasing from 'has-easing';\n// ... Somewhere in a render() method:\nconst { animatable, value, time, easing } = this.props;\n// In this case, hasEasing is used to set a default easing on invalid input:\nconst easing = hasEasing(easing) ? 'ease-in-out' : easing;\nconst CSSTransition = `${animatable} ${time} ${easing}`;\n```\n\n## Development Commands\n\n```sh\n$ npm test # run tests with Jest\n$ npm run coverage # run tests with coverage and open it on browser\n$ npm run lint # lint code\n$ npm run docs # generate docs\n$ npm run build # generate docs and transpile code\n$ npm run watch # watch code changes and run scripts automatically\n$ npm run patch # bump patch version and publish to npm e.g. 0.0.1\n$ npm run minor # bump minor version and publish to npm e.g. 0.1.0\n$ npm run major # bump major version and publish to npm e.g. 1.0.0\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [hasEasing](#haseasing)\n\n### hasEasing\n\nThis function checks if an input is a valid transition timing function.\n\n**Parameters**\n\n-   `easing` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** String to check if it's a valid timing function.\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Boolean of whether the timing function is valid.\n\n## License\n\nMIT © [Dave Barthly](https://github.com/satiewaltz)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatiewaltz%2Fhas-easing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatiewaltz%2Fhas-easing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatiewaltz%2Fhas-easing/lists"}