relay-runtime 0.0.0-main-98b2cef3 → 0.0.0-main-cc6e7ec6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-98b2cef3
2
+ * Relay v0.0.0-main-cc6e7ec6
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
@@ -7,18 +7,32 @@
7
7
  *
8
8
  * @format
9
9
  */
10
+ // flowlint ambiguous-object-type:error
10
11
  'use strict';
11
12
 
12
13
  var internTable = new Map();
13
14
  var nextIndex = 1;
14
- var digits = new Set('0123456789'); // Character used as the prefix for interned strings. The specific character is
15
+ var digits = initDigitTable(); // Character used as the prefix for interned strings. The specific character is
15
16
  // chosen to reduce the likelihood that non-interned input strings need to be
16
17
  // escaped (choosing eg a-Z would increase the likelihood we need to escape)
17
18
 
18
19
  var INTERN_PREFIX = '\t'; // Character used as the prefix of escaped strings. As above, this is also
19
20
  // chosen to be unlikely in normal input strings.
20
21
 
21
- var ESCAPE_PREFIX = '\v'; // Escape a string so that it cannot conflict with an interned string
22
+ var ESCAPE_PREFIX = '\v';
23
+
24
+ function initDigitTable() {
25
+ // disable lint because digits isn't defined when this function is called
26
+ // eslint-disable-next-line no-shadow
27
+ var digits = new Set();
28
+
29
+ for (var i = 0; i < 10; ++i) {
30
+ digits.add(i.toString());
31
+ }
32
+
33
+ return digits;
34
+ } // Escape a string so that it cannot conflict with an interned string
35
+
22
36
 
23
37
  function escape(str) {
24
38
  if ( // "\t<digit>..." -> "\v\t<digit>..."
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-runtime",
3
3
  "description": "A core runtime for building GraphQL-driven applications.",
4
- "version": "0.0.0-main-98b2cef3",
4
+ "version": "0.0.0-main-cc6e7ec6",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"