spice-js 2.5.21 → 2.5.24
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/bootstrap/map.js
CHANGED
package/build/bootstrap/seed.js
CHANGED
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
var _path = _interopRequireDefault(require("path"));
|
|
4
4
|
|
|
5
|
+
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
6
|
+
|
|
5
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6
8
|
|
|
7
9
|
spice.seeds = {};
|
|
8
10
|
|
|
9
11
|
var paths = _path.default.join(spice.root_path, "seeds");
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
if (_fsExtra.default.existsSync(paths)) {
|
|
14
|
+
require("fs").readdirSync(paths).forEach(function (file) {
|
|
15
|
+
if (file != "index.js") {
|
|
16
|
+
var seed = require(_path.default.join(paths, file));
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
spice.seeds[file.split(".")[0]] = seed;
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
if (seed.run) {
|
|
21
|
+
seed.run();
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
24
|
+
});
|
|
25
|
+
}
|
package/package.json
CHANGED
package/src/bootstrap/map.js
CHANGED
package/src/models/SpiceModel.js
CHANGED
|
@@ -200,7 +200,7 @@ export default class SpiceModel {
|
|
|
200
200
|
if (i == "requires") {
|
|
201
201
|
returnVal.push(`shouldExist:${props[i]}`);
|
|
202
202
|
}
|
|
203
|
-
if (i == "unique") {
|
|
203
|
+
if (i == "unique" && props[i] == true) {
|
|
204
204
|
returnVal.push(`unique:${this.constructor.name},${property_name}`);
|
|
205
205
|
}
|
|
206
206
|
if (i == "type") {
|