UNPKG

unmock-core

Version:

[![npm](https://img.shields.io/npm/v/unmock-core.svg)][npmjs] [![CircleCI](https://circleci.com/gh/unmock/unmock-js.svg?style=svg)](https://circleci.com/gh/unmock/unmock-js) [![codecov](https://codecov.io/gh/unmock/unmock-js/branch/dev/graph/badge.svg)](h

19 lines 883 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = __importDefault(require("debug")); const constants_1 = require("./constants"); const debugLog = debug_1.default("unmock:dsl:actors"); exports.actOn$times = (copiedSchema, originalSchema, mediaType) => { const origTimes = originalSchema[mediaType].properties[constants_1.SCHEMA_TIMES]; origTimes.default -= 1; delete copiedSchema[mediaType].properties[constants_1.SCHEMA_TIMES]; if (origTimes.default < 0) { debugLog(`$times has expired for '${mediaType}', removing state in both copied and original`); delete copiedSchema[mediaType]; delete originalSchema[mediaType]; } }; //# sourceMappingURL=actors.js.map