Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit 36a85f2

Browse files
authored
Chore: Folder structure fix (#7)
* fir part of folder and file rename * fix lint problems * adding tests for all the files
1 parent 794c9e2 commit 36a85f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6540
-833
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
nsmockup-1.0.js
1+
nsmockup-1.0.js
2+
coverage
File renamed without changes.

N/encode.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
convert: (obj) => {
3+
const NodeEncodingMap = {
4+
UTF_8: 'utf8',
5+
BASE_16: 'hex',
6+
// TO DO add base32
7+
BASE_32: 'base64',
8+
BASE_64: 'base64',
9+
// TO DO add base64 URL safe
10+
BASE_64_URL_SAFE: 'base64',
11+
HEX: 'hex',
12+
};
13+
const inputBuffer = Buffer.from(obj.string, NodeEncodingMap[obj.inputEncoding]);
14+
return inputBuffer.toString(NodeEncodingMap[obj.outputEncoding]);
15+
},
16+
Encoding: {
17+
UTF_8: 'UTF_8',
18+
BASE_16: 'BASE_16',
19+
BASE_32: 'BASE_32',
20+
BASE_64: 'BASE_64',
21+
BASE_64_URL_SAFE: 'BASE_64_URL_SAFE',
22+
HEX: 'HEX',
23+
},
24+
25+
};
File renamed without changes.
File renamed without changes.

N/format.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Return a Netsuite Format Module
3+
*
4+
* @classDescription Format object
5+
* @constructor
6+
* @returns {N/Module}
7+
*/
8+
9+
const moment = require('moment');
10+
11+
module.exports = {
12+
format: options => moment(options.value).format('D.M.YYYY H:m'),
13+
parse: options => moment(options.value).format('D.M.YYYY H:m'),
14+
Type: {
15+
DATETIME: 'DATETIME',
16+
DATETIMEZ: 'DATETIMEZ',
17+
},
18+
Timezone: {
19+
EUROPE_AMSTERDAM: 'EUROPE_AMSTERDAM',
20+
AMERICA_LOS_ANGELES: 'AMERICA_LOS_ANGELES',
21+
},
22+
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)