@haluo/util 2.0.20 → 2.0.21
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/dist/index.js +33 -64
- package/dist/modules/cookie/index.js +18 -24
- package/dist/modules/date/index.js +49 -56
- package/dist/modules/dom/index.js +16 -23
- package/dist/modules/filter/index.js +15 -25
- package/dist/modules/format/index.js +6 -12
- package/dist/modules/match/index.js +6 -10
- package/dist/modules/monitor/index.js +7 -14
- package/dist/modules/monitor/lib/jsError.js +39 -35
- package/dist/modules/monitor/lib/timing.js +24 -28
- package/dist/modules/monitor/lib/xhr.js +26 -33
- package/dist/modules/monitor/utils/onload.js +1 -4
- package/dist/modules/monitor/utils/tracker.js +13 -27
- package/dist/modules/number/index.js +31 -35
- package/dist/modules/open-app/index.js +66 -61
- package/dist/modules/sentry/index.js +19 -27
- package/dist/modules/tools/index.d.ts +1 -1
- package/dist/modules/tools/index.js +158 -169
- package/dist/modules/upload/aliOss.d.ts +97 -45
- package/dist/modules/upload/aliOss.js +437 -575
- package/dist/modules/upload/index.d.ts +46 -1
- package/dist/modules/upload/index.js +41 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.js +1 -2
- package/package.json +15 -4
- package/dist/modules/upload/ALIOSS_EXAMPLE.d.ts +0 -83
- package/dist/modules/upload/ALIOSS_EXAMPLE.js +0 -320
- package/dist/types/modules/cookie/index.d.ts +0 -27
- package/dist/types/modules/date/index.d.ts +0 -52
- package/dist/types/modules/dom/index.d.ts +0 -28
- package/dist/types/modules/filter/index.d.ts +0 -24
- package/dist/types/modules/format/index.d.ts +0 -15
- package/dist/types/modules/match/index.d.ts +0 -12
- package/dist/types/modules/monitor/index.d.ts +0 -3
- package/dist/types/modules/monitor/lib/jsError.d.ts +0 -1
- package/dist/types/modules/monitor/lib/timing.d.ts +0 -1
- package/dist/types/modules/monitor/lib/xhr.d.ts +0 -1
- package/dist/types/modules/monitor/utils/onload.d.ts +0 -1
- package/dist/types/modules/monitor/utils/tracker.d.ts +0 -7
- package/dist/types/modules/number/index.d.ts +0 -41
- package/dist/types/modules/sentry/index.d.ts +0 -15
- package/dist/types/modules/tools/index.d.ts +0 -166
- package/dist/types/types/index.d.ts +0 -3
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.injectJsError = void 0;
|
|
18
|
-
var tracker_1 = __importDefault(require("../utils/tracker"));
|
|
19
|
-
function injectJsError(data) {
|
|
20
|
-
if (data === void 0) { data = {}; }
|
|
21
|
-
window.addEventListener('error', function (e) {
|
|
1
|
+
import track from '../utils/tracker';
|
|
2
|
+
export function injectJsError(data = {}) {
|
|
3
|
+
window.addEventListener('error', (e) => {
|
|
22
4
|
if (e.target && (e.target.src || e.target.href)) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
track.send({
|
|
6
|
+
kind: 'stability',
|
|
7
|
+
type: 'error',
|
|
8
|
+
title: 'resourceError',
|
|
9
|
+
filename: e.target.src || e.target.href,
|
|
10
|
+
tagName: e.target.tagName,
|
|
11
|
+
reason: e.target.src || e.target.href,
|
|
12
|
+
...data
|
|
13
|
+
// selector: lastEvent ? get
|
|
14
|
+
});
|
|
26
15
|
return;
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
track.send({
|
|
18
|
+
kind: 'stability',
|
|
19
|
+
type: 'error',
|
|
20
|
+
title: 'jsError',
|
|
21
|
+
message: e.message,
|
|
22
|
+
filename: e.filename,
|
|
23
|
+
position: `${e.lineno}:${e.colno}`,
|
|
24
|
+
reason: e.error.stack,
|
|
25
|
+
...data
|
|
26
|
+
// selector: lastEvent ? get
|
|
27
|
+
});
|
|
31
28
|
}, true);
|
|
32
|
-
window.addEventListener('unhandledrejection',
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
window.addEventListener('unhandledrejection', (e) => {
|
|
30
|
+
let message, filename, line, column, stack;
|
|
31
|
+
const reason = e.reason;
|
|
35
32
|
if (typeof reason === 'string') {
|
|
36
33
|
message = reason;
|
|
37
34
|
}
|
|
38
35
|
else if (typeof reason === 'object') {
|
|
39
36
|
if (reason.stack) {
|
|
40
|
-
|
|
37
|
+
const matchResult = reason.stack.match(/at\s+(.+):(\d+):(\d+)/);
|
|
41
38
|
filename = matchResult[1];
|
|
42
39
|
line = matchResult[2];
|
|
43
40
|
column = matchResult[3];
|
|
@@ -45,9 +42,16 @@ function injectJsError(data) {
|
|
|
45
42
|
message = reason.message;
|
|
46
43
|
stack = reason.stack;
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
track.send({
|
|
46
|
+
kind: 'stability',
|
|
47
|
+
type: 'error',
|
|
48
|
+
title: 'promiseError',
|
|
49
|
+
message,
|
|
50
|
+
filename,
|
|
51
|
+
position: `${line}:${column}`,
|
|
52
|
+
reason: stack,
|
|
53
|
+
...data
|
|
54
|
+
// selector: lastEvent ? get
|
|
55
|
+
});
|
|
51
56
|
});
|
|
52
57
|
}
|
|
53
|
-
exports.injectJsError = injectJsError;
|
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var tracker_1 = __importDefault(require("../utils/tracker"));
|
|
8
|
-
function timing() {
|
|
9
|
-
var FMP, LCP;
|
|
10
|
-
new PerformanceObserver(function (entryList, observer) {
|
|
11
|
-
var perfEntries = entryList.getEntries();
|
|
1
|
+
import onload from '../utils/onload';
|
|
2
|
+
import tracker from '../utils/tracker';
|
|
3
|
+
export default function timing() {
|
|
4
|
+
let FMP, LCP;
|
|
5
|
+
new PerformanceObserver((entryList, observer) => {
|
|
6
|
+
const perfEntries = entryList.getEntries();
|
|
12
7
|
FMP = perfEntries[0];
|
|
13
8
|
observer.disconnect(); // 不再观察
|
|
14
9
|
}).observe({ entryTypes: ['element'] }); // 观察页面中有意义的元素
|
|
15
|
-
new PerformanceObserver(
|
|
16
|
-
|
|
10
|
+
new PerformanceObserver((entryList, observer) => {
|
|
11
|
+
const perfEntries = entryList.getEntries();
|
|
17
12
|
LCP = perfEntries[0];
|
|
18
13
|
observer.disconnect(); // 不再观察
|
|
19
14
|
}).observe({ entryTypes: ['largest-contentful-paint'] }); // 观察页面中最大的元素
|
|
20
|
-
new PerformanceObserver(
|
|
21
|
-
|
|
15
|
+
new PerformanceObserver((entryList, observer) => {
|
|
16
|
+
const firstInput = entryList.getEntries();
|
|
22
17
|
console.log('FID', firstInput);
|
|
23
18
|
if (firstInput) {
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
let inputDelay = firstInput.processingStart - firstInput.startTime;
|
|
20
|
+
const duration = firstInput.duration;
|
|
26
21
|
if (inputDelay > 0 || duration > 0) {
|
|
27
|
-
|
|
22
|
+
tracker.send({
|
|
28
23
|
kind: 'experience',
|
|
29
24
|
type: 'firstInputDelay',
|
|
30
|
-
inputDelay
|
|
31
|
-
duration
|
|
25
|
+
inputDelay,
|
|
26
|
+
duration,
|
|
32
27
|
startTime: firstInput.startTime
|
|
33
28
|
});
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
31
|
observer.disconnect(); // 不再观察
|
|
37
32
|
}).observe({ type: 'first-input', buffered: true }); // 观察页面中最大的元素
|
|
38
|
-
(
|
|
39
|
-
setTimeout(
|
|
33
|
+
onload(function () {
|
|
34
|
+
setTimeout(() => {
|
|
40
35
|
console.dir(window.performance);
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const { fetchStart, connectStart, connectEnd, requestStart, responseStart, responseEnd, domInteractive, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart,
|
|
37
|
+
// loadEventEnd
|
|
38
|
+
} = performance.getEntriesByType('navigation')[0];
|
|
39
|
+
tracker.send({
|
|
43
40
|
kind: 'experience',
|
|
44
41
|
type: 'timing',
|
|
45
42
|
connectTime: connectEnd - connectStart,
|
|
@@ -49,13 +46,13 @@ function timing() {
|
|
|
49
46
|
timeToInteractive: domInteractive - fetchStart,
|
|
50
47
|
loadTime: loadEventStart - fetchStart // 完整的页面加载时间
|
|
51
48
|
});
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
let FP = performance.getEntriesByName('first-paint')[0];
|
|
50
|
+
let FCP = performance.getEntriesByName('first-contentful-paint')[0];
|
|
54
51
|
console.log('FP', FP);
|
|
55
52
|
console.log('FCP', FCP);
|
|
56
53
|
console.log('FMP', FMP);
|
|
57
54
|
console.log('LCP', LCP);
|
|
58
|
-
|
|
55
|
+
tracker.send({
|
|
59
56
|
kind: 'experience',
|
|
60
57
|
type: 'paint',
|
|
61
58
|
FP: FP.startTime,
|
|
@@ -66,4 +63,3 @@ function timing() {
|
|
|
66
63
|
}, 3000);
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
|
-
exports.default = timing;
|
|
@@ -1,43 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var tracker_1 = __importDefault(require("../utils/tracker"));
|
|
18
|
-
function injectXHR(data) {
|
|
19
|
-
if (data === void 0) { data = {}; }
|
|
20
|
-
var XMLHttpRequest = window.XMLHttpRequest;
|
|
21
|
-
var oldOpen = XMLHttpRequest.prototype.open;
|
|
1
|
+
import tracker from "../utils/tracker";
|
|
2
|
+
export default function injectXHR(data = {}) {
|
|
3
|
+
let XMLHttpRequest = window.XMLHttpRequest;
|
|
4
|
+
let oldOpen = XMLHttpRequest.prototype.open;
|
|
22
5
|
XMLHttpRequest.prototype.open = function (method, url, async) {
|
|
23
|
-
this.logData = { method
|
|
6
|
+
this.logData = { method, url, async };
|
|
24
7
|
return oldOpen.apply(this, arguments);
|
|
25
8
|
};
|
|
26
|
-
|
|
9
|
+
let oldSend = XMLHttpRequest.prototype.send;
|
|
27
10
|
XMLHttpRequest.prototype.send = function (body) {
|
|
28
|
-
var _this = this;
|
|
29
11
|
if (this.logData) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (
|
|
12
|
+
const startTime = Date.now();
|
|
13
|
+
const handler = (type) => (event) => {
|
|
14
|
+
if (this.logData.url.indexOf('app/collect/original/info/report/v2') > -1)
|
|
33
15
|
return;
|
|
34
16
|
if (type !== 'error')
|
|
35
17
|
return;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
18
|
+
let duration = Date.now() - startTime;
|
|
19
|
+
let status = this.status;
|
|
20
|
+
let statusText = this.statusText;
|
|
21
|
+
tracker.send({
|
|
22
|
+
kind: 'stability',
|
|
23
|
+
type: 'xhr',
|
|
24
|
+
eventType: event.type,
|
|
25
|
+
pathname: this.logData.url,
|
|
26
|
+
status: status + '-' + statusText,
|
|
27
|
+
duration,
|
|
28
|
+
response: this.response ? JSON.stringify(this.response) : '',
|
|
29
|
+
params: body || '',
|
|
30
|
+
title: 'xhr',
|
|
31
|
+
reason: status + '-' + statusText + ` ${this.logData.url} ${this.response ? JSON.stringify(this.response) : ''}`,
|
|
32
|
+
...data
|
|
33
|
+
});
|
|
34
|
+
};
|
|
41
35
|
this.addEventListener('load', handler('load'), false);
|
|
42
36
|
this.addEventListener('error', handler('error'), false);
|
|
43
37
|
this.addEventListener('abort', handler('abort'), false);
|
|
@@ -45,4 +39,3 @@ function injectXHR(data) {
|
|
|
45
39
|
return oldSend.apply(this, arguments);
|
|
46
40
|
};
|
|
47
41
|
}
|
|
48
|
-
exports.default = injectXHR;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function onload(cb) {
|
|
1
|
+
export default function onload(cb) {
|
|
4
2
|
if (document.readyState) {
|
|
5
3
|
cb();
|
|
6
4
|
}
|
|
@@ -8,4 +6,3 @@ function onload(cb) {
|
|
|
8
6
|
window.addEventListener('load', cb);
|
|
9
7
|
}
|
|
10
8
|
}
|
|
11
|
-
exports.default = onload;
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
var uuidv4 = require('uuid').v4;
|
|
15
|
-
// const Parser = require('ua-parser-js');
|
|
16
|
-
var SendTracker = /** @class */ (function () {
|
|
17
|
-
function SendTracker() {
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
// import Parser from 'ua-parser-js';
|
|
3
|
+
class SendTracker {
|
|
4
|
+
url;
|
|
5
|
+
constructor() {
|
|
18
6
|
this.url = '';
|
|
19
7
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var host = window.location.host;
|
|
8
|
+
send(data = {}) {
|
|
9
|
+
const host = window.location.host;
|
|
23
10
|
if (host.indexOf('localhost') > -1)
|
|
24
11
|
return;
|
|
25
|
-
|
|
12
|
+
const reg = /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g;
|
|
26
13
|
if (reg.test(host))
|
|
27
14
|
return;
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
const log = { ...getExtraData(), ...data };
|
|
16
|
+
let formBody = [];
|
|
30
17
|
for (var property in log) {
|
|
31
18
|
var encodedKey = encodeURIComponent(property);
|
|
32
19
|
var encodedValue = encodeURIComponent(log[property]);
|
|
@@ -44,9 +31,8 @@ var SendTracker = /** @class */ (function () {
|
|
|
44
31
|
// }).catch((e) => {
|
|
45
32
|
// console.log(e)
|
|
46
33
|
// })
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
50
36
|
function getExtraData() {
|
|
51
37
|
return {
|
|
52
38
|
deviceId: uuidv4(),
|
|
@@ -60,4 +46,4 @@ function getExtraData() {
|
|
|
60
46
|
// userAgent: new Parser().getResult()
|
|
61
47
|
};
|
|
62
48
|
}
|
|
63
|
-
|
|
49
|
+
export default new SendTracker();
|
|
@@ -4,34 +4,31 @@
|
|
|
4
4
|
* @createBy: @2020.05.26
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
|
-
|
|
8
|
-
var NumberClass = /** @class */ (function () {
|
|
9
|
-
function NumberClass() {
|
|
10
|
-
}
|
|
7
|
+
class NumberClass {
|
|
11
8
|
/**
|
|
12
9
|
* 个位数前面补0
|
|
13
10
|
* @param {Number} num 需要格式化的数字
|
|
14
11
|
* @return {String} '01'
|
|
15
12
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
formatNumber(num) {
|
|
14
|
+
const res = num.toString();
|
|
18
15
|
return res[1] ? res : '0' + res;
|
|
19
|
-
}
|
|
16
|
+
}
|
|
20
17
|
/**
|
|
21
18
|
* 将手机号中间部分替换为星号
|
|
22
19
|
* @param {String} phone 手机号码
|
|
23
20
|
* @return {String} 131****1111
|
|
24
21
|
*/
|
|
25
|
-
|
|
22
|
+
formatPhone(phone) {
|
|
26
23
|
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
|
|
27
|
-
}
|
|
24
|
+
}
|
|
28
25
|
/**
|
|
29
26
|
* 格式化数字 万
|
|
30
27
|
* @param {Number} num
|
|
31
28
|
* @return {String} 12.3万
|
|
32
29
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
convertToWan(num) {
|
|
31
|
+
let result = '';
|
|
35
32
|
if (num < 10000) {
|
|
36
33
|
result = num;
|
|
37
34
|
}
|
|
@@ -39,14 +36,14 @@ var NumberClass = /** @class */ (function () {
|
|
|
39
36
|
result = (num / 10000).toFixed(1) + '万';
|
|
40
37
|
}
|
|
41
38
|
return result;
|
|
42
|
-
}
|
|
39
|
+
}
|
|
43
40
|
/**
|
|
44
41
|
* 格式化数字 k
|
|
45
42
|
* @param {Number} num
|
|
46
43
|
* @return {String} 1.2k
|
|
47
44
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
convertToThousand(num) {
|
|
46
|
+
let result = '';
|
|
50
47
|
if (num < 1000) {
|
|
51
48
|
result = num;
|
|
52
49
|
}
|
|
@@ -54,28 +51,28 @@ var NumberClass = /** @class */ (function () {
|
|
|
54
51
|
result = (num / 1000).toFixed(1) + 'k';
|
|
55
52
|
}
|
|
56
53
|
return result;
|
|
57
|
-
}
|
|
54
|
+
}
|
|
58
55
|
/**
|
|
59
56
|
* 随机数,指定范围
|
|
60
57
|
* @param {Number} min 开始
|
|
61
58
|
* @param {Number} max 结束
|
|
62
59
|
* @return {Number|Object}
|
|
63
60
|
*/
|
|
64
|
-
|
|
61
|
+
random(min, max) {
|
|
65
62
|
if (arguments.length === 2) {
|
|
66
63
|
return Math.floor(min + Math.random() * ((max + 1) - min));
|
|
67
64
|
}
|
|
68
65
|
else {
|
|
69
66
|
return null;
|
|
70
67
|
}
|
|
71
|
-
}
|
|
68
|
+
}
|
|
72
69
|
/**
|
|
73
70
|
* 格式化金额
|
|
74
71
|
* @param {Number} num
|
|
75
72
|
* @return {String} 123,456
|
|
76
73
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
formatMoney(money, signal) {
|
|
75
|
+
let result = '';
|
|
79
76
|
if (money === '') {
|
|
80
77
|
return result;
|
|
81
78
|
}
|
|
@@ -89,30 +86,29 @@ var NumberClass = /** @class */ (function () {
|
|
|
89
86
|
return result = money;
|
|
90
87
|
}
|
|
91
88
|
signal = signal === '' ? '' : ',';
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
let price = money.split('.')[0] + '';
|
|
90
|
+
const pricePoint = money.split('.')[1];
|
|
94
91
|
result = price.length > 6 ?
|
|
95
|
-
|
|
92
|
+
`${price.substring(0, price.length - 6)}${signal}${price.substring(price.length - 6, price.length - 3)},${price.substring(price.length - 3, price.length)}`
|
|
96
93
|
:
|
|
97
|
-
|
|
98
|
-
result = pricePoint ?
|
|
94
|
+
`${price.substring(0, price.length - 3)}${signal}${price.substring(price.length - 3, price.length)}`;
|
|
95
|
+
result = pricePoint ? `${result}${signal}${pricePoint}` : result;
|
|
99
96
|
return result;
|
|
100
|
-
}
|
|
97
|
+
}
|
|
101
98
|
/**
|
|
102
99
|
* 格式化手机号
|
|
103
100
|
* @param {string} number 手机号
|
|
104
101
|
* @returns {string} 格式化后的手机号 12345678901 -> 123 4567 8901
|
|
105
102
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
formatPhoneNumber(number) {
|
|
104
|
+
const numStr = String(number).replace(/\s/g, '');
|
|
108
105
|
if (numStr.length < 11) {
|
|
109
106
|
return numStr;
|
|
110
107
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
exports.default = new NumberClass();
|
|
108
|
+
const firstPart = numStr.slice(0, 3);
|
|
109
|
+
const secondPart = numStr.slice(3, 7);
|
|
110
|
+
const thirdPart = numStr.slice(7, 11);
|
|
111
|
+
return `${firstPart} ${secondPart} ${thirdPart}`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export default new NumberClass();
|