# extendify/3.1.6/src/Agent/abilities/rest.js

Extendify, version 3.1.6. 14 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.6/code/src/Agent/abilities/rest.js
- Raw: https://pluginprobe.com/plugins/extendify/3.1.6/raw/src/Agent/abilities/rest.js
- Modified: 2026-08-20T19:51:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.1.6/code/src/Agent/abilities/rest.js#L10-L20`.

```javascript
import apiFetch from '@wordpress/api-fetch';

export const query = (args) =>
	new URLSearchParams(
		Object.entries(args).filter(
			([, value]) => value !== undefined && value !== '',
		),
	);

export const restBase = async (path) => {
	const registered = await apiFetch({ path }).catch(() => null);
	return registered?.rest_base;
};

```
