moog-require
Advanced tools
Comparing version 1.0.0 to 1.0.1
10
index.js
@@ -8,3 +8,2 @@ var async = require('async'); | ||
module.exports = function(options) { | ||
var self = require('moog')(options); | ||
@@ -57,2 +56,3 @@ | ||
var projectLevelFolder = self.options.localModules + '/' + type; | ||
var projectLevelPath = projectLevelFolder + '/index.js'; | ||
@@ -73,3 +73,5 @@ projectLevelPath = path.normalize(projectLevelPath); | ||
if (npmPath) { | ||
npmDefinition = require(npmPath); | ||
// Make a shallow clone so we can be part of multiple chains | ||
// in multiple moog objects without leakage | ||
npmDefinition = _.clone(require(npmPath)); | ||
npmDefinition.__meta = { | ||
@@ -110,3 +112,5 @@ npm: true, | ||
projectLevelDefinition = projectLevelDefinition || {}; | ||
// Make a shallow clone so we can be part of multiple chains | ||
// in multiple moog objects without leakage | ||
projectLevelDefinition = _.clone(projectLevelDefinition || {}); | ||
projectLevelDefinition.__meta = { | ||
@@ -113,0 +117,0 @@ dirname: path.dirname(projectLevelPath), |
{ | ||
"name": "moog-require", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "moog-require extends moog with support for type definitions in local files and npm modules.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -340,2 +340,4 @@ [![Build Status](https://travis-ci.org/punkave/moog-require.svg?branch=master)](https://travis-ci.org/punkave/moog-require) | ||
1.0.1: shallowly clone the result of `require` rather than attaching `.__meta` to a potentially shared object. This allows multiple instances of `moog-require` in multiple instances of `apostrophe` to independently track where modules were loaded from. | ||
1.0.0: `moog`, `async` and `lodash` dependencies updated to satisfy `npm audit`. Declared 1.x as this has been a stable part of Apostrophe 2.x for a long time. | ||
@@ -342,0 +344,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45957
969
354