MCPcopy Index your code
hub / github.com/vercel/hyper / toDependencies

Function toDependencies

app/plugins.ts:229–247  ·  view source on GitHub ↗
(plugins_: {plugins: string[]})

Source from the content-addressed store, hash-verified

227}
228
229function toDependencies(plugins_: {plugins: string[]}) {
230 const obj: Record<string, string> = {};
231 plugins_.plugins.forEach((plugin) => {
232 const regex = /.(@|#)/;
233 const match = regex.exec(plugin);
234
235 if (match) {
236 const index = match.index + 1;
237 const pieces: string[] = [];
238
239 pieces[0] = plugin.substring(0, index);
240 pieces[1] = plugin.substring(index + 1, plugin.length);
241 obj[pieces[0]] = pieces[1];
242 } else {
243 obj[plugin] = 'latest';
244 }
245 });
246 return obj;
247}
248
249export const subscribe = (fn: Function) => {
250 watchers.push(fn);

Callers 1

syncPackageJSONFunction · 0.85

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected