MCPcopy Index your code
hub / github.com/plotly/dash / urlBase

Function urlBase

dash/dash-renderer/src/actions/utils.js:17–35  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

15 * dash==0.18.0. The previous versions just had url_base_pathname
16 */
17export function urlBase(config) {
18 const hasUrlBase = has('url_base_pathname', config);
19 const hasReqPrefix = has('requests_pathname_prefix', config);
20 if (type(config) !== 'Object' || (!hasUrlBase && !hasReqPrefix)) {
21 throw new Error(
22 `
23 Trying to make an API request but neither
24 "url_base_pathname" nor "requests_pathname_prefix"
25 is in \`config\`. \`config\` is: `,
26 config
27 );
28 }
29
30 const base = hasReqPrefix
31 ? config.requests_pathname_prefix
32 : config.url_base_pathname;
33
34 return base.charAt(base.length - 1) === '/' ? base : base + '/';
35}
36
37const propsChildren = ['props', 'children'];
38

Callers 3

apiThunkFunction · 0.90
fetchCallbackFunction · 0.90

Calls 1

hasFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…