PageSourceSearch

https://bassein-tgu.ru/vendor/infrajs/path/Path.js

js bassein-tgu.ru collected 2026-10-04 14:52:28 UTC 1,566 bytes, 50 lines download raw bytes

1let Path = {
2	theme: function (path) {
3		if (/^http/.test(path)) return path;
4		if (/^\//.test(path)) return path;
5		return '/' + path;
6	},
7	translit: function (str) {
8		var ru = {
9			'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd',
10			'е': 'e', 'ё': 'e', 'ж': 'j', 'з': 'z', 'и': 'i', 'й': 'y',
11			'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
12			'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u',
13			'ф': 'f', 'х': 'h', 'ц': 'c', 'ч': 'ch', 'ш': 'sh',
14			'щ': 'shch', 'ы': 'y', 'э': 'e', 'ю': 'yu', 'я': 'ya'
15		}, n_str = [];
16
17		str = str.replace(/[ъь]+/g, '');
18
19		for (var i = 0; i < str.length; ++i) {
20			n_str.push(ru[str[i]] || str[i]);
21		}
22
23		return n_str.join('');
24	},
25	encode: function (str, space) //forFS
26	{
27		//Описание в php файле
28
29		var conf = Config.get('path');
30		str = str.replace(/[\+]/g, 'p');
31		str = str.replace(/[\'\`"\.×,№%\*<>\‐\-\–\'"\|\;\:\/\\\\#\!\?\$&\s]/g, ' ');
32		if (!conf.parenthesis) str = str.replace(/[\(\)]/g, ' ');
33
34		if (conf.encodelower || conf.translit) str = str.toLowerCase();
35		if (conf.translit) str = Path.translit(str);
36
37		str = str.replace(/^\s+/g, '');
38		str = str.replace(/\s+$/g, '');
39		str = str.replace(/\s+/g, ' ');
40
41		var conf = Config.get('path');
42		//if (!conf.space) 
43		if (!space) str = str.replace(/\s/g, '-');
44
45		if (!conf.translit && (str.lenght > conf.encodelimit)) console.error('Слишком длинная строка Path.encode', str);
46		return str;
47	}
48}
49window.Path = Path
50export { Path }

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.