@gram-data/gram-ops
Advanced tools
Comparing version 0.2.14 to 0.2.15
@@ -1,2 +0,2 @@ | ||
import { GramNode, GramPath, GramSeq } from '@gram-data/gram-ast'; | ||
import { GramEdge, GramNode, GramPath, GramSeq } from '@gram-data/gram-ast'; | ||
export declare const count: (p: GramPath) => number; | ||
@@ -13,2 +13,2 @@ export declare const head: (p: GramPath) => GramNode; | ||
export declare const nodes: (p: GramPath | GramPath[] | GramSeq) => GramNode[]; | ||
export declare const edges: (p: GramPath) => GramPath[]; | ||
export declare const edges: (p: GramPath) => GramEdge[]; |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.2.14", | ||
"version": "0.2.15", | ||
"license": "MIT", | ||
@@ -54,5 +54,5 @@ "repository": { | ||
"@types/unist": "^2.0.3", | ||
"@typescript-eslint/parser": "^4.8.1", | ||
"@typescript-eslint/parser": "^4.8.2", | ||
"husky": "^4.3.0", | ||
"npm-check-updates": "^10.2.1", | ||
"npm-check-updates": "^10.2.2", | ||
"npm-run-all": "^4.1.5", | ||
@@ -64,9 +64,9 @@ "serve": "^11.3.2", | ||
"typedoc": "^0.19.2", | ||
"typescript": "^4.0.5", | ||
"typescript": "^4.1.2", | ||
"unist-util-inspect": "^6.0.1" | ||
}, | ||
"dependencies": { | ||
"@gram-data/gram-ast": "^0.2.13", | ||
"@gram-data/gram-builder": "^0.2.13", | ||
"fp-ts": "^2.8.6" | ||
"@gram-data/gram-ast": "^0.2.15", | ||
"@gram-data/gram-builder": "^0.2.15", | ||
"fp-ts": "^2.9.0" | ||
}, | ||
@@ -76,3 +76,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "efceee89285585637fa856af06fd9aafffa0453b" | ||
"gitHead": "c3049970cbd258e0a930927b71558b5245621758" | ||
} |
import { | ||
GramEdge, | ||
GramNode, | ||
@@ -69,3 +70,3 @@ GramPath, | ||
export const edges = (p: GramPath): GramPath[] => { | ||
export const edges = (p: GramPath): GramEdge[] => { | ||
return p === undefined | ||
@@ -88,9 +89,9 @@ ? [] | ||
] | ||
: []), | ||
: [] as GramEdge[]), | ||
...edges(p.children[1]), | ||
] | ||
: p.children.reduce( | ||
(acc: GramPath[], child: GramPath) => [...acc, ...edges(child)], | ||
[] as GramPath[] | ||
(acc: GramEdge[], child: GramPath) => [...acc, ...edges(child)], | ||
[] as GramEdge[] | ||
); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53241
384
Updated@gram-data/gram-ast@^0.2.15
Updatedfp-ts@^2.9.0