Falcor 路径 Utils
该寄存器包含用于转换和操纵Falcor路径的公用设施.
工具函数 :
-
collapse(paths)
简化一组路径。 示例var util = require("falcor-path-utils"); var collapsedPaths = util.collapse([ ["genres", 0, "titles", 0, "name"], ["genres", 0, "titles", 0, "rating"], ["genres", 0, "titles", 1, "name"], ["genres", 0, "titles", 1, "rating"] ]); // collapsed paths is ["genres", 0, "titles", {from: 0, to: 1}, ["name", "rating"]] -
iterateKeySet(keySet, note)
采用akeySet(单位:千美元)note并企图以物配主. -
toTree(paths)
转换paths以一棵树为生ưμ㼯a(中文(简体) ) -
toPaths(lengths)
转换 alengthTree到路径。 ()ưμ㼯a(中文(简体) ) -
pathsComplementFromTree(paths, tree)
返回这些列表paths没有在tree. (中文(简体) )ưμ㼯a(中文(简体) ) -
pathsComplementFromLengthTree(paths, lengthTree)
如上等但以长树为用. -
hasIntersection(tree, path, depth)
测试是否应该从总路径中剥取相交点. -
optimizePathSets(cache, paths, maxRefFollow)
(单位:千美元)ưμ㼯a(中文(简体) ) -
pathCount(pathSet)
返回 PathSet 中的路径数.var util = require("falcor-path-utils"); console.log(util.pathCount(["titlesById", [512, 628], ["name","rating"]])) // prints 4, because ["titlesById", [512, 628], ["name","rating"]] contains... // ["titlesById", 512, "name"] // ["titlesById", 512, "rating"] // ["titlesById", 628, "name"] // ["titlesById", 628, "rating"]