mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-20 05:35:19 +01:00
b9cb6d1c10
将来ESMに移行しやすいように Related: #7658 なんかmochaが起動しなくなってるけど理由不明 すぐ直したい
19 lines
455 B
TypeScript
19 lines
455 B
TypeScript
import * as fs from 'fs';
|
|
import { fileURLToPath } from 'url';
|
|
import { dirname } from 'path';
|
|
|
|
//const _filename = fileURLToPath(import.meta.url);
|
|
const _filename = __filename;
|
|
const _dirname = dirname(_filename);
|
|
|
|
const license = fs.readFileSync(_dirname + '/../../LICENSE', 'utf-8');
|
|
|
|
const licenseHtml = license
|
|
.replace(/\r\n/g, '\n')
|
|
.replace(/(.)\n(.)/g, '$1 $2')
|
|
.replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');
|
|
|
|
export {
|
|
license,
|
|
licenseHtml
|
|
};
|