mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-06 23:19:14 +08:00
44 lines
983 B
Text
44 lines
983 B
Text
'use strict';
|
|
|
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
const separator = /[\s,]+/;
|
|
function flipFromString(custom, flip) {
|
|
flip.split(separator).forEach((str) => {
|
|
const value = str.trim();
|
|
switch (value) {
|
|
case "horizontal":
|
|
custom.hFlip = true;
|
|
break;
|
|
case "vertical":
|
|
custom.vFlip = true;
|
|
break;
|
|
}
|
|
});
|
|
}
|
|
function alignmentFromString(custom, align) {
|
|
align.split(separator).forEach((str) => {
|
|
const value = str.trim();
|
|
switch (value) {
|
|
case "left":
|
|
case "center":
|
|
case "right":
|
|
custom.hAlign = value;
|
|
break;
|
|
case "top":
|
|
case "middle":
|
|
case "bottom":
|
|
custom.vAlign = value;
|
|
break;
|
|
case "slice":
|
|
case "crop":
|
|
custom.slice = true;
|
|
break;
|
|
case "meet":
|
|
custom.slice = false;
|
|
}
|
|
});
|
|
}
|
|
|
|
exports.alignmentFromString = alignmentFromString;
|
|
exports.flipFromString = flipFromString;
|