hof 19.14.2 → 19.14.5
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/build/lib/mkdir.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const path = require('path');
|
4
|
-
const
|
4
|
+
const fs = require('fs');
|
5
5
|
|
6
6
|
module.exports = file => new Promise((resolve, reject) => {
|
7
7
|
const dir = path.dirname(file);
|
8
|
-
|
8
|
+
fs.mkdir(dir, {recursive: true}, err => err ? reject(err) : resolve());
|
9
9
|
});
|
@@ -4,7 +4,6 @@
|
|
4
4
|
const fs = require('fs');
|
5
5
|
const path = require('path');
|
6
6
|
const cp = require('child_process');
|
7
|
-
const mkdirp = require('mkdirp');
|
8
7
|
|
9
8
|
const mimes = {
|
10
9
|
'.gif': 'image/gif',
|
@@ -12,7 +11,7 @@ const mimes = {
|
|
12
11
|
};
|
13
12
|
|
14
13
|
const mkdir = dir => new Promise((resolve, reject) => {
|
15
|
-
|
14
|
+
fs.mkdir(dir, {recursive: true}, err => err ? reject(err) : resolve());
|
16
15
|
});
|
17
16
|
|
18
17
|
const cidToBase64 = (h, attachments) => {
|
@@ -13,7 +13,7 @@ const sanitisationBlacklistArray = {
|
|
13
13
|
'&&': { regex: '&&+', replace: '&' },
|
14
14
|
'@@': { regex: '@@+', replace: '@' },
|
15
15
|
'/..;/': { regex: '/\\.\\.;/', replace: '-' }, // Purposely input before ".." as they conflict
|
16
|
-
'..': { regex: '\\.\\.+', replace: '.' },
|
16
|
+
// '..': { regex: '\\.\\.+', replace: '.' }, // Agreed to disable this rule for now unless its specifically required
|
17
17
|
'/etc/passwd': { regex: '\/etc\/passwd', replace: '-' },
|
18
18
|
'c:\\': { regex: 'c:\\\\', replace: '-' },
|
19
19
|
'cmd.exe': { regex: 'cmd\\.exe', replace: '-' },
|
@@ -22,8 +22,8 @@ const sanitisationBlacklistArray = {
|
|
22
22
|
'[': { regex: '\\[+', replace: '[-' },
|
23
23
|
']': { regex: '\\]+', replace: ']-' },
|
24
24
|
'~': { regex: '~', replace: '~-' },
|
25
|
-
'&#': { regex: '&#', replace: '
|
26
|
-
'%U': { regex: '%U', replace: '
|
25
|
+
'&#': { regex: '&#', replace: '-' },
|
26
|
+
'%U': { regex: '%U', replace: '-' }
|
27
27
|
};
|
28
28
|
|
29
29
|
module.exports = sanitisationBlacklistArray;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "19.14.
|
4
|
+
"version": "19.14.5",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -71,7 +71,6 @@
|
|
71
71
|
"minimatch": "^3.0.3",
|
72
72
|
"minimist": "^1.2.6",
|
73
73
|
"mixwith": "^0.1.1",
|
74
|
-
"mkdirp": "^0.5.1",
|
75
74
|
"moment": "^2.29.2",
|
76
75
|
"morgan": "^1.10.0",
|
77
76
|
"mustache": "^2.3.0",
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
const fs = require('fs');
|
4
4
|
const path = require('path');
|
5
|
-
const mkdir = require('mkdirp').sync;
|
6
5
|
const rm = require('rimraf').sync;
|
7
6
|
|
8
7
|
const debug = require('debug')('hof:transpiler');
|
@@ -16,7 +15,7 @@ module.exports = (dir, data) => {
|
|
16
15
|
const outputDir = path.resolve(dir, '..', lang);
|
17
16
|
rm(outputDir);
|
18
17
|
debug(`Emptied directory ${outputDir}`);
|
19
|
-
|
18
|
+
fs.mkdirSync(outputDir);
|
20
19
|
debug(`Made directory ${outputDir}`);
|
21
20
|
Object.keys(data[lang]).forEach(namespace => {
|
22
21
|
fs.writeFileSync(path.resolve(outputDir, `${namespace}.json`), JSON.stringify(data[lang][namespace], null, ' '));
|