1.1.5 • Published 5 months ago

monocart-code-viewer v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 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.5

5 months ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago