@bablr/agast-helpers 0.5.1 → 0.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.
package/lib/builders.js CHANGED
@@ -45,6 +45,7 @@ export const buildEmbeddedExpression = (expr) => {
45
45
  };
46
46
 
47
47
  export const buildEmbeddedTag = (tag) => {
48
+ if (!isObject(tag)) return tag;
48
49
  return freeze({ type: EmbeddedTag, value: tag });
49
50
  };
50
51
 
@@ -63,6 +64,15 @@ export const buildWriteEffect = (text, options = {}) => {
63
64
  );
64
65
  };
65
66
 
67
+ export const buildYieldEffect = (tag) => {
68
+ return buildEffect(
69
+ freeze({
70
+ verb: 'yield',
71
+ value: buildEmbeddedTag(freeze(tag)),
72
+ }),
73
+ );
74
+ };
75
+
66
76
  export const buildAnsiPushEffect = (spans = '') => {
67
77
  return buildEffect(
68
78
  freeze({
package/lib/tree.js CHANGED
@@ -166,8 +166,8 @@ function* __treeFromStream(tokens) {
166
166
  case OpenFragmentTag: {
167
167
  const { flags } = tag.value;
168
168
 
169
- const language = doctype.value.attributes['bablr-language'];
170
- const attributes = doctype.value.attributes;
169
+ const { attributes } = doctype.value;
170
+ const language = attributes['bablr-language'];
171
171
 
172
172
  const node = freeze({
173
173
  flags,
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "@bablr/agast-helpers",
3
3
  "description": "Helper functions for working with agAST trees",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
- "files": [
8
- "lib"
9
- ],
7
+ "files": ["lib"],
10
8
  "exports": {
11
9
  "./btree": "./lib/btree.js",
12
10
  "./builders": "./lib/builders.js",