UNPKG

proxyequal

Version:

A proxy based usage tracking and comparison

15 lines 590 B
import { proxyCompare } from "./proxyEqual"; import { resetDiffers } from "./differs"; import { weakMemoizeArray } from "./weakMemoize"; import buildTrie from "search-trie"; export var collectShallows = function collectShallows(lines) { var trie = buildTrie(lines); return lines.filter(function (value) { return trie(value + '.') || !value.lastIndexOf('.'); }); }; var memoizedCollectShallows = weakMemoizeArray(collectShallows); export var proxyShallow = function proxyShallow(a, b, affected) { resetDiffers(); return proxyCompare(a, b, memoizedCollectShallows(affected)); };