main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
596 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var pkgName = 'nano-css';
|
---|
4 |
|
---|
5 | module.exports = function warnOnMissingDependencies (addon, renderer, deps) {
|
---|
6 | var missing = [];
|
---|
7 |
|
---|
8 | for (var i = 0; i < deps.length; i++) {
|
---|
9 | var name = deps[i];
|
---|
10 |
|
---|
11 | if (!renderer[name]) {
|
---|
12 | missing.push(name);
|
---|
13 | }
|
---|
14 | }
|
---|
15 |
|
---|
16 | if (missing.length) {
|
---|
17 | var str = 'Addon "' + addon + '" is missing the following dependencies:';
|
---|
18 |
|
---|
19 | for (var j = 0; j < missing.length; j++) {
|
---|
20 | str += '\n require("' + pkgName + '/addon/' + missing[j] + '").addon(nano);';
|
---|
21 | }
|
---|
22 |
|
---|
23 | throw new Error(str);
|
---|
24 | }
|
---|
25 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.