Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : index.d.ts
// TypeScript Version: 3.5

import {Node, Parent} from 'unist'

declare namespace unistUtilIs {
  /**
   * Check that type property matches expectation for a node
   *
   * @typeParam T type of node that passes test
   */
  type TestType<T extends Node> = T['type']

  /**
   * Check that some attributes on a node are matched
   *
   * @typeParam T type of node that passes test
   */
  type TestObject<T extends Node> = Partial<T>

  /**
   * Check if a node passes a test
   *
   * @param node node to check
   * @param index index of node in parent
   * @param parent parent of node
   * @typeParam T type of node that passes test
   * @returns true if type T is found, false otherwise
   */
  type TestFunction<T extends Node> = (
    node: unknown,
    index?: number,
    parent?: Parent
  ) => node is T

  /**
   * Union of all the types of tests
   *
   * @typeParam T type of node that passes test
   */
  type Test<T extends Node> =
    | TestType<T>
    | TestObject<T>
    | TestFunction<T>
    | null
    | undefined
}

/**
 * Unist utility to check if a node passes a test.
 *
 * @param node Node to check.
 * @param test When nullish, checks if `node` is a `Node`.
 * When `string`, works like passing `function (node) {return node.type === test}`.
 * When `function` checks if function passed the node is true.
 * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
 * When `array`, checks any one of the subtests pass.
 * @param index Position of `node` in `parent`
 * @param parent Parent of `node`
 * @param context Context object to invoke `test` with
 * @typeParam T type that node is compared with
 * @returns Whether test passed and `node` is a `Node` (object with `type` set to non-empty `string`).
 */
declare function unistUtilIs<T extends Node>(
  node: unknown,
  test?: unistUtilIs.Test<T> | Array<unistUtilIs.Test<any>>,
  index?: number,
  parent?: Parent,
  context?: any
): node is T

export = unistUtilIs
© 2026 GrazzMean