UNPKG

@conarti/eslint-plugin-feature-sliced

Version:
30 lines (29 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateExtractedFeatureSlicedParts = void 0; const shared_1 = require("../shared"); const layers_1 = require("./layers"); function validateExtractedFeatureSlicedParts(extractedFeatureSlicedParts) { const { layer, slice, segment, segmentFiles, } = extractedFeatureSlicedParts; const hasLayer = (0, layers_1.isLayer)(layer); const hasNotLayer = !hasLayer; const hasSlice = !(0, shared_1.isNull)(slice); const hasNotSlice = !hasSlice; const hasSegment = !(0, shared_1.isNull)(segment); const hasNotSegment = !hasSegment; const hasSegmentFiles = !(0, shared_1.isNull)(segmentFiles); const hasNotSegmentFiles = !hasSegmentFiles; const canContainSlices = hasLayer && (0, layers_1.canLayerContainSlices)(layer); return { hasLayer, hasNotLayer, hasSlice, hasNotSlice, hasSegment, hasNotSegment, hasSegmentFiles, hasNotSegmentFiles, canLayerContainSlices: canContainSlices, }; } exports.validateExtractedFeatureSlicedParts = validateExtractedFeatureSlicedParts;