diff --git a/src/components/utils/sample.ts b/src/components/utils/sample.ts index dd83005..7a249a4 100644 --- a/src/components/utils/sample.ts +++ b/src/components/utils/sample.ts @@ -19,7 +19,7 @@ function sampleYaml(code: string, path: string): string { let traversal = yaml_code; - for (let i = 0; i < segments.length - 1; i++) { + for (let i = 0; i < segments.length; i++) { if (segments[i] != "$") { current[segments[i]] = {}; current = current[segments[i]]; @@ -125,4 +125,4 @@ function sampleProto(code: string, token1: string, token2: string) { throw new Error("Bad output"); } -export default sampleCode; \ No newline at end of file +export default sampleCode;