url-sanitizer 2.3.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,37 +0,0 @@
1
- /**
2
- * lib-util.js
3
- */
4
-
5
- import fs from 'node:fs';
6
- import { fileURLToPath } from 'node:url';
7
-
8
- /* constants */
9
- const CHAR = 'utf8';
10
-
11
- /**
12
- * parse json
13
- * @param {string} url - file url
14
- * @returns {string|Array|object} - parsed json
15
- */
16
- export const parseJson = url => {
17
- const { href } = new URL(url, import.meta.url);
18
- const filePath = fileURLToPath(href);
19
- const file = fs.readFileSync(filePath, {
20
- encoding: CHAR,
21
- flag: 'r'
22
- });
23
- const content = JSON.parse(file);
24
- return content;
25
- };
26
-
27
- /**
28
- * text chars
29
- * @type {Array.<number>}
30
- */
31
- export const textChars = parseJson('../lib/file/text-chars.json');
32
-
33
- /**
34
- * uri schemes
35
- * @type {Array.<string>}
36
- */
37
- export const uriSchemes = parseJson('../lib/iana/uri-schemes.json');
@@ -1,3 +0,0 @@
1
- export function parseJson(url: string): string | any[] | object;
2
- export const textChars: Array<number>;
3
- export const uriSchemes: Array<string>;