forked from FoundKeyGang/FoundKey
Compare commits
3 Commits
a91bbed34e
...
91c043689b
Author | SHA1 | Date |
---|---|---|
Norm | 91c043689b | |
Michcio | 30faeb73d2 | |
Michcio | dc510c6834 |
|
@ -7,8 +7,8 @@ import * as crypto from 'node:crypto';
|
|||
const TIME2000 = 946684800000;
|
||||
let counter = crypto.randomBytes(2).readUInt16LE(0);
|
||||
|
||||
export function genId(date?: Date = new Date()): string {
|
||||
let t = Math.min(date, new Date());
|
||||
export function genId(date: Date = new Date()): string {
|
||||
let t = Math.min(date.valueOf(), new Date().valueOf());
|
||||
t -= TIME2000;
|
||||
if (t < 0) t = 0;
|
||||
if (isNaN(t)) throw new Error('Failed to create AID: Invalid Date');
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Note } from '@/models/entities/note.js';
|
|||
import { Notes } from '@/models/index.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||
import Connection from '.';
|
||||
import Connection from './index.js';
|
||||
|
||||
/**
|
||||
* Stream channel
|
||||
|
|
|
@ -14,7 +14,7 @@ import { AbuseUserReport } from '@/models/entities/abuse-user-report.js';
|
|||
import { Signin } from '@/models/entities/signin.js';
|
||||
import { Page } from '@/models/entities/page.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { Webhook } from '@/models/entities/webhook';
|
||||
import { Webhook } from '@/models/entities/webhook.js';
|
||||
|
||||
//#region Stream type-body definitions
|
||||
export interface InternalStreamTypes {
|
||||
|
|
Loading…
Reference in New Issue