@graphitation/supermassive 3.5.0 → 3.5.2

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.
@@ -22,7 +22,16 @@ __export(printPathArray_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(printPathArray_exports);
24
24
  function printPathArray(path) {
25
- return path.map(
26
- (key) => typeof key === "number" ? "[" + key.toString() + "]" : "." + key
27
- ).join("");
25
+ let result = "";
26
+ for (let i = 0; i < path.length; i++) {
27
+ if (typeof path[i] === "number") {
28
+ result += `[${path[i].toString()}]`;
29
+ } else {
30
+ if (i > 0) {
31
+ result += ".";
32
+ }
33
+ result += path[i];
34
+ }
35
+ }
36
+ return result;
28
37
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsutils/printPathArray.ts"],
4
- "sourcesContent": ["/**\n * Build a string describing the path.\n */\nexport function printPathArray(path: ReadonlyArray<string | number>): string {\n return path\n .map((key) =>\n typeof key === \"number\" ? \"[\" + key.toString() + \"]\" : \".\" + key,\n )\n .join(\"\");\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,eAAe,MAA8C;AAC3E,SAAO,KACJ;AAAA,IAAI,CAAC,QACJ,OAAO,QAAQ,WAAW,MAAM,IAAI,SAAS,IAAI,MAAM,MAAM;AAAA,EAC/D,EACC,KAAK,EAAE;AACZ;",
4
+ "sourcesContent": ["/**\n * Build a string describing the path.\n */\nexport function printPathArray(path: ReadonlyArray<string | number>): string {\n let result = \"\";\n for (let i = 0; i < path.length; i++) {\n if (typeof path[i] === \"number\") {\n result += `[${path[i].toString()}]`;\n } else {\n if (i > 0) {\n result += \".\";\n }\n result += path[i];\n }\n }\n return result;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,eAAe,MAA8C;AAC3E,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,OAAO,KAAK,CAAC,MAAM,UAAU;AAC/B,gBAAU,IAAI,KAAK,CAAC,EAAE,SAAS;AAAA,IACjC,OAAO;AACL,UAAI,IAAI,GAAG;AACT,kBAAU;AAAA,MACZ;AACA,gBAAU,KAAK,CAAC;AAAA,IAClB;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,17 @@
1
1
  // src/jsutils/printPathArray.ts
2
2
  function printPathArray(path) {
3
- return path.map(
4
- (key) => typeof key === "number" ? "[" + key.toString() + "]" : "." + key
5
- ).join("");
3
+ let result = "";
4
+ for (let i = 0; i < path.length; i++) {
5
+ if (typeof path[i] === "number") {
6
+ result += `[${path[i].toString()}]`;
7
+ } else {
8
+ if (i > 0) {
9
+ result += ".";
10
+ }
11
+ result += path[i];
12
+ }
13
+ }
14
+ return result;
6
15
  }
7
16
  export {
8
17
  printPathArray
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsutils/printPathArray.ts"],
4
- "sourcesContent": ["/**\n * Build a string describing the path.\n */\nexport function printPathArray(path: ReadonlyArray<string | number>): string {\n return path\n .map((key) =>\n typeof key === \"number\" ? \"[\" + key.toString() + \"]\" : \".\" + key,\n )\n .join(\"\");\n}\n"],
5
- "mappings": ";AAGO,SAAS,eAAe,MAA8C;AAC3E,SAAO,KACJ;AAAA,IAAI,CAAC,QACJ,OAAO,QAAQ,WAAW,MAAM,IAAI,SAAS,IAAI,MAAM,MAAM;AAAA,EAC/D,EACC,KAAK,EAAE;AACZ;",
4
+ "sourcesContent": ["/**\n * Build a string describing the path.\n */\nexport function printPathArray(path: ReadonlyArray<string | number>): string {\n let result = \"\";\n for (let i = 0; i < path.length; i++) {\n if (typeof path[i] === \"number\") {\n result += `[${path[i].toString()}]`;\n } else {\n if (i > 0) {\n result += \".\";\n }\n result += path[i];\n }\n }\n return result;\n}\n"],
5
+ "mappings": ";AAGO,SAAS,eAAe,MAA8C;AAC3E,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,OAAO,KAAK,CAAC,MAAM,UAAU;AAC/B,gBAAU,IAAI,KAAK,CAAC,EAAE,SAAS;AAAA,IACjC,OAAO;AACL,UAAI,IAAI,GAAG;AACT,kBAAU;AAAA,MACZ;AACA,gBAAU,KAAK,CAAC;AAAA,IAClB;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@graphitation/supermassive",
3
3
  "license": "MIT",
4
- "version": "3.5.0",
4
+ "version": "3.5.2",
5
5
  "main": "./lib/index",
6
6
  "repository": {
7
7
  "type": "git",