# extendify/3.1.4/src/Shared/lib/image-search-defaults.js

Extendify, version 3.1.4. 25 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.4/code/src/Shared/lib/image-search-defaults.js
- Raw: https://pluginprobe.com/plugins/extendify/3.1.4/raw/src/Shared/lib/image-search-defaults.js
- Modified: 2026-08-12T16:23:58+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.4/code/src/Shared/lib/image-search-defaults.js#L10-L20`.

```javascript
// A cache key, never a query: resolved to a real term before any request.
export const DEFAULT_IMAGE_SEARCH = 'extendify-default-image-search';

// Page titles measured worse: "About" returns zero photos, and titles are localized.
const NEUTRAL_TERMS = [
	'office workspace',
	'team meeting',
	'city street',
	'modern interior',
	'nature landscape',
];

const pickRandom = (items) => items[Math.floor(Math.random() * items.length)];

export const defaultImageSearch = () => {
	const terms = window.extSharedData?.siteProfile?.imageSearchTerms;
	const usable = Array.isArray(terms)
		? terms.filter((term) => typeof term === 'string' && term.trim())
		: [];
	return usable.length ? pickRandom(usable) : pickRandom(NEUTRAL_TERMS);
};

export const resolveImageSearch = (search) =>
	!search || search === DEFAULT_IMAGE_SEARCH ? defaultImageSearch() : search;

```
