"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1280.1/packages/snyk-fix/src/plugins/python/load-handler.ts" (20 Feb 2024, 656 Bytes) of package /linux/misc/snyk-cli-1.1280.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { pipRequirementsTxt } from './handlers/pip-requirements';
    2 import { pipenvPipfile } from './handlers/pipenv-pipfile';
    3 import { poetry } from './handlers/poetry';
    4 
    5 import { SUPPORTED_HANDLER_TYPES } from './supported-handler-types';
    6 
    7 export function loadHandler(type: SUPPORTED_HANDLER_TYPES) {
    8   switch (type) {
    9     case SUPPORTED_HANDLER_TYPES.REQUIREMENTS: {
   10       return pipRequirementsTxt;
   11     }
   12     case SUPPORTED_HANDLER_TYPES.PIPFILE: {
   13       return pipenvPipfile;
   14     }
   15     case SUPPORTED_HANDLER_TYPES.POETRY: {
   16       return poetry;
   17     }
   18     default: {
   19       throw new Error('No handler available for requested project type');
   20     }
   21   }
   22 }