Wordpress/tests/qunit/wp-includes/js
Adam Silverstein 399db7ac03 WP-API JS Client: Add helpers to get a model or collection by route.
Add two new helper functions, `wp.api.getModelByRoute` and `wp.api.getCollectionByRoute`. Passed a route, they return the matching model or collection, or `undefined` if none is found.

Also adds tests to verify these functions work as expected.

Props rcutmore.
Fixes #41111.


git-svn-id: https://develop.svn.wordpress.org/trunk@41334 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-04 16:00:28 +00:00
..
tinymce Fix linting errors in tinymce-obsolete.js. 2017-05-08 06:05:39 +00:00
api-request.js REST API: Make jshint happy again after [41222]. 2017-08-03 20:35:38 +00:00
shortcode.js Shortcodes: Allow using single quotes for empty value attributes. 2017-07-11 00:53:33 +00:00
wp-api.js WP-API JS Client: Add helpers to get a model or collection by route. 2017-09-04 16:00:28 +00:00