var getOptions = require("loader-utils").getOptions;
var validateOptions = require("schema-utils");

var schema = {
    type: "object",
    properties: {
        twigOptions: {
            type: "object",
        },
    },
};

module.exports = function(loader) {
    var options = getOptions(loader);
    if (!options) {
        return {};
    }
    validateOptions(schema, options, "twig-loader");
    return options;
};

var getOptions = require("loader-utils").getOptions;
var validateOptions = require("schema-utils");

var schema = {
    type: "object",
    properties: {
        twigOptions: {
            type: "object",
        },
    },
    additionalProperties: false,
};

module.exports = function (loader) {
    var options = getOptions(loader);
    if (!options) {
        return {};
    }
    validateOptions(schema, options, "twig-loader");
    return options;
};

Use additionalProperties keyword in JSON Schema to avoid invalid loader options
Use additionalProperties keyword in JSON Schema to avoid invalid loader options
