{"action":"opened","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2199","labels_url":"https://api.github.com/repos/moment/moment/issues/2199/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2199/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2199/events","html_url":"https://github.com/moment/moment/issues/2199","id":56420883,"number":2199,"title":"Validate units","user":{"login":"jmeas","id":2322305,"avatar_url":"https://avatars.githubusercontent.com/u/2322305?v=3","gravatar_id":"","url":"https://api.github.com/users/jmeas","html_url":"https://github.com/jmeas","followers_url":"https://api.github.com/users/jmeas/followers","following_url":"https://api.github.com/users/jmeas/following{/other_user}","gists_url":"https://api.github.com/users/jmeas/gists{/gist_id}","starred_url":"https://api.github.com/users/jmeas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmeas/subscriptions","organizations_url":"https://api.github.com/users/jmeas/orgs","repos_url":"https://api.github.com/users/jmeas/repos","events_url":"https://api.github.com/users/jmeas/events{/privacy}","received_events_url":"https://api.github.com/users/jmeas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-03T19:00:50Z","updated_at":"2015-02-03T19:00:50Z","closed_at":null,"body":"Is there a recommended way to validate units? My application accepts a scale as a query param, and I want to intelligently handle the user typing invalid scales.\r\n\r\nI considered trying to leverage `normalizeUnits` for this, but I'm not sure if it will work:\r\n\r\n```js\r\nmoment.normalizeUnits('pasta');\r\n// => pasta\r\n\r\nmoment.normalizeUnits('day');\r\n// => day\r\n```"}}