mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(std/examples): add tests for examples (#4094)
This commit is contained in:
parent
162d66d23f
commit
fe9ac35a65
16 changed files with 258 additions and 5 deletions
|
@ -12,7 +12,8 @@ import * as colors from "../fmt/colors.ts";
|
|||
|
||||
const decoder = new TextDecoder();
|
||||
|
||||
function isObject(arg): arg is object {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function isObject(arg: any): arg is object {
|
||||
return !!arg && arg.constructor === Object;
|
||||
}
|
||||
|
||||
|
@ -35,7 +36,8 @@ function printValue(value: unknown, path: string): void {
|
|||
console.log(path + " = " + value);
|
||||
}
|
||||
|
||||
function printObject(obj: object, path: string): void {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function printObject(obj: { [key: string]: any }, path: string): void {
|
||||
for (const key of Object.keys(obj)) {
|
||||
const value = obj[key];
|
||||
let nodePath = path + colors.cyan(".") + key;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue