buoy-config
Advanced tools
Comparing version 3.0.0-beta.8 to 4.0.0
@@ -23,2 +23,5 @@ { | ||
},{ | ||
"text": "Diagnoses A-Z", | ||
"href": "/diagnoses-a-z/" | ||
},{ | ||
"text": "Blog", | ||
@@ -25,0 +28,0 @@ "href": "/current/" |
@@ -25,4 +25,48 @@ 'use strict'; | ||
}; | ||
var images = exports.images = importAll(require.context('./images', false, /\.(png|jpe?g|svg)$/)); | ||
var getImages = function getImages() { | ||
try { | ||
return importAll(require.context('./images', false, /\.(png|jpe?g|svg)$/)); | ||
} catch (e) { | ||
try { | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var _images = {}; | ||
if (fs.statSync(path.join(__dirname, 'images')).isDirectory()) { | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
try { | ||
for (var _iterator = fs.readdirSync(path.join(__dirname, 'images'))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var child = _step.value; | ||
_images[child.replace('./', '')] = '/images/' + child; | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
} | ||
return _images; | ||
} catch (err) { | ||
print(err); | ||
return {}; | ||
} | ||
} | ||
}; | ||
var images = exports.images = getImages(); | ||
var getBaseUrl = exports.getBaseUrl = function getBaseUrl() { | ||
@@ -29,0 +73,0 @@ var brand = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; |
{ | ||
"name": "buoy-config", | ||
"version": "3.0.0-beta.8", | ||
"version": "4.0.0", | ||
"description": "Common configuration files for Buoy clients", | ||
@@ -10,3 +10,6 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "eed520fedeae1f57c90a9c6ba174cb1e9fd0a2a3" | ||
"dependencies": { | ||
"fs": "^0.0.1-security" | ||
}, | ||
"gitHead": "1ebf50f114a8af0d350436608dfc74048d06e41b" | ||
} |
@@ -23,2 +23,5 @@ { | ||
},{ | ||
"text": "Diagnoses A-Z", | ||
"href": "/diagnoses-a-z/" | ||
},{ | ||
"text": "Blog", | ||
@@ -25,0 +28,0 @@ "href": "/current/" |
@@ -13,4 +13,27 @@ import navConfig from "./configurations/nav.json" | ||
} | ||
export const images = importAll(require.context('./images', false, /\.(png|jpe?g|svg)$/)); | ||
const getImages = () => { | ||
try { | ||
return importAll(require.context('./images', false, /\.(png|jpe?g|svg)$/)) | ||
} catch (e) { | ||
try { | ||
const path = require('path') | ||
const fs = require('fs') | ||
let images = {} | ||
if (fs.statSync(path.join(__dirname, 'images')).isDirectory()) { | ||
for (let child of fs.readdirSync(path.join(__dirname, 'images'))) { | ||
images[child.replace('./', '')] = '/images/' + child | ||
} | ||
} | ||
return images | ||
} catch (err) { | ||
print(err) | ||
return {} | ||
} | ||
} | ||
} | ||
export const images = getImages() | ||
export const getBaseUrl = (brand = undefined, baseUrlProp = undefined) => { | ||
@@ -17,0 +40,0 @@ // Determine the base url based off props and brand |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
218984
1076
2
1
3
+ Addedfs@^0.0.1-security
+ Addedfs@0.0.1-security(transitive)