Skip to content

Commit c32e754

Browse files
committed
chore: 🤖 lint
1 parent 0816b2c commit c32e754

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

‎src/autoProcess.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,19 @@ export function sveltePreprocess(
130130
const [propPath, value] = SOURCE_MAP_PROP_MAP[name];
131131
const pathParts = propPath.split('.');
132132
let parentObj = opts;
133-
let i;
134-
for (i = 0; i < pathParts.length - 1; i++) {
133+
134+
for (let i = 0; i < pathParts.length - 1; i++) {
135135
const propName = pathParts[i];
136-
if (typeof parentObj[propName] !== 'object') parentObj[propName] = {};
136+
137+
if (typeof parentObj[propName] !== 'object') {
138+
parentObj[propName] = {};
139+
}
140+
137141
parentObj = parentObj[propName];
138142
}
139-
const propName = pathParts[i];
143+
144+
const propName = pathParts[pathParts.length - 1];
145+
140146
parentObj[propName] = value;
141147
}
142148

‎test/autoProcess/sourceMaps.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,16 @@ describe(`sourcemap generation`, () => {
8888
const expectedOptions = {};
8989
const pathParts = propPath.split('.');
9090
let parentObj = expectedOptions;
91-
let i;
92-
for (i = 0; i < pathParts.length - 1; i++) {
91+
92+
for (let i = 0; i < pathParts.length - 1; i++) {
9393
const propName = pathParts[i];
94+
9495
parentObj[propName] = {};
9596
parentObj = parentObj[propName];
9697
}
97-
const propName = pathParts[i];
98+
99+
const propName = pathParts[pathParts.length - 1];
100+
98101
parentObj[propName] = value;
99102

100103
await preprocess(template, opts);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy