monaca-lib
Advanced tools
Comparing version 2.7.5 to 2.7.6
@@ -5,2 +5,8 @@ | ||
v2.7.6 | ||
---- | ||
* Improved `getLocalProjectFiles` functions by filtering files before further processing | ||
* Generated only one `.monacaignore` file for all project templates | ||
* Fixed Typo | ||
v2.7.5 | ||
@@ -7,0 +13,0 @@ ---- |
{ | ||
"name": "monaca-lib", | ||
"version": "2.7.5", | ||
"version": "2.7.6", | ||
"description": "Monaca cloud and localkit API bindings for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "./src/main.js", |
@@ -5,5 +5,8 @@ | ||
let crc32 = require('buffer-crc32'); | ||
let ignore = require('ignore'); | ||
let filterIgnoreFiles = function(files, ignoreListInstance, removeBasePath = false) { | ||
let filterIgnoreFiles = function(files, ignoreList, removeBasePath = false) { | ||
let keys = Object.keys(files); | ||
let ignoreListInstance = ignore().add(ignoreList); | ||
if (removeBasePath === true) keys = keys.map(file => file.substr(1)); //remove '/' | ||
@@ -22,2 +25,9 @@ let allowedKeys = ignoreListInstance.filter(keys); | ||
let filter = function(array, ignoreList) { | ||
if (!ignoreList) return array; | ||
if (!array || !array.length) return array; | ||
let ignoreListInstance = ignore().add(ignoreList); | ||
return ignoreListInstance.filter(array) || []; | ||
} | ||
let isDirectory = (path) => { | ||
@@ -59,12 +69,2 @@ if(fs.lstatSync(path).isDirectory()) return true; | ||
let addFileToLocalFile = function(files, filename, content) { | ||
if (filename && content) { | ||
files[filename] = { | ||
type: 'file', | ||
hash: crc32(content).toString('hex') | ||
} | ||
} | ||
return files; | ||
}; | ||
module.exports = { | ||
@@ -76,3 +76,3 @@ filterIgnoreFiles: filterIgnoreFiles, | ||
filterObjectByKeys: filterObjectByKeys, | ||
addFileToLocalFile: addFileToLocalFile, | ||
filter: filter, | ||
}; |
Sorry, the diff of this file is too big to display
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
32132097
690
193362