constants.js 642 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MAGIC_VALUE = exports.MAGIC_KEY = exports.SHA = void 0;

var _crypto = require("crypto");

var _semver = require("semver");

var _package = require("../package.json");

// function to use for creating hashes
const SHA = 'sha1'; // name of coverage data magic key

exports.SHA = SHA;
const MAGIC_KEY = '_coverageSchema'; // name of coverage data magic value

exports.MAGIC_KEY = MAGIC_KEY;
const MAGIC_VALUE = (0, _crypto.createHash)(SHA).update(_package.name + '@' + (0, _semver.major)(_package.version)).digest('hex');
exports.MAGIC_VALUE = MAGIC_VALUE;