This repository was archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathgraphql+0.12.3.patch
More file actions
82 lines (73 loc) · 2.88 KB
/
graphql+0.12.3.patch
File metadata and controls
82 lines (73 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
patch-package
--- a/node_modules/graphql/utilities/assertValidName.js
+++ b/node_modules/graphql/utilities/assertValidName.js
@@ -1,18 +1,20 @@
-'use strict';
+"use strict"
Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.assertValidName = assertValidName;
-exports.isValidNameError = isValidNameError;
+ value: true,
+})
+exports.assertValidName = assertValidName
+exports.isValidNameError = isValidNameError
-var _GraphQLError = require('../error/GraphQLError');
+var _GraphQLError = require("../error/GraphQLError")
-var _invariant = require('../jsutils/invariant');
+var _invariant = require("../jsutils/invariant")
-var _invariant2 = _interopRequireDefault(_invariant);
+var _invariant2 = _interopRequireDefault(_invariant)
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj }
+}
/**
* Copyright (c) 2015-present, Facebook, Inc.
@@ -23,32 +25,35 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
*
*/
-var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
+var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/
/**
* Upholds the spec rules about naming.
*/
function assertValidName(name) {
- var error = isValidNameError(name);
+ var error = isValidNameError(name)
if (error) {
- throw error;
+ throw error
}
- return name;
+ return name
}
/**
* Returns an Error if a name is invalid.
*/
function isValidNameError(name, node) {
- !(typeof name === 'string') ? (0, _invariant2.default)(0, 'Expected string') : void 0;
- if (name.length > 1 && name[0] === '_' && name[1] === '_' &&
- // Note: this special case is not part of the spec and exists only to
- // support legacy server configurations. Do not rely on this special case
- // as it may be removed at any time.
- name !== '__configs__') {
- return new _GraphQLError.GraphQLError('Name "' + name + '" must not begin with "__", which is reserved by ' + 'GraphQL introspection.', node);
- }
+ !(typeof name === "string") ? (0, _invariant2.default)(0, "Expected string") : void 0
+ // if (name.length > 1 && name[0] === '_' && name[1] === '_' &&
+ // // Note: this special case is not part of the spec and exists only to
+ // // support legacy server configurations. Do not rely on this special case
+ // // as it may be removed at any time.
+ // name !== '__configs__') {
+ // return new _GraphQLError.GraphQLError('Name "' + name + '" must not begin with "__", which is reserved by ' + 'GraphQL introspection.', node);
+ // }
if (!NAME_RX.test(name)) {
- return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "' + name + '" does not.', node);
+ return new _GraphQLError.GraphQLError(
+ 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "' + name + '" does not.',
+ node
+ )
}
}