sveltekit-data-plugin 1.4.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin.js +11 -7
- package/dist/plugin.mjs +11 -7
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -74,12 +74,10 @@
|
|
|
74
74
|
depth: depth + 1
|
|
75
75
|
});
|
|
76
76
|
return {
|
|
77
|
-
attributes
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
absolute: obj
|
|
82
|
-
}
|
|
77
|
+
...attributes,
|
|
78
|
+
_internal: {
|
|
79
|
+
id: path.basename(obj),
|
|
80
|
+
absolute: obj
|
|
83
81
|
},
|
|
84
82
|
body: data.body
|
|
85
83
|
};
|
|
@@ -137,7 +135,13 @@
|
|
|
137
135
|
relative: relativeFolder
|
|
138
136
|
});
|
|
139
137
|
return `
|
|
140
|
-
${Object.entries(
|
|
138
|
+
${Object.entries({
|
|
139
|
+
...attributes,
|
|
140
|
+
_internal: {
|
|
141
|
+
id: path.basename(id),
|
|
142
|
+
absolute: id
|
|
143
|
+
}
|
|
144
|
+
}).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
|
|
141
145
|
export const body = ${JSON.stringify(d.body)};`;
|
|
142
146
|
}
|
|
143
147
|
}
|
package/dist/plugin.mjs
CHANGED
|
@@ -73,12 +73,10 @@ async function convert(opts, obj, { base, relative, depth = 1 } = {}) {
|
|
|
73
73
|
depth: depth + 1
|
|
74
74
|
});
|
|
75
75
|
return {
|
|
76
|
-
attributes
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
absolute: obj
|
|
81
|
-
}
|
|
76
|
+
...attributes,
|
|
77
|
+
_internal: {
|
|
78
|
+
id: path.basename(obj),
|
|
79
|
+
absolute: obj
|
|
82
80
|
},
|
|
83
81
|
body: data.body
|
|
84
82
|
};
|
|
@@ -136,7 +134,13 @@ function importDataPlugin(imagetools_plugin, { base = "./src/data" } = {}) {
|
|
|
136
134
|
relative: relativeFolder
|
|
137
135
|
});
|
|
138
136
|
return `
|
|
139
|
-
${Object.entries(
|
|
137
|
+
${Object.entries({
|
|
138
|
+
...attributes,
|
|
139
|
+
_internal: {
|
|
140
|
+
id: path.basename(id),
|
|
141
|
+
absolute: id
|
|
142
|
+
}
|
|
143
|
+
}).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
|
|
140
144
|
export const body = ${JSON.stringify(d.body)};`;
|
|
141
145
|
}
|
|
142
146
|
}
|