• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

marcomontalbano / figma-export / 8040637088

25 Feb 2024 08:41PM CUT coverage: 96.473%. Remained the same
8040637088

push

github

web-flow
Merge pull request #162 from marcomontalbano/add-overrides-for-axios

Add `overrides` for axios

236 of 258 branches covered (91.47%)

Branch coverage included in aggregate %.

612 of 621 relevant lines covered (98.55%)

17.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/packages/core/src/lib/export-styles.ts
1
import * as FigmaExport from '@figma-export/types';
2

3
import { getClient, getStyles } from './figma';
1✔
4
import { fetchStyles, parseStyles } from './figmaStyles';
1✔
5

6
export const styles: FigmaExport.StylesCommand = async ({
1✔
7
    token,
8
    fileId,
9
    version,
10
    ids = [],
8✔
11
    onlyFromPages = [],
7✔
12
    outputters = [],
6✔
13
    log = (msg): void => {
6✔
14
        // eslint-disable-next-line no-console
15
        console.log(msg);
10✔
16
    },
17
}) => {
8✔
18
    const client = getClient(token);
8✔
19

20
    log('fetching document');
8✔
21
    const figmaStyles = await getStyles(
8✔
22
        client,
23
        {
24
            fileId,
25
            version,
26
            ids,
27
            onlyFromPages,
28
        },
29
    );
30

31
    log('fetching styles');
4✔
32
    const styleNodes = await fetchStyles(client, fileId, figmaStyles, version);
4✔
33

34
    log('parsing styles');
3✔
35
    const parsedStyles = parseStyles(styleNodes);
3✔
36

37
    await Promise.all(outputters.map((outputter) => outputter(parsedStyles)));
3✔
38

39
    log(`exported styles from ${fileId}`);
3✔
40

41
    return parsedStyles;
3✔
42
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc