@vacantthinker/firefox-addon-framework-easy 2026.611.751 → 2026.611.1153
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.
- package/README.md +0 -217
- package/dist/BaseORM.d.ts +41 -0
- package/dist/BaseORM.d.ts.map +1 -0
- package/dist/BaseORM.js +77 -0
- package/dist/browserDownload.d.ts +9 -0
- package/dist/browserDownload.d.ts.map +1 -0
- package/dist/browserDownload.js +10 -0
- package/dist/browserNotification.d.ts +8 -0
- package/dist/browserNotification.d.ts.map +1 -0
- package/dist/browserNotification.js +17 -0
- package/dist/browserRuntime.d.ts +41 -0
- package/dist/browserRuntime.d.ts.map +1 -0
- package/dist/browserRuntime.js +61 -0
- package/dist/browserTab.d.ts +34 -0
- package/dist/browserTab.d.ts.map +1 -0
- package/dist/browserTab.js +105 -0
- package/dist/generate.d.ts +13 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +99 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/opStorage.d.ts +40 -0
- package/dist/opStorage.d.ts.map +1 -0
- package/dist/opStorage.js +57 -0
- package/dist/opTab.d.ts +82 -0
- package/dist/opTab.d.ts.map +1 -0
- package/dist/opTab.js +152 -0
- package/dist/serviceCommon.d.ts +8 -0
- package/dist/serviceCommon.d.ts.map +1 -0
- package/dist/serviceCommon.js +21 -0
- package/dist/serviceFetch.d.ts +23 -0
- package/dist/serviceFetch.d.ts.map +1 -0
- package/dist/serviceFetch.js +38 -0
- package/dist/serviceGet.d.ts +13 -0
- package/dist/serviceGet.d.ts.map +1 -0
- package/dist/serviceGet.js +24 -0
- package/dist/serviceOpContent.d.ts +24 -0
- package/dist/serviceOpContent.d.ts.map +1 -0
- package/dist/serviceOpContent.js +69 -0
- package/dist/serviceOpJavascript.d.ts +41 -0
- package/dist/serviceOpJavascript.d.ts.map +1 -0
- package/dist/serviceOpJavascript.js +182 -0
- package/dist/servicePure.d.ts +18 -0
- package/dist/servicePure.d.ts.map +1 -0
- package/dist/servicePure.js +51 -0
- package/dist/serviceUpdateTabStyle.d.ts +17 -0
- package/dist/serviceUpdateTabStyle.d.ts.map +1 -0
- package/dist/serviceUpdateTabStyle.js +63 -0
- package/package.json +11 -4
- package/.github/workflows/npm-publish.yml +0 -34
- package/index.js +0 -17
- package/publish.sh +0 -81
- package/src/BaseORM.js +0 -66
- package/src/DomainORM.js +0 -11
- package/src/browserDownload.js +0 -23
- package/src/browserNotification.js +0 -22
- package/src/browserRuntime.js +0 -65
- package/src/browserRuntimeOnMessageCommon.js +0 -50
- package/src/browserTab.js +0 -139
- package/src/generate.js +0 -177
- package/src/opStorage.js +0 -76
- package/src/opTab.js +0 -237
- package/src/serviceCommon.js +0 -22
- package/src/serviceFetch.js +0 -65
- package/src/serviceGet.js +0 -31
- package/src/serviceOpContent.js +0 -83
- package/src/serviceOpJavascript.js +0 -346
- package/src/servicePure.js +0 -42
- package/src/serviceUpdateTabStyle.js +0 -130
package/src/opTab.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhances a tab object by explicitly attaching its ID to the 'tabId' property.
|
|
3
|
-
*
|
|
4
|
-
* @param {browser.tabs.Tab} tab
|
|
5
|
-
* @returns {browser.tabs.Tab & {tabId: number}|null}
|
|
6
|
-
*/
|
|
7
|
-
export function tabOpEnhance(tab) {
|
|
8
|
-
if (!tab || typeof tab.id !== 'number') return null;
|
|
9
|
-
return {...tab, tabId: tab.id};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates a normal tab using a properties object.
|
|
14
|
-
*
|
|
15
|
-
* @param {Object} properties
|
|
16
|
-
* @returns {Promise<browser.tabs.Tab & {tabId: number}>}
|
|
17
|
-
*/
|
|
18
|
-
export async function tabOpCreate(properties) {
|
|
19
|
-
const tab = await browser.tabs.create(properties);
|
|
20
|
-
return tabOpEnhance(tab);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new tab positioned immediately after a specified existing tab.
|
|
25
|
-
* Does not mutate the original properties object.
|
|
26
|
-
*
|
|
27
|
-
* @param {Object & {tabId?: number}} properties
|
|
28
|
-
* @returns {Promise<browser.tabs.Tab & {tabId: number}>}
|
|
29
|
-
*/
|
|
30
|
-
export async function tabOpCreateNear(properties) {
|
|
31
|
-
// Destructure tabId out to avoid mutating the original properties object
|
|
32
|
-
const {tabId, ...restProperties} = properties;
|
|
33
|
-
|
|
34
|
-
if (tabId) {
|
|
35
|
-
const tabPrev = await tabOpGet(tabId);
|
|
36
|
-
if (tabPrev) {
|
|
37
|
-
Object.assign(restProperties, {
|
|
38
|
-
index: tabPrev.index + 1,
|
|
39
|
-
openerTabId: tabPrev.id,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const tab = await browser.tabs.create(restProperties);
|
|
45
|
-
return tabOpEnhance(tab);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Creates a tab in the background (inactive and muted).
|
|
50
|
-
*
|
|
51
|
-
* @param {Object} properties
|
|
52
|
-
* @returns {Promise<browser.tabs.Tab & {tabId: number}>}
|
|
53
|
-
*/
|
|
54
|
-
export async function tabOpCreateActiveFalse(properties) {
|
|
55
|
-
const mergedProperties = {
|
|
56
|
-
...properties,
|
|
57
|
-
active: false,
|
|
58
|
-
muted: true,
|
|
59
|
-
};
|
|
60
|
-
const tab = await browser.tabs.create(mergedProperties);
|
|
61
|
-
return tabOpEnhance(tab);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Creates a completely new window and returns its initial tab.
|
|
66
|
-
*
|
|
67
|
-
* @param {string} url
|
|
68
|
-
* @returns {Promise<(browser.tabs.Tab & {tabId: number})|undefined>}
|
|
69
|
-
*/
|
|
70
|
-
export async function tabOpCreateByWindow(url) {
|
|
71
|
-
if (typeof url !== 'string') return undefined;
|
|
72
|
-
|
|
73
|
-
const window = await browser.windows.create({url});
|
|
74
|
-
if (window && window.tabs && window.tabs.length > 0) {
|
|
75
|
-
return tabOpEnhance(window.tabs[0]);
|
|
76
|
-
}
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Retrieves details about the specified tab.
|
|
82
|
-
*
|
|
83
|
-
* @param {number} tabId
|
|
84
|
-
* @returns {Promise<browser.tabs.Tab>}
|
|
85
|
-
*/
|
|
86
|
-
export function tabOpGet(tabId) {
|
|
87
|
-
return browser.tabs.get(tabId);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Retrieves all tabs across all windows.
|
|
92
|
-
*
|
|
93
|
-
* @returns {Promise<browser.tabs.Tab[]>}
|
|
94
|
-
*/
|
|
95
|
-
export function tabOpQueryAll() {
|
|
96
|
-
return browser.tabs.query({});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Retrieves an array of tab IDs that match the specified URL pattern.
|
|
101
|
-
*
|
|
102
|
-
* @param {string} urlQuery
|
|
103
|
-
* @returns {Promise<number[]>}
|
|
104
|
-
*/
|
|
105
|
-
export async function tabOpQueryUrl(urlQuery) {
|
|
106
|
-
const tabs = await browser.tabs.query({url: urlQuery});
|
|
107
|
-
return tabs.map(tab => tab.id);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Finds all tabs matching the URL pattern and removes them simultaneously.
|
|
112
|
-
* [Optimization]: browser.tabs.remove accepts an array of numbers, which is
|
|
113
|
-
* significantly faster than looping and awaiting individually.
|
|
114
|
-
*
|
|
115
|
-
* @param {string} urlQuery
|
|
116
|
-
* @returns {Promise<void>}
|
|
117
|
-
*/
|
|
118
|
-
export async function tabOpQueryUrlThenRemove(urlQuery) {
|
|
119
|
-
const ids = await tabOpQueryUrl(urlQuery);
|
|
120
|
-
if (ids.length > 0) {
|
|
121
|
-
await browser.tabs.remove(ids);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Reloads the given tab.
|
|
127
|
-
*
|
|
128
|
-
* @param {number} tabId
|
|
129
|
-
* @returns {Promise<void>}
|
|
130
|
-
*/
|
|
131
|
-
export function tabOpReload(tabId) {
|
|
132
|
-
return browser.tabs.reload(tabId);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Reloads the given tab, bypassing the local web cache.
|
|
137
|
-
*
|
|
138
|
-
* @param {number} tabId
|
|
139
|
-
* @returns {Promise<void>}
|
|
140
|
-
*/
|
|
141
|
-
export function tabOpReloadByPassCacheTrue(tabId) {
|
|
142
|
-
return browser.tabs.reload(tabId, {bypassCache: true});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Closes one or more tabs.
|
|
147
|
-
*
|
|
148
|
-
* @param {number|number[]} tabId
|
|
149
|
-
* @returns {Promise<void>}
|
|
150
|
-
*/
|
|
151
|
-
export function tabOpRemove(tabId) {
|
|
152
|
-
return browser.tabs.remove(tabId);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Hides one or more tabs (Firefox specific API).
|
|
157
|
-
*
|
|
158
|
-
* @param {number|number[]} tabId
|
|
159
|
-
* @returns {Promise<number[]>}
|
|
160
|
-
*/
|
|
161
|
-
export function tabOpHide(tabId) {
|
|
162
|
-
return browser.tabs.hide(tabId);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Modifies the properties of a tab.
|
|
167
|
-
*
|
|
168
|
-
* @param {number} tabId
|
|
169
|
-
* @param {Object} updateProperties
|
|
170
|
-
* @returns {Promise<browser.tabs.Tab & {tabId: number}>}
|
|
171
|
-
*/
|
|
172
|
-
export async function tabOpUpdate(
|
|
173
|
-
tabId,
|
|
174
|
-
updateProperties,
|
|
175
|
-
) {
|
|
176
|
-
const tab = await browser.tabs.update(tabId, updateProperties);
|
|
177
|
-
return tabOpEnhance(tab);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Updates a tab to be inactive and muted.
|
|
182
|
-
*
|
|
183
|
-
* @param {number} tabId
|
|
184
|
-
* @returns {Promise<browser.tabs.Tab & {tabId: number}>}
|
|
185
|
-
*/
|
|
186
|
-
export function tabOpUpdateActiveFalse(tabId) {
|
|
187
|
-
return tabOpUpdate(tabId, {active: false, muted: true});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Focuses the window containing the tab, then highlights and activates the tab.
|
|
192
|
-
*
|
|
193
|
-
* @param {number} tabId
|
|
194
|
-
* @returns {Promise<browser.tabs.Tab & {tabId: number}>}
|
|
195
|
-
*/
|
|
196
|
-
export async function tabOpFocus(tabId) {
|
|
197
|
-
const tab = await tabOpGet(tabId);
|
|
198
|
-
if (!tab || !tab.windowId) throw new Error(`Tab ${tabId} not found.`);
|
|
199
|
-
|
|
200
|
-
await browser.windows.update(tab.windowId, {focused: true});
|
|
201
|
-
|
|
202
|
-
const tabUpdated = await browser.tabs.update(tabId, {
|
|
203
|
-
active: true,
|
|
204
|
-
highlighted: true,
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
return tabOpEnhance(tabUpdated);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Injects CSS code into a page.
|
|
212
|
-
* Note: Check manifest version compatibility for 'insertCSS'.
|
|
213
|
-
*
|
|
214
|
-
* @param {number} tabId
|
|
215
|
-
* @param {string} code
|
|
216
|
-
* @returns {Promise<void>}
|
|
217
|
-
*/
|
|
218
|
-
export function tabOpInsertCssCode(
|
|
219
|
-
tabId,
|
|
220
|
-
code,
|
|
221
|
-
) {
|
|
222
|
-
return browser.tabs.insertCSS(tabId, {code});
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Removes CSS code that was previously injected into a page.
|
|
227
|
-
*
|
|
228
|
-
* @param {number} tabId
|
|
229
|
-
* @param {string} code
|
|
230
|
-
* @returns {Promise<void>}
|
|
231
|
-
*/
|
|
232
|
-
export function tabOpRemoveCssCode(
|
|
233
|
-
tabId,
|
|
234
|
-
code,
|
|
235
|
-
) {
|
|
236
|
-
return browser.tabs.removeCSS(tabId, {code});
|
|
237
|
-
}
|
package/src/serviceCommon.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {browserDownloadByDownlink} from './browserDownload.js';
|
|
2
|
-
import {browserNotificationCreate} from './browserNotification.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* service, download by downlink, if success, notification the filename
|
|
6
|
-
*
|
|
7
|
-
* if failed, nootification the reason, then try download only use downlink
|
|
8
|
-
* @param message
|
|
9
|
-
* @returns {Promise<void>}
|
|
10
|
-
*/
|
|
11
|
-
export async function serviceDownloadByDownlink(message) {
|
|
12
|
-
let {filename, downlink} = message;
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
await browserDownloadByDownlink(message);
|
|
16
|
-
await browserNotificationCreate(`downloading! ${filename}`);
|
|
17
|
-
} catch (e) {
|
|
18
|
-
await browserNotificationCreate(`reason=${e}`);
|
|
19
|
-
await browserDownloadByDownlink({downlink});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|
package/src/serviceFetch.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param serverUrl{string}
|
|
4
|
-
* @param message{{}}
|
|
5
|
-
* @returns {Promise<Response>}
|
|
6
|
-
*/
|
|
7
|
-
export async function servicePostJson(
|
|
8
|
-
serverUrl,
|
|
9
|
-
message,
|
|
10
|
-
) {
|
|
11
|
-
|
|
12
|
-
let body = JSON.stringify(message);
|
|
13
|
-
const fetchResponse = await fetch(serverUrl, {
|
|
14
|
-
method: 'POST',
|
|
15
|
-
headers: {
|
|
16
|
-
'Content-Type': 'application/json',
|
|
17
|
-
},
|
|
18
|
-
body: body,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
return fetchResponse;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @param message{ {
|
|
27
|
-
* downlink:string,
|
|
28
|
-
* filename:string|null,
|
|
29
|
-
* rpcsecret:string,
|
|
30
|
-
* rpcport:string
|
|
31
|
-
* }}
|
|
32
|
-
* @returns {Promise<Response|null>}
|
|
33
|
-
*/
|
|
34
|
-
export async function serviceSendDataToLocalAria2(message) {
|
|
35
|
-
let {downlink, filename, rpcsecret, rpcport} = message;
|
|
36
|
-
|
|
37
|
-
const secret = rpcsecret;
|
|
38
|
-
const port = rpcport;
|
|
39
|
-
|
|
40
|
-
const params = [`token:${secret}`, [downlink]];
|
|
41
|
-
if (filename) {
|
|
42
|
-
const options = {
|
|
43
|
-
out: filename,
|
|
44
|
-
};
|
|
45
|
-
params.push(options);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const data = {
|
|
49
|
-
jsonrpc: '2.0',
|
|
50
|
-
id: 'qwer',
|
|
51
|
-
method: 'aria2.addUri',
|
|
52
|
-
params,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const response = await fetch(`http://localhost:${port}/jsonrpc`, {
|
|
56
|
-
method: 'POST',
|
|
57
|
-
headers: {
|
|
58
|
-
Accept: 'application/json',
|
|
59
|
-
'Content-Type': 'application/json;charset=UTF-8',
|
|
60
|
-
},
|
|
61
|
-
body: JSON.stringify(data),
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return response;
|
|
65
|
-
}
|
package/src/serviceGet.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param url{string}
|
|
4
|
-
* @returns {string}
|
|
5
|
-
*/
|
|
6
|
-
export function serviceGetDomainByUrl(url) {
|
|
7
|
-
let urlWrap = new URL(url);
|
|
8
|
-
let domain = urlWrap.hostname;
|
|
9
|
-
return domain;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* eg 2222_12_25_11h_47m_24s_302
|
|
14
|
-
* @return {string}
|
|
15
|
-
*/
|
|
16
|
-
export function serviceGetCurrentDateYYYYMMDDHHMMSS() {
|
|
17
|
-
let date = new Date();
|
|
18
|
-
let m = [
|
|
19
|
-
[date.getFullYear(), ''].join(''),
|
|
20
|
-
[date.getMonth() + 1, ''].join(''),
|
|
21
|
-
[date.getDate(), ''].join(''),
|
|
22
|
-
|
|
23
|
-
[date.getHours(), 'h'].join(''),
|
|
24
|
-
[date.getMinutes(), 'm'].join(''),
|
|
25
|
-
[date.getSeconds(), 's'].join(''),
|
|
26
|
-
date.getMilliseconds(),
|
|
27
|
-
];
|
|
28
|
-
let r = m.join('_');
|
|
29
|
-
return r;
|
|
30
|
-
}
|
|
31
|
-
|
package/src/serviceOpContent.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {browserRuntimePlatformInfo} from './browserRuntime.js';
|
|
2
|
-
import {
|
|
3
|
-
generateMkvScriptForSystemFedora,
|
|
4
|
-
generateMkvScriptForSystemWindows,
|
|
5
|
-
} from './generate.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param data
|
|
9
|
-
* @returns {Promise<void>}
|
|
10
|
-
*/
|
|
11
|
-
export async function serviceCopyContentToClipboard(data) {
|
|
12
|
-
return await window.navigator.clipboard.writeText(data);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Eg: fnName('this is content', 'this is a filename without ext', 'txt')
|
|
17
|
-
*
|
|
18
|
-
* @param {string} content
|
|
19
|
-
* @param {string} filename Eg: abc
|
|
20
|
-
* @param {string} ext Txt json
|
|
21
|
-
*/
|
|
22
|
-
export function serviceSaveContentToLocal(content, filename, ext = 'txt') {
|
|
23
|
-
const eleBtn = document.createElement('button');
|
|
24
|
-
eleBtn.addEventListener(
|
|
25
|
-
'click',
|
|
26
|
-
function() {
|
|
27
|
-
const eleA = document.createElement('a');
|
|
28
|
-
|
|
29
|
-
const extObj = {
|
|
30
|
-
txt: 'text/plain',
|
|
31
|
-
json: 'application/json',
|
|
32
|
-
};
|
|
33
|
-
const type = extObj[ext];
|
|
34
|
-
|
|
35
|
-
const file = new Blob([content], {type});
|
|
36
|
-
eleA.href = URL.createObjectURL(file);
|
|
37
|
-
eleA.download = [filename, ext].join('.');
|
|
38
|
-
eleA.click();
|
|
39
|
-
URL.revokeObjectURL(eleA.href);
|
|
40
|
-
},
|
|
41
|
-
false,
|
|
42
|
-
);
|
|
43
|
-
eleBtn.click();
|
|
44
|
-
// eleBtn.previousElementSibling
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Need install nodejs mkvtoolnix
|
|
49
|
-
*
|
|
50
|
-
* @param message{{ Vid, title,
|
|
51
|
-
* }}
|
|
52
|
-
* @returns {Promise<void>}
|
|
53
|
-
*/
|
|
54
|
-
export async function serviceGenerateMkvToolNixScript({vid, title}) {
|
|
55
|
-
let message = {vid, title};
|
|
56
|
-
const platformInfo = await browserRuntimePlatformInfo();
|
|
57
|
-
if (platformInfo.os === 'win') {
|
|
58
|
-
let content = generateMkvScriptForSystemWindows(message);
|
|
59
|
-
serviceSaveContentToLocal(content, title, 'js');
|
|
60
|
-
}
|
|
61
|
-
else if (platformInfo.os === 'linux') {
|
|
62
|
-
let content = generateMkvScriptForSystemFedora(message);
|
|
63
|
-
serviceSaveContentToLocal(content, title, 'sh');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @param {string} value -
|
|
69
|
-
* @returns {string} -
|
|
70
|
-
*/
|
|
71
|
-
export function serviceRemoveIllegalWord(value) {
|
|
72
|
-
if (!value) return '';
|
|
73
|
-
|
|
74
|
-
let name = value.trim().split(/\r?\n/).shift();
|
|
75
|
-
|
|
76
|
-
name = name.replace(/[\p{P}\p{S}\p{C}]/gu, ' ');
|
|
77
|
-
|
|
78
|
-
name = name.replace(/[~"#%&*:<>?/\\{|}]/g, ' ');
|
|
79
|
-
|
|
80
|
-
name = name.replace(/[\s\u3000]+/g, ' ').trim();
|
|
81
|
-
|
|
82
|
-
return name.replace(/^[-.]+|[-.]+$/g, '');
|
|
83
|
-
}
|