Commit 67af4245efaed0ba7650c3662031b8f49cb5a46c
1 parent
49eaf19a3a
Exists in
master
Refactor util menjadi common
Showing 3 changed files with 13 additions and 13 deletions Side-by-side Diff
lib/common.js
... | ... | @@ -0,0 +1,12 @@ |
1 | +'use strict'; | |
2 | + | |
3 | +function extractValueFromReadLineData(data) { | |
4 | + if (!data) return null; | |
5 | + | |
6 | + const chunks = data.split(': '); | |
7 | + if (!chunks) return null; | |
8 | + | |
9 | + return chunks[1]; | |
10 | +} | |
11 | + | |
12 | +exports.extractValueFromReadLineData = extractValueFromReadLineData; |
lib/modem.js
... | ... | @@ -11,7 +11,7 @@ const config = require('komodo-sdk/config'); |
11 | 11 | const logger = require('komodo-sdk/logger'); |
12 | 12 | const locks = require('locks'); |
13 | 13 | |
14 | -const common = require('./util'); | |
14 | +const common = require('./common'); | |
15 | 15 | const sms = require('./sms'); |
16 | 16 | |
17 | 17 | let imsi; |
lib/util.js
... | ... | @@ -1,12 +0,0 @@ |
1 | -'use strict'; | |
2 | - | |
3 | -function extractValueFromReadLineData(data) { | |
4 | - if (!data) return null; | |
5 | - | |
6 | - const chunks = data.split(': '); | |
7 | - if (!chunks) return null; | |
8 | - | |
9 | - return chunks[1]; | |
10 | -} | |
11 | - | |
12 | -exports.extractValueFromReadLineData = extractValueFromReadLineData; |