HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/underscore-template-loader/lib/macros.js
var loaderUtils = require('loader-utils');

var strRepeat = function (str, times) {
    var result = '';

    for (var i = 0; i < times; i++) {
        result += str;
    }

    return result;
};

// Used to translate require macros to override arguments
var objExtend = function (args, obj) {args = Array.prototype.slice.call(args);var _a = args.slice(1); _a.unshift(Object.assign(obj, args[0])); return _a;};

// Default macros
module.exports = {
    require: function (resourcePath, args) {
      var argsExpr = args ? '(' + objExtend + ')' + '(arguments, ' + JSON.stringify(args) + ')' : 'arguments';
      return "require(" + JSON.stringify(loaderUtils.urlToRequest(resourcePath)) + ").apply(null," + argsExpr + ")";
    },

    include: function (resourcePath) {
        return "require(" + JSON.stringify(loaderUtils.urlToRequest(resourcePath)) + ")";
    },

    br: function (times) {
        var str = strRepeat('<br>', typeof(times) == 'undefined' ? 1 : parseInt(times));
        return "'" + str + "'";
    },

    nl: function (times) {
        var str = strRepeat('\\n', typeof(times) == 'undefined' ? 1 : parseInt(times));
        return "'" + str + "'";
    }
};