@mcpher/gas-fakes 1.0.16 → 1.0.17

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/package.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "pub": "cp mainlocal.js main.js && npm publish --access public"
58
58
  },
59
59
  "name": "@mcpher/gas-fakes",
60
- "version": "1.0.16",
60
+ "version": "1.0.17",
61
61
  "license": "MIT",
62
62
  "main": "main.js",
63
63
  "description": "A proof of concept implementation of Apps Script Environment on Node",
@@ -102,6 +102,12 @@ export const findItem = (elementMap, type, startIndex, segmentId) => {
102
102
  return false;
103
103
  }
104
104
 
105
+ // For container elements that don't have a startIndex (like Header, Footer, Footnote),
106
+ // we can find them by type and segmentId alone.
107
+ if (is.undefined(startIndex)) {
108
+ return f.__type === type;
109
+ }
110
+
105
111
  // A ListItem is a specialized Paragraph. A search for a PARAGRAPH should also find a LIST_ITEM
106
112
  // at the given location.
107
113
  if (type === 'PARAGRAPH') {
@@ -242,6 +242,7 @@ class ShadowDocument {
242
242
  __name: sectionName,
243
243
  __twig: sectionTree,
244
244
  // also store the original resource item
245
+ __segmentId: sectionId,
245
246
  ...section,
246
247
  };
247
248
  this.__elementMap.set(sectionName, sectionElement);
@@ -280,6 +281,7 @@ class ShadowDocument {
280
281
  __type: 'FOOTNOTE',
281
282
  __name: footnoteName,
282
283
  __twig: footnoteTree,
284
+ __segmentId: footnoteId,
283
285
  ...footnote,
284
286
  };
285
287
  this.__elementMap.set(footnoteName, footnoteElement);