<commit_before>import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
import { Schema as NgComponentOptions } from '@schematics/angular/component/schema';
import { findModuleFromOptions } from '@schematics/angular/utility/find-module';
import { buildDefaultPath, getProject } from '@schematics/angular/utility/project';

export interface ScamOptions extends NgComponentOptions {
    separateModule: boolean;
}

/**
 * A function that simply merges component and module, and removes useless imports.
 * @param componentContent
 * @param moduleContent
 * @deprecated wip
 * @private
 */
export function _mergeComponentAndModule(componentContent: string, moduleContent: string): string {

    const componentLineList = componentContent.split('\n');
    let moduleLineList = moduleContent.split('\n');

    moduleLineList = moduleLineList
        .filter(line => {

            if (!line.startsWith('import')) {
                return true;
            }

            return true;

        });

    const lineList = [
        ...componentLineList,
        ...moduleLineList
    ];

    return lineList.join('\n');<commit_msg>@wishtack/schematics:scam: Merge module and component as default behavior.<commit_after>import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
import { Schema as NgComponentOptions } from '@schematics/angular/component/schema';
import { findModuleFromOptions } from '@schematics/angular/utility/find-module';
import { buildDefaultPath, getProject } from '@schematics/angular/utility/project';

export interface ScamOptions extends NgComponentOptions {
    separateModule: boolean;
}

/**
 * A function that simply merges component and module, and removes useless imports.
 * @param componentContent
 * @param moduleContent
 * @deprecated wip
 * @private
 */
export function _mergeComponentAndModule(componentContent: string, moduleContent: string): string {

    const componentLineList = componentContent.split('\n');
    let moduleLineList = moduleContent.split('\n');

    moduleLineList = moduleLineList
        .filter(line => {

            line = line.trim();

            if (!line.startsWith('import')) {
                return true;
            }

            return true;

        });

    const lineList = [
        ...componentLineList,
        ...moduleLineList
    ];

    return lineList.join('\n');
{'fraction_non_alphanumeric': 0.10840336134453782, 'fraction_numerical': 0.0, 'mean_word_length': 3.3688073394495412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2122329', 'n_tokens_mistral': 621, 'n_tokens_neox': 607, 'n_words': 158}