@altano/html-cdnify 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/CDNTransformer.js
CHANGED
|
@@ -9,7 +9,7 @@ class OptionsMerger {
|
|
|
9
9
|
return Array.isArray(a) && a.length > 0 && OptionsMerger.isTransformDefinition(a[0]);
|
|
10
10
|
}
|
|
11
11
|
static mergeCustomizer = (objValue, srcValue) => {
|
|
12
|
-
if (OptionsMerger.isTransformDefinitions(objValue)
|
|
12
|
+
if (OptionsMerger.isTransformDefinitions(objValue) && OptionsMerger.isTransformDefinitions(srcValue)) {
|
|
13
13
|
const result = unionBy(
|
|
14
14
|
srcValue,
|
|
15
15
|
objValue,
|
|
@@ -55,7 +55,7 @@ class CDNTransformer extends HtmlAttributeStreamTransformer.HtmlAttributeStreamT
|
|
|
55
55
|
cdnOptions
|
|
56
56
|
);
|
|
57
57
|
if (typeof this.cdnOptions.cdnUrl !== "string") {
|
|
58
|
-
throw new Error(`Invalid cdnUrl
|
|
58
|
+
throw new Error(`Invalid cdnUrl specified.`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
#cdnifyAttribute(oldUrl) {
|
|
@@ -42,10 +42,10 @@ class HtmlAttributeStreamTransformer extends HtmlTransformer {
|
|
|
42
42
|
option.attributeParser = HtmlAttributeStreamTransformer.attributeParsers["default"];
|
|
43
43
|
}
|
|
44
44
|
if (typeof option.selector !== "string") {
|
|
45
|
-
throw new Error(`Invalid selector
|
|
45
|
+
throw new Error(`Invalid selector specified.`);
|
|
46
46
|
}
|
|
47
47
|
if (typeof option.attribute !== "string") {
|
|
48
|
-
throw new Error(`Invalid attribute
|
|
48
|
+
throw new Error(`Invalid attribute specified.`);
|
|
49
49
|
}
|
|
50
50
|
if (!(option.attributeParser instanceof Function)) {
|
|
51
51
|
throw new Error("Invalid attributeParser specified.");
|