utils.d.ts 1.4 KB

1234567891011121314151617181920212223242526
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. */
  8. declare type GetPath = {
  9. hasEndProp?: boolean;
  10. lastTraversedObject: unknown;
  11. traversedPath: Array<string>;
  12. value?: unknown;
  13. };
  14. export declare const getPath: (object: Record<string, any>, propertyPath: string | Array<string>) => GetPath;
  15. export declare const getObjectSubset: (object: any, subset: any, seenReferences?: WeakMap<object, boolean>) => any;
  16. export declare const iterableEquality: (a: any, b: any, aStack?: Array<any>, bStack?: Array<any>) => boolean | undefined;
  17. export declare const subsetEquality: (object: unknown, subset: unknown) => boolean | undefined;
  18. export declare const typeEquality: (a: any, b: any) => boolean | undefined;
  19. export declare const arrayBufferEquality: (a: unknown, b: unknown) => boolean | undefined;
  20. export declare const sparseArrayEquality: (a: unknown, b: unknown) => boolean | undefined;
  21. export declare const partition: <T>(items: T[], predicate: (arg: T) => boolean) => [T[], T[]];
  22. export declare const pathAsArray: (propertyPath: string) => Array<any>;
  23. export declare const isError: (value: unknown) => value is Error;
  24. export declare function emptyObject(obj: unknown): boolean;
  25. export declare const isOneline: (expected: unknown, received: unknown) => boolean;
  26. export {};