Comparing version 0.0.1 to 0.0.2
@@ -10,2 +10,3 @@ // src/treetrunks.ts | ||
let currentTreeNode = tree; | ||
console.log(maybePath); | ||
for (const segment of maybePath) { | ||
@@ -18,5 +19,11 @@ if (currentTreeNode === null) { | ||
} | ||
if (segment in currentTreeNode[1]) { | ||
currentTreeNode = currentTreeNode[1][segment]; | ||
const subPaths = currentTreeNode[1]; | ||
if (segment in subPaths) { | ||
currentTreeNode = subPaths[segment]; | ||
} else { | ||
const wildcard = Object.keys(subPaths).find((key) => key.startsWith(`\$`)); | ||
if (wildcard) { | ||
currentTreeNode = subPaths[wildcard]; | ||
continue; | ||
} | ||
return false; | ||
@@ -23,0 +30,0 @@ } |
{ | ||
"name": "treetrunks", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -68,2 +68,3 @@ export function required<T>(arg: T): [`required`, T] { | ||
let currentTreeNode: Tree | null = tree | ||
console.log(maybePath) | ||
for (const segment of maybePath) { | ||
@@ -76,5 +77,11 @@ if (currentTreeNode === null) { | ||
} | ||
if (segment in currentTreeNode[1]) { | ||
currentTreeNode = currentTreeNode[1][segment] | ||
const subPaths = currentTreeNode[1] | ||
if (segment in subPaths) { | ||
currentTreeNode = subPaths[segment] | ||
} else { | ||
const wildcard = Object.keys(subPaths).find((key) => key.startsWith(`$`)) | ||
if (wildcard) { | ||
currentTreeNode = subPaths[wildcard] | ||
continue | ||
} | ||
return false | ||
@@ -81,0 +88,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9467
160