How to use the format.apply function in format

To help you get started, we’ve selected a few format examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeebe-io / zeebe-modeler / client / lib / base / logger.js View on Github external
// fail-safe
  try {
    var ref = args[0];

    if (REF_PATTERN.test(ref)) {
      ref = ref.replace(REF_PATTERN, '');

      args.shift();
    } else {
      ref = null;
    }

    var entry = {
      category: category,
      ref: ref,
      message: format.apply(null, args)
    };

    this.entries.push(entry);
  } catch (e) {
    console.error(e);
  }
};
github wooorm / fault / index.js View on Github external
function FormattedError(format) {
    if (format) {
      format = formatter.apply(null, arguments)
    }

    return new EConstructor(format)
  }
}
github wooorm / fault / fault.js View on Github external
function FormattedError(format) {
    if (format) {
      format = formatter.apply(null, arguments);
    }

    return new EConstructor(format);
  }
}
github matthewmueller / coderunner / lib / terminal / terminal.js View on Github external
function print(args) {
  return printf.apply(null, args);
};
github EddyVerbruggen / nativescript-i18n / i18n.ios.js View on Github external
const L = function () {
    arguments[0] = bundle.localizedStringForKeyValueTable(arguments[0], '', null);
    return format.apply(this, arguments);
};
github EddyVerbruggen / nativescript-i18n / i18n.android.js View on Github external
const L = function () {
    if (resources && arguments.length) {
        var resID = resources.getIdentifier(arguments[0], "string", packageName);

        if (resID != 0) {
            arguments[0] = resources.getString(resID);
            return format.apply(this, arguments);
        }
        return arguments[0];
    }
};