MCPcopy Create free account
hub / github.com/denoland/std / isExpectedInnerList

Function isExpectedInnerList

http/unstable_structured_fields_test.ts:800–812  ·  view source on GitHub ↗
(expected: any[])

Source from the content-addressed store, hash-verified

798// Check if expected value represents an inner list
799// deno-lint-ignore no-explicit-any
800function isExpectedInnerList(expected: any[]): boolean {
801 // Inner list: [[item1, item2, ...], params]
802 // Item: [bareItem, params]
803 // The first element of an inner list is an array of items (arrays)
804 // The first element of an item is a bare item (not an array, unless it's broken)
805 if (!Array.isArray(expected) || expected.length !== 2) return false;
806 const [first] = expected;
807 if (!Array.isArray(first)) return false;
808 // If first element is empty array, it's an empty inner list
809 if (first.length === 0) return true;
810 // If first element is an array of arrays, it's an inner list
811 return Array.isArray(first[0]);
812}
813
814// Convert test suite expected list member
815// deno-lint-ignore no-explicit-any

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected