1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Introduces UMD headers to the web/ folder.

This commit is contained in:
Yury Delendik 2016-04-08 12:34:27 -05:00
parent 1c253e6e1d
commit 006e8fb59d
39 changed files with 836 additions and 281 deletions

View file

@ -245,7 +245,8 @@ function validateFile(path, name, context) {
if (name !== umd.amdId) {
error('AMD name does not match module name');
}
if (name.replace(/[_\/]/g, '') !== umd.jsRootName.toLowerCase()) {
if (name.replace(/[_\-\/]/g, '').toLowerCase() !==
umd.jsRootName.toLowerCase()) {
error('root name does not look like module name');
}
@ -272,7 +273,7 @@ function validateFile(path, name, context) {
return;
}
i = i.substring('root.'.length);
var j = umd.imports[index];
var j = umd.imports[index].replace(/(_|Lib)$/, '');
var offset = i.toLowerCase().lastIndexOf(j.toLowerCase());
if (offset + j.length !== i.length) {
error('JS import name does not look like corresponding body import ' +
@ -281,7 +282,7 @@ function validateFile(path, name, context) {
j = umd.amdImports[index];
if (j) {
if (j.replace(/[_\/]/g, '') !== i.toLowerCase()) {
if (j.replace(/[_\-\/]/g, '').toLowerCase() !== i.toLowerCase()) {
error('JS import name does not look like corresponding AMD import ' +
'name: ' + i + ' vs ' + j);
}