fei.wang
10 天以前 ae7b22322555448d95fd56f505bafa325c167a26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import * as psl from 'psl';
import type { ParsedDomain, ErrorResult, errorCodes } from './index.d.ts';
 
const x = (a: ParsedDomain | ErrorResult<keyof errorCodes>) => {
  return a;
};
 
console.log(x(psl.parse('')));
 
// $ExpectType string | null
console.log(psl.get('example.com'));
 
// $ExpectType boolean
console.log(psl.isValid('example.com'));