Files
30-seconds-of-code/node_modules/@gatsbyjs/relay-compiler/lib/GraphQLCompilerUserError.js
2019-08-20 15:52:05 +02:00

26 lines
633 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
var createUserError = function createUserError(format) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var index = 0;
var formatted = format.replace(/%s/g, function (match) {
return args[index++];
});
return new Error(formatted);
};
module.exports = {
createUserError: createUserError
};