add hw2
This commit is contained in:
24
node_modules/html-to-image/lib/apply-style.js
generated
vendored
Normal file
24
node_modules/html-to-image/lib/apply-style.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.applyStyle = void 0;
|
||||
function applyStyle(node, options) {
|
||||
var style = node.style;
|
||||
if (options.backgroundColor) {
|
||||
style.backgroundColor = options.backgroundColor;
|
||||
}
|
||||
if (options.width) {
|
||||
style.width = "".concat(options.width, "px");
|
||||
}
|
||||
if (options.height) {
|
||||
style.height = "".concat(options.height, "px");
|
||||
}
|
||||
var manual = options.style;
|
||||
if (manual != null) {
|
||||
Object.keys(manual).forEach(function (key) {
|
||||
style[key] = manual[key];
|
||||
});
|
||||
}
|
||||
return node;
|
||||
}
|
||||
exports.applyStyle = applyStyle;
|
||||
//# sourceMappingURL=apply-style.js.map
|
||||
Reference in New Issue
Block a user