aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/tldts-core/src/lookup/fast-path.ts
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
commitafa87af01c79a9baa539f2992d32154d2a4739bd (patch)
tree92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/tldts-core/src/lookup/fast-path.ts
parent3b927e84d200402281f68181cd4253bc77e5528d (diff)
downloadneko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.gz
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.bz2
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.zip
task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq
Diffstat (limited to 'vanilla/node_modules/tldts-core/src/lookup/fast-path.ts')
-rw-r--r--vanilla/node_modules/tldts-core/src/lookup/fast-path.ts80
1 files changed, 0 insertions, 80 deletions
diff --git a/vanilla/node_modules/tldts-core/src/lookup/fast-path.ts b/vanilla/node_modules/tldts-core/src/lookup/fast-path.ts
deleted file mode 100644
index f80898f..0000000
--- a/vanilla/node_modules/tldts-core/src/lookup/fast-path.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { IPublicSuffix, ISuffixLookupOptions } from './interface';
-
-export default function (
- hostname: string,
- options: ISuffixLookupOptions,
- out: IPublicSuffix,
-): boolean {
- // Fast path for very popular suffixes; this allows to by-pass lookup
- // completely as well as any extra allocation or string manipulation.
- if (!options.allowPrivateDomains && hostname.length > 3) {
- const last: number = hostname.length - 1;
- const c3: number = hostname.charCodeAt(last);
- const c2: number = hostname.charCodeAt(last - 1);
- const c1: number = hostname.charCodeAt(last - 2);
- const c0: number = hostname.charCodeAt(last - 3);
-
- if (
- c3 === 109 /* 'm' */ &&
- c2 === 111 /* 'o' */ &&
- c1 === 99 /* 'c' */ &&
- c0 === 46 /* '.' */
- ) {
- out.isIcann = true;
- out.isPrivate = false;
- out.publicSuffix = 'com';
- return true;
- } else if (
- c3 === 103 /* 'g' */ &&
- c2 === 114 /* 'r' */ &&
- c1 === 111 /* 'o' */ &&
- c0 === 46 /* '.' */
- ) {
- out.isIcann = true;
- out.isPrivate = false;
- out.publicSuffix = 'org';
- return true;
- } else if (
- c3 === 117 /* 'u' */ &&
- c2 === 100 /* 'd' */ &&
- c1 === 101 /* 'e' */ &&
- c0 === 46 /* '.' */
- ) {
- out.isIcann = true;
- out.isPrivate = false;
- out.publicSuffix = 'edu';
- return true;
- } else if (
- c3 === 118 /* 'v' */ &&
- c2 === 111 /* 'o' */ &&
- c1 === 103 /* 'g' */ &&
- c0 === 46 /* '.' */
- ) {
- out.isIcann = true;
- out.isPrivate = false;
- out.publicSuffix = 'gov';
- return true;
- } else if (
- c3 === 116 /* 't' */ &&
- c2 === 101 /* 'e' */ &&
- c1 === 110 /* 'n' */ &&
- c0 === 46 /* '.' */
- ) {
- out.isIcann = true;
- out.isPrivate = false;
- out.publicSuffix = 'net';
- return true;
- } else if (
- c3 === 101 /* 'e' */ &&
- c2 === 100 /* 'd' */ &&
- c1 === 46 /* '.' */
- ) {
- out.isIcann = true;
- out.isPrivate = false;
- out.publicSuffix = 'de';
- return true;
- }
- }
-
- return false;
-}