MCPcopy Create free account
hub / github.com/vercel/vercel / getPyprojectSubscribers

Function getPyprojectSubscribers

packages/python/src/subscribers.ts:97–119  ·  view source on GitHub ↗
(
  workPath: string
)

Source from the content-addressed store, hash-verified

95}
96
97export async function getPyprojectSubscribers(
98 workPath: string
99): Promise<Subscriber[]> {
100 const pyprojectPath = join(workPath, 'pyproject.toml');
101 if (!fs.existsSync(pyprojectPath)) {
102 return [];
103 }
104
105 const pyproject = await readConfigFile<Pyproject>(pyprojectPath);
106 const subscribers = pyproject?.tool?.vercel?.subscribers;
107 if (!subscribers) {
108 return [];
109 }
110 if (typeof subscribers !== 'object' || Array.isArray(subscribers)) {
111 throw subscriberError('"tool.vercel.subscribers" must be an object');
112 }
113
114 return Promise.all(
115 Object.entries(subscribers).map(([name, config]) =>
116 parseSubscriber(workPath, name, config)
117 )
118 );
119}
120
121async function parseSubscriber(
122 workPath: string,

Callers 1

buildFunction · 0.90

Calls 3

subscriberErrorFunction · 0.85
parseSubscriberFunction · 0.85
existsSyncMethod · 0.45

Tested by

no test coverage detected