Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7460962
searchClient.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
655 B
Referenced Files
None
Subscribers
None
searchClient.js
View Options
const
searchClientsData
=
require
(
'./searchClients/searchClients.json'
);
function
searchClient
(
config
)
{
return
{
active
:
null
,
getData
:
function
(
key
,
value
)
{
return
Object
.
values
(
searchClientsData
).
find
(
(
item
)
=>
item
[
key
]
===
value
);
},
setActive
:
function
(
id
)
{
const
data
=
this
.
getData
(
'id'
,
id
);
if
(
data
&&
data
!==
this
.
active
)
{
// eslint-disable-next-line security/detect-non-literal-require
const
client
=
require
(
`./searchClients/
${
data
.
id
}
.js`
);
this
.
active
=
data
;
this
.
active
.
client
=
client
(
config
);
}
}
};
}
/** @module searchClient */
module
.
exports
=
searchClient
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 02:50 (2 d, 21 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e0/2b/96c6c2184b946fd34b5ba93f3e4c
Default Alt Text
searchClient.js (655 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment