fis3-hook-lego
Advanced tools
Comparing version 0.2.11 to 0.2.12
@@ -12,4 +12,8 @@ /** | ||
fs = _.fs, | ||
useRootPackage = '', | ||
compare = require('compare-version'); | ||
var projRoot = fis.project.getProjectPath().replace(/\/src$/, ''), | ||
packRoot = require(projRoot + '\\package.json'); | ||
module.exports = function(id, opts) { | ||
@@ -19,2 +23,4 @@ var ignore = opts.ignore, | ||
useRootPackage = opts.useRootPackage; | ||
if (typeof ignore === 'string') { | ||
@@ -93,3 +99,5 @@ ignore = [opts.ignore]; | ||
if (!ver) { // 默认最新 | ||
if (useRootPackage && packRoot.lego && packRoot.lego.dependencies && packRoot.lego.dependencies[pkgName]) { | ||
ver = packRoot.lego.dependencies[pkgName]; | ||
} else if (!ver) { // 默认最新 | ||
versions = fs.readdirSync(_(lego, pkgName)) || []; | ||
@@ -96,0 +104,0 @@ |
{ | ||
"name": "fis3-hook-lego", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "lego 包管理模块查找", | ||
@@ -17,3 +17,3 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/jiangyuan/fis3-hook-lego" | ||
"url": "git+https://github.com/jiangyuan/fis3-hook-lego.git" | ||
}, | ||
@@ -35,3 +35,43 @@ "author": { | ||
"fis3-hook-commonjs": "^0.1.1" | ||
} | ||
}, | ||
"gitHead": "6d719562d4c9595896902ba8ca11c50e03124d83", | ||
"_id": "fis3-hook-lego@0.2.11", | ||
"scripts": {}, | ||
"_shasum": "b62cb7f3f5ed2f78a2521326e5cb89c61cd8c131", | ||
"_from": "fis3-hook-lego@*", | ||
"_npmVersion": "2.14.7", | ||
"_nodeVersion": "4.2.3", | ||
"_npmUser": { | ||
"name": "imweb", | ||
"email": "txw3tech@gmail.com" | ||
}, | ||
"dist": { | ||
"shasum": "b62cb7f3f5ed2f78a2521326e5cb89c61cd8c131", | ||
"tarball": "https://registry.npmjs.org/fis3-hook-lego/-/fis3-hook-lego-0.2.11.tgz" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "feix760", | ||
"email": "382184760@qq.com" | ||
}, | ||
{ | ||
"name": "helondeng", | ||
"email": "dhlwust@163.com" | ||
}, | ||
{ | ||
"name": "imweb", | ||
"email": "txw3tech@gmail.com" | ||
}, | ||
{ | ||
"name": "jiangyuan", | ||
"email": "jiangyuanlucky@gmail.com" | ||
} | ||
], | ||
"_npmOperationalInternal": { | ||
"host": "packages-6-west.internal.npmjs.com", | ||
"tmp": "tmp/fis3-hook-lego-0.2.11.tgz_1456281736896_0.9205799507908523" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/fis3-hook-lego/-/fis3-hook-lego-0.2.11.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -6,2 +6,4 @@ var _ = fis.util, | ||
var projRoot = fis.project.getProjectPath().replace(/\/src$/, ''), | ||
packRoot = require(projRoot + '\\package.json'); | ||
@@ -17,2 +19,3 @@ module.exports = { | ||
subFile = match && match[3] || ''; | ||
// 做一次快速判断 | ||
@@ -29,3 +32,5 @@ if (!pkgName || !getListAll(root)[pkgName]) { | ||
if (!ver) { // 默认最新 | ||
if (opts.useRootPackage && packRoot.lego && packRoot.lego.dependencies && packRoot.lego.dependencies[pkgName]){ | ||
ver = packRoot.lego.dependencies[pkgName]; | ||
} else if (!ver) { // 默认最新 | ||
versions = fs.readdirSync(_(lego, pkgName)) || []; | ||
@@ -32,0 +37,0 @@ |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
14256
283
4