Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix(collectors): add require string check
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGabriele committed Nov 22, 2017
1 parent 5661223 commit c4918fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/collectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ export const setters = function () {
}

export const requires = function () {
config.require.forEach(value => _require(value))
config.require.forEach(value => {
if (typeof value !== 'string') {
throw new Error(
'[vue-analytics] Wrong configuration in the plugin options. \n' +
'The "require" array requires each item to be a string.'
)
}

_require(value)
})
}

export default function () {
Expand Down

0 comments on commit c4918fb

Please sign in to comment.