<commit_before>import * as cluster from 'cluster';
import * as http from 'http';
import * as path from 'path';
import * as express from 'express';
import * as expressSession from 'express-session';
import * as mongoose from 'mongoose';
import * as MongoStore from 'connect-mongo';
const _MongoStore: MongoStore.MongoStoreFactory = MongoStore(expressSession);
import * as compression from 'compression';
import * as bodyParser from 'body-parser';
import * as cookieParser from 'cookie-parser';
// import { logDone, logFailed, logInfo } from 'log-cool';

import { User } from './models/user';
import { MisskeyExpressRequest } from './misskey-express-request';
import { MisskeyExpressResponse } from './misskey-express-response';
import namingWorkerId from './utils/naming-worker-id';
import requestApi from './utils/request-api';

import config from './config';

import router from './router';

function uatype(ua: string): string {
	'use strict';
	if (ua !== null) {
		ua = ua.toLowerCase();
		if (/(iphone|ipod|ipad|android.*mobile|windows.*phone|psp|vita|nitro|nintendo)/i.test(ua)) {
			return 'mobile';
		} else {
			return 'desktop';
		}
	} else {
		return 'desktop';
	}<commit_msg>Fix bug<commit_after>import * as cluster from 'cluster';
import * as http from 'http';
import * as path from 'path';
import * as express from 'express';
import * as expressSession from 'express-session';
import * as mongoose from 'mongoose';
import * as MongoStore from 'connect-mongo';
const _MongoStore: MongoStore.MongoStoreFactory = MongoStore(expressSession);
import * as compression from 'compression';
import * as bodyParser from 'body-parser';
import * as cookieParser from 'cookie-parser';
// import { logDone, logFailed, logInfo } from 'log-cool';

import { User } from './models/user';
import { MisskeyExpressRequest } from './misskey-express-request';
import { MisskeyExpressResponse } from './misskey-express-response';
import namingWorkerId from './utils/naming-worker-id';
import requestApi from './utils/request-api';

import config from './config';

import router from './router';

function uatype(ua: string): string {
	'use strict';
	if (ua !== undefined && ua !== null) {
		ua = ua.toLowerCase();
		if (/(iphone|ipod|ipad|android.*mobile|windows.*phone|psp|vita|nitro|nintendo)/i.test(ua)) {
			return 'mobile';
		} else {
			return 'desktop';
		}
	} else {
		return 'desktop';
	}
{'fraction_non_alphanumeric': 0.14459346186085498, 'fraction_numerical': 0.0, 'mean_word_length': 4.8504901960784315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '861187', 'n_tokens_mistral': 747, 'n_tokens_neox': 721, 'n_words': 221}