r2-utils-js
Advanced tools
Comparing version 1.0.28 to 1.0.29
# Next | ||
Git diff: | ||
* https://github.com/readium/r2-utils-js/compare/v1.0.28...develop | ||
* https://github.com/readium/r2-utils-js/compare/v1.0.29...develop | ||
@@ -9,2 +9,20 @@ Changes: | ||
# 1.0.29 | ||
> Build environment: NodeJS `16.13.0`, NPM `8.1.4` | ||
Changes: | ||
* Removed console verbose output in filesystem folder zip emulation | ||
* Harmonised regular expressions for file extensions and HTTP URLs checks | ||
Git revision info: | ||
* https://unpkg.com/r2-utils-js@1.0.29/dist/gitrev.json | ||
* https://github.com/edrlab/r2-utils-js-dist/blob/v1.0.29/dist/gitrev.json | ||
Git commit history: | ||
* https://github.com/readium/r2-utils-js/commits/v1.0.29 | ||
Git diff: | ||
* https://github.com/readium/r2-utils-js/compare/v1.0.28...v1.0.29 | ||
# 1.0.28 | ||
@@ -11,0 +29,0 @@ |
@@ -7,3 +7,3 @@ "use strict"; | ||
function isHTTP(urlOrPath) { | ||
return /^http[s]?:\/\//.test(urlOrPath); | ||
return /^https?:\/\//.test(urlOrPath); | ||
} | ||
@@ -10,0 +10,0 @@ exports.isHTTP = isHTTP; |
@@ -43,3 +43,3 @@ "use strict"; | ||
var fileName = path.basename(filePath); | ||
var ext = path.extname(fileName).toLowerCase(); | ||
var ext = path.extname(fileName); | ||
if (stats.isDirectory()) { | ||
@@ -89,3 +89,3 @@ (function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { | ||
case 11: | ||
if (entryName.endsWith(".css")) { | ||
if (/\.css$/i.test(entryName)) { | ||
str = zipData.toString("utf8"); | ||
@@ -103,3 +103,3 @@ console.log(str); | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { | ||
@@ -106,0 +106,0 @@ var time3, zip3, diff3, time2, zip2, diff2, time1, zip1, diff1; |
@@ -41,3 +41,3 @@ "use strict"; | ||
var fileName = path.basename(filePath); | ||
var ext = path.extname(fileName).toLowerCase(); | ||
var ext = path.extname(fileName); | ||
var VERBOSE = process.env.DEBUG || false; | ||
@@ -365,3 +365,3 @@ var argIterations = args[1] ? args[1].trim() : undefined; | ||
filter(function (f) { return f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name); }). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name); }). | ||
map(function (f) { return path.join(filePath, f.name); }); | ||
@@ -385,3 +385,3 @@ _i = 0, files_1 = files; | ||
} | ||
else if (/\.(zip|epub|cbz)$/.test(ext)) { | ||
else if (/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(ext)) { | ||
(function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { | ||
@@ -388,0 +388,0 @@ return (0, tslib_1.__generator)(this, function (_a) { |
@@ -41,3 +41,3 @@ "use strict"; | ||
var fileName = path.basename(filePath); | ||
var ext = path.extname(fileName).toLowerCase(); | ||
var ext = path.extname(fileName); | ||
var argExtra = args[1] ? args[1].trim() : undefined; | ||
@@ -543,3 +543,3 @@ var READ_ZIP_STREAMS = argExtra === "1"; | ||
filter(function (f) { return f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name); }). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name); }). | ||
map(function (f) { return path.join(filePath, f.name); }); | ||
@@ -563,3 +563,3 @@ _i = 0, files_1 = files; | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { | ||
@@ -566,0 +566,0 @@ return (0, tslib_1.__generator)(this, function (_a) { |
@@ -51,3 +51,2 @@ "use strict"; | ||
var relativeFilePath = filePathNormalized.replace(dirPathNormalized, ""); | ||
debug(relativeFilePath); | ||
if (relativeFilePath.indexOf("/") === 0) { | ||
@@ -54,0 +53,0 @@ relativeFilePath = relativeFilePath.substr(1); |
@@ -7,3 +7,3 @@ "use strict"; | ||
function isHTTP(urlOrPath) { | ||
return /^http[s]?:\/\//.test(urlOrPath); | ||
return /^https?:\/\//.test(urlOrPath); | ||
} | ||
@@ -10,0 +10,0 @@ exports.isHTTP = isHTTP; |
@@ -43,3 +43,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
if (stats.isDirectory()) { | ||
@@ -68,3 +68,3 @@ (() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
} | ||
if (entryName.endsWith(".css")) { | ||
if (/\.css$/i.test(entryName)) { | ||
const str = zipData.toString("utf8"); | ||
@@ -76,3 +76,3 @@ console.log(str); | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
@@ -79,0 +79,0 @@ const time3 = process.hrtime(); |
@@ -41,3 +41,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
const VERBOSE = process.env.DEBUG || false; | ||
@@ -267,3 +267,3 @@ const argIterations = args[1] ? args[1].trim() : undefined; | ||
filter((f) => f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name)). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name)). | ||
map((f) => path.join(filePath, f.name)); | ||
@@ -275,3 +275,3 @@ for (const file of files) { | ||
} | ||
else if (/\.(zip|epub|cbz)$/.test(ext)) { | ||
else if (/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(ext)) { | ||
(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
@@ -278,0 +278,0 @@ yield processFile(filePath); |
@@ -41,3 +41,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
const argExtra = args[1] ? args[1].trim() : undefined; | ||
@@ -425,3 +425,3 @@ const READ_ZIP_STREAMS = argExtra === "1"; | ||
filter((f) => f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name)). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name)). | ||
map((f) => path.join(filePath, f.name)); | ||
@@ -433,3 +433,3 @@ for (const file of files) { | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
@@ -436,0 +436,0 @@ yield processFile(filePath); |
@@ -42,3 +42,2 @@ "use strict"; | ||
let relativeFilePath = filePathNormalized.replace(dirPathNormalized, ""); | ||
debug(relativeFilePath); | ||
if (relativeFilePath.indexOf("/") === 0) { | ||
@@ -45,0 +44,0 @@ relativeFilePath = relativeFilePath.substr(1); |
@@ -7,3 +7,3 @@ "use strict"; | ||
function isHTTP(urlOrPath) { | ||
return /^http[s]?:\/\//.test(urlOrPath); | ||
return /^https?:\/\//.test(urlOrPath); | ||
} | ||
@@ -10,0 +10,0 @@ exports.isHTTP = isHTTP; |
@@ -43,3 +43,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
if (stats.isDirectory()) { | ||
@@ -68,3 +68,3 @@ (() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
} | ||
if (entryName.endsWith(".css")) { | ||
if (/\.css$/i.test(entryName)) { | ||
const str = zipData.toString("utf8"); | ||
@@ -76,3 +76,3 @@ console.log(str); | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
@@ -79,0 +79,0 @@ const time3 = process.hrtime(); |
@@ -41,3 +41,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
const VERBOSE = process.env.DEBUG || false; | ||
@@ -267,3 +267,3 @@ const argIterations = args[1] ? args[1].trim() : undefined; | ||
filter((f) => f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name)). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name)). | ||
map((f) => path.join(filePath, f.name)); | ||
@@ -275,3 +275,3 @@ for (const file of files) { | ||
} | ||
else if (/\.(zip|epub|cbz)$/.test(ext)) { | ||
else if (/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(ext)) { | ||
(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
@@ -278,0 +278,0 @@ yield processFile(filePath); |
@@ -41,3 +41,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
const argExtra = args[1] ? args[1].trim() : undefined; | ||
@@ -425,3 +425,3 @@ const READ_ZIP_STREAMS = argExtra === "1"; | ||
filter((f) => f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name)). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name)). | ||
map((f) => path.join(filePath, f.name)); | ||
@@ -433,3 +433,3 @@ for (const file of files) { | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
@@ -436,0 +436,0 @@ yield processFile(filePath); |
@@ -42,3 +42,2 @@ "use strict"; | ||
let relativeFilePath = filePathNormalized.replace(dirPathNormalized, ""); | ||
debug(relativeFilePath); | ||
if (relativeFilePath.indexOf("/") === 0) { | ||
@@ -45,0 +44,0 @@ relativeFilePath = relativeFilePath.substr(1); |
@@ -7,3 +7,3 @@ "use strict"; | ||
function isHTTP(urlOrPath) { | ||
return /^http[s]?:\/\//.test(urlOrPath); | ||
return /^https?:\/\//.test(urlOrPath); | ||
} | ||
@@ -10,0 +10,0 @@ exports.isHTTP = isHTTP; |
@@ -42,3 +42,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
if (stats.isDirectory()) { | ||
@@ -67,3 +67,3 @@ (async () => { | ||
} | ||
if (entryName.endsWith(".css")) { | ||
if (/\.css$/i.test(entryName)) { | ||
const str = zipData.toString("utf8"); | ||
@@ -75,3 +75,3 @@ console.log(str); | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(async () => { | ||
@@ -78,0 +78,0 @@ const time3 = process.hrtime(); |
@@ -40,3 +40,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
const VERBOSE = process.env.DEBUG || false; | ||
@@ -264,3 +264,3 @@ const argIterations = args[1] ? args[1].trim() : undefined; | ||
filter((f) => f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name)). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name)). | ||
map((f) => path.join(filePath, f.name)); | ||
@@ -272,3 +272,3 @@ for (const file of files) { | ||
} | ||
else if (/\.(zip|epub|cbz)$/.test(ext)) { | ||
else if (/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(ext)) { | ||
(async () => { | ||
@@ -275,0 +275,0 @@ await processFile(filePath); |
@@ -40,3 +40,3 @@ "use strict"; | ||
const fileName = path.basename(filePath); | ||
const ext = path.extname(fileName).toLowerCase(); | ||
const ext = path.extname(fileName); | ||
const argExtra = args[1] ? args[1].trim() : undefined; | ||
@@ -420,3 +420,3 @@ const READ_ZIP_STREAMS = argExtra === "1"; | ||
filter((f) => f.isFile() && | ||
/(\.epub3?)|(\.zip)|(\.cbz)$/.test(f.name)). | ||
/((\.epub3?)|(\.zip)|(\.cbz))$/i.test(f.name)). | ||
map((f) => path.join(filePath, f.name)); | ||
@@ -428,3 +428,3 @@ for (const file of files) { | ||
} | ||
else if (/\.epub[3]?$/.test(ext) || ext === ".cbz" || ext === ".zip") { | ||
else if (/((\.epub3?)|(\.cbz)|(\.zip))$/i.test(ext)) { | ||
(async () => { | ||
@@ -431,0 +431,0 @@ await processFile(filePath); |
@@ -38,3 +38,2 @@ "use strict"; | ||
let relativeFilePath = filePathNormalized.replace(dirPathNormalized, ""); | ||
debug(relativeFilePath); | ||
if (relativeFilePath.indexOf("/") === 0) { | ||
@@ -41,0 +40,0 @@ relativeFilePath = relativeFilePath.substr(1); |
{ | ||
"node": "16.13.0", | ||
"npm": "8.1.4", | ||
"short": "39de328", | ||
"long": "39de328746dc898d4693d37bdc7e9d3ccc10abde", | ||
"short": "c4297f7", | ||
"long": "c4297f710753983c8fd3e02625d43adc8cdaaf92", | ||
"branch": "develop", | ||
"date": "2021-11-23T23:05:18.000Z", | ||
"urlHistory": "https://github.com/readium/r2-utils-js/commits/39de328746dc898d4693d37bdc7e9d3ccc10abde", | ||
"urlDiff": "https://github.com/readium/r2-utils-js/compare/39de328746dc898d4693d37bdc7e9d3ccc10abde...develop" | ||
"date": "2021-11-24T23:54:40.000Z", | ||
"urlHistory": "https://github.com/readium/r2-utils-js/commits/c4297f710753983c8fd3e02625d43adc8cdaaf92", | ||
"urlDiff": "https://github.com/readium/r2-utils-js/compare/c4297f710753983c8fd3e02625d43adc8cdaaf92...develop" | ||
} |
{ | ||
"name": "r2-utils-js", | ||
"version": "1.0.28", | ||
"version": "1.0.29", | ||
"description": "Readium 2 'utils' for NodeJS (TypeScript)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1601089
13624