1.1.3 • Published 2 months ago

monocart-code-viewer v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

monocart-code-viewer

npm.io npm.io npm.io npm.io

Feature

Install

npm i monocart-code-viewer

Usage

import { createCodeViewer } from 'monocart-code-viewer';

let codeViewer;

const report = {
    content: "your source content",
    coverage: {
        uncoveredLines: {
            '0': 'comment',
            '1': 'blank',
            '8': 'partial',
            '9': 'uncovered'
        },
        uncoveredPieces: {
            '8': [
                {
                    'start': 27,
                    'end': 34
                }
            ]
        },
        decorations: {
            '14': [
                {
                    'column': 4,
                    'value': 'E',
                    'attrs': {
                        'title': 'else path uncovered'
                    }
                }
            ]
        },
        executionCounts: {
            '20': [
                {
                    'column': 22,
                    'count': 10,
                    'value': '10',
                    'end': 916
                }
            ]
        }
    }
};

if (codeViewer) {
    codeViewer.update(report);
} else {
    codeViewer = createCodeViewer($el, report);
    codeViewer.on('cursor', (loc) => {
        // console.log('cursor', loc);
    });

    // codeViewer.setSelection(start, end, options);
    // codeViewer.setCursor(pos, options);
}
1.1.3

2 months ago

1.1.2

3 months ago

1.1.1

3 months ago

1.1.0

4 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

6 months ago

1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago