foundry-dsa41-game/node_modules/sass-build/dist/cli/commands/migrate/validate-params.js

48 lines
1.8 KiB
JavaScript

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var validate_params_exports = {};
__export(validate_params_exports, {
validateParams: () => validateParams
});
module.exports = __toCommonJS(validate_params_exports);
var import_utils = require("../../../utils");
function validateParams(params) {
import_utils.logger.silly("cli > migrate", "Validating params...");
const { file, source, glob, outFile, outDir, transformer } = params;
if (!file) {
throw new Error("Supply --file parameter.");
}
if (source || glob || outFile || outDir) {
throw new Error("Do not supply --source, --glob, --outFile or --outDir parameters.");
}
if (file && typeof file !== "string") {
throw new Error("--file must be string.");
}
if (outFile && typeof outFile !== "string") {
throw new Error("--outFile must be string.");
}
if (transformer && typeof transformer !== "string") {
throw new Error("--transformer must be string.");
}
import_utils.logger.silly("cli > migrate", "Params validated.");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
validateParams
});