mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
stash: averages proto
This commit is contained in:
1 parent
474846e9c2
commit
f91dd1e2c0
5 files changed
+29
-6
No files matched your search
@@ -56,7 +56,7 @@ export const averageDefinitions = fetch(asset('averages/manifest.json'), {
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) =>
|
||||
decode<AverageDefinitions>(
|
||||
'blitzkit.AverageDefinitions',
|
||||
'blitzkit/blitzkit.AverageDefinitions',
|
||||
new Uint8Array(buffer),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -2,13 +2,13 @@ import { Root } from 'protobufjs';
|
||||
import { context } from '../blitzkit/context';
|
||||
|
||||
export async function lookup(proto: string) {
|
||||
const name = proto.split('.')[0];
|
||||
const [file, message] = proto.split('/')[0];
|
||||
const root = await new Root().load(
|
||||
context === 'server'
|
||||
? `public/protos/${name}.proto`
|
||||
: `/protos/${name}.proto`,
|
||||
? `public/protos/${file}.proto`
|
||||
: `/protos/${file}.proto`,
|
||||
{ keepCase: true },
|
||||
);
|
||||
|
||||
return root.lookupType(proto);
|
||||
return root.lookupType(message);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { youtubers } from './constants/youtubers';
|
||||
import { decodeYouTubeId } from './core/youtube/decodeYouTubeId';
|
||||
import { encodeYouTubeId } from './core/youtube/encodeYouTubeId';
|
||||
|
||||
youtubers.forEach((yt) => {
|
||||
console.log(yt.id, decodeYouTubeId(encodeYouTubeId(yt.id)));
|
||||
});
|
||||
Reference in new issue
Block a user