INNER CODE UNIT · TypeScript

pathKey

margelo/react-native-runtimes · packages/state/src/index.ts:284

function pathKey(path: SharedStorePath): string {
  const segments = normalizePath(path);
  return segments.length === 0 ? ROOT_SUBTREE_KEY : segments.join('.');
}

function pathSegmentsFromKey(key: string): string[] {
  return key === ROOT_SUBTREE_KEY ? [] : normalizePath(key);
}

function areRelatedPathKeys(left: string, right: string): boolean {
  if (
    left === right ||
    left === ROOT_SUBTREE_KEY ||
    right === ROOT_SUBTREE_KEY
  ) {
    return true;
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…