Code Explainers

Code explainers tagged #nested-data

php
<?php
 
namespace App\Http\Requests;
 

Validating nested order payloads in Laravel

validation authorization nested-data
Intermediate 8 steps
typescript
type NestedValue = string | NestedValue[] | { [key: string]: NestedValue };
 
function parseFieldPath(name: string): string[] {
  const match = name.match(/^([^\[\]]+)((?:\[[^\[\]]*\])*)$/);

Parsing bracketed form field names into nested objects

parsing recursive-types regex
Intermediate 8 steps