UNPKG

@conarti/eslint-plugin-feature-sliced

Version:
11 lines (10 loc) 498 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractSlice = void 0; const config_1 = require("../../config"); const shared_1 = require("../shared"); function extractSlice(targetPath) { const targetPathWithoutCurrentFileName = targetPath.replace(/\/\w+\.\w+$/, ''); return (0, shared_1.getByRegExp)(targetPathWithoutCurrentFileName, new RegExp(`(?<=(${config_1.layersWithSlices.join('|')})\\/)(\\w|-)+`, 'ig')); } exports.extractSlice = extractSlice;