proskomma-core 0.10.3 → 0.10.4

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/dist/index.js CHANGED
@@ -15986,7 +15986,7 @@ var bitset = {
15986
15986
  })(bitset, bitsetExports);
15987
15987
  const BitSet = /* @__PURE__ */ getDefaultExportFromCjs(bitsetExports);
15988
15988
  const name = "proskomma-core";
15989
- const version = "0.10.3";
15989
+ const version = "0.10.4";
15990
15990
  const description$b = "A Scripture Runtime Engine";
15991
15991
  const files = [
15992
15992
  "dist"
@@ -18602,12 +18602,27 @@ const unsuccinctifyItems = (docSet, succinct2, options2, nextToken, openScopes)
18602
18602
  let pos = 0;
18603
18603
  let tokenCount = nextToken || 0;
18604
18604
  const scopes = new Set(openScopes || []);
18605
+ const scopeEnums = [utils.itemDefs.itemEnum.startScope, utils.itemDefs.itemEnum.endScope];
18605
18606
  while (pos < succinct2.length) {
18606
18607
  const [itemLength, itemType, itemSubtype] = utils.succinct.headerBytes(
18607
18608
  succinct2,
18608
18609
  pos
18609
18610
  );
18610
- if ([utils.itemDefs.itemEnum.startScope, utils.itemDefs.itemEnum.endScope].includes(itemType)) {
18611
+ if (Object.keys(options2).length > 0) {
18612
+ if (!options2.scopes && scopeEnums.includes(itemType)) {
18613
+ pos += itemLength;
18614
+ continue;
18615
+ }
18616
+ if (!options2.tokens && itemType === utils.itemDefs.itemEnum.token) {
18617
+ pos += itemLength;
18618
+ continue;
18619
+ }
18620
+ if (!options2.grafts && itemType === utils.itemDefs.itemEnum.graft) {
18621
+ pos += itemLength;
18622
+ continue;
18623
+ }
18624
+ }
18625
+ if (scopeEnums.includes(itemType)) {
18611
18626
  const itemTypeName = utils.succinct.succinctScopeType(itemSubtype);
18612
18627
  if (Object.keys(options2).length > 0 && options2.scopes && options2.excludeScopeTypes && options2.excludeScopeTypes.includes(itemTypeName)) {
18613
18628
  pos += itemLength;
@@ -18626,23 +18641,14 @@ const unsuccinctifyItems = (docSet, succinct2, options2, nextToken, openScopes)
18626
18641
  ret.push(item);
18627
18642
  }
18628
18643
  } else if (item[0] === "scope" && item[1] === "start") {
18629
- scopes.add(item[2]);
18630
18644
  if (Object.keys(options2).length === 0 || options2.scopes) {
18631
- if (Object.keys(options2).length === 0 || !options2.excludeScopeTypes || options2.excludeScopeTypes.length === 0) {
18632
- ret.push(item);
18633
- } else if (!options2.excludeScopeTypes.includes(item[2].split("/")[0])) {
18634
- ret.push(item);
18635
- }
18645
+ scopes.add(item[2]);
18646
+ ret.push(item);
18636
18647
  }
18637
18648
  } else if (item[0] === "scope" && item[1] === "end") {
18638
- scopes.delete(item[2]);
18639
18649
  if (Object.keys(options2).length === 0 || options2.scopes) {
18640
- if (Object.keys(options2).length === 0 || !options2.excludeScopeTypes || options2.excludeScopeTypes.length === 0) {
18641
- ret.push(item);
18642
- } else if (!options2.excludeScopeTypes.includes(item[2].split("/")[0])) {
18643
- ret.push(item);
18644
- } else
18645
- ;
18650
+ scopes.delete(item[2]);
18651
+ ret.push(item);
18646
18652
  }
18647
18653
  } else if (item[0] === "graft") {
18648
18654
  if (Object.keys(options2).length === 0 || options2.grafts) {
package/dist/index.mjs CHANGED
@@ -15984,7 +15984,7 @@ var bitset = {
15984
15984
  })(bitset, bitsetExports);
15985
15985
  const BitSet = /* @__PURE__ */ getDefaultExportFromCjs(bitsetExports);
15986
15986
  const name = "proskomma-core";
15987
- const version = "0.10.3";
15987
+ const version = "0.10.4";
15988
15988
  const description$b = "A Scripture Runtime Engine";
15989
15989
  const files = [
15990
15990
  "dist"
@@ -18600,12 +18600,27 @@ const unsuccinctifyItems = (docSet, succinct2, options2, nextToken, openScopes)
18600
18600
  let pos = 0;
18601
18601
  let tokenCount = nextToken || 0;
18602
18602
  const scopes = new Set(openScopes || []);
18603
+ const scopeEnums = [utils.itemDefs.itemEnum.startScope, utils.itemDefs.itemEnum.endScope];
18603
18604
  while (pos < succinct2.length) {
18604
18605
  const [itemLength, itemType, itemSubtype] = utils.succinct.headerBytes(
18605
18606
  succinct2,
18606
18607
  pos
18607
18608
  );
18608
- if ([utils.itemDefs.itemEnum.startScope, utils.itemDefs.itemEnum.endScope].includes(itemType)) {
18609
+ if (Object.keys(options2).length > 0) {
18610
+ if (!options2.scopes && scopeEnums.includes(itemType)) {
18611
+ pos += itemLength;
18612
+ continue;
18613
+ }
18614
+ if (!options2.tokens && itemType === utils.itemDefs.itemEnum.token) {
18615
+ pos += itemLength;
18616
+ continue;
18617
+ }
18618
+ if (!options2.grafts && itemType === utils.itemDefs.itemEnum.graft) {
18619
+ pos += itemLength;
18620
+ continue;
18621
+ }
18622
+ }
18623
+ if (scopeEnums.includes(itemType)) {
18609
18624
  const itemTypeName = utils.succinct.succinctScopeType(itemSubtype);
18610
18625
  if (Object.keys(options2).length > 0 && options2.scopes && options2.excludeScopeTypes && options2.excludeScopeTypes.includes(itemTypeName)) {
18611
18626
  pos += itemLength;
@@ -18624,23 +18639,14 @@ const unsuccinctifyItems = (docSet, succinct2, options2, nextToken, openScopes)
18624
18639
  ret.push(item);
18625
18640
  }
18626
18641
  } else if (item[0] === "scope" && item[1] === "start") {
18627
- scopes.add(item[2]);
18628
18642
  if (Object.keys(options2).length === 0 || options2.scopes) {
18629
- if (Object.keys(options2).length === 0 || !options2.excludeScopeTypes || options2.excludeScopeTypes.length === 0) {
18630
- ret.push(item);
18631
- } else if (!options2.excludeScopeTypes.includes(item[2].split("/")[0])) {
18632
- ret.push(item);
18633
- }
18643
+ scopes.add(item[2]);
18644
+ ret.push(item);
18634
18645
  }
18635
18646
  } else if (item[0] === "scope" && item[1] === "end") {
18636
- scopes.delete(item[2]);
18637
18647
  if (Object.keys(options2).length === 0 || options2.scopes) {
18638
- if (Object.keys(options2).length === 0 || !options2.excludeScopeTypes || options2.excludeScopeTypes.length === 0) {
18639
- ret.push(item);
18640
- } else if (!options2.excludeScopeTypes.includes(item[2].split("/")[0])) {
18641
- ret.push(item);
18642
- } else
18643
- ;
18648
+ scopes.delete(item[2]);
18649
+ ret.push(item);
18644
18650
  }
18645
18651
  } else if (item[0] === "graft") {
18646
18652
  if (Object.keys(options2).length === 0 || options2.grafts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proskomma-core",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "A Scripture Runtime Engine",
5
5
  "files": [
6
6
  "dist"