@needle-tools/gltf-build-pipeline 2.5.0-beta → 2.5.0-beta.1
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.
|
@@ -24,14 +24,27 @@ export function needle_asset() {
|
|
|
24
24
|
function writeNeedleExtras(extras) {
|
|
25
25
|
if (!extras)
|
|
26
26
|
extras = {};
|
|
27
|
-
if
|
|
27
|
+
// if the document doesnt have a needle property, add it
|
|
28
|
+
if (typeof extras === "object" && !extras.needle) {
|
|
28
29
|
let generator = generatorName;
|
|
29
30
|
const version = getVersion();
|
|
30
31
|
if (version?.length > 0)
|
|
31
32
|
generator += " " + version;
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const time = new Date().toISOString();
|
|
34
|
+
extras.needle = {
|
|
35
|
+
generator: generator,
|
|
36
|
+
created: time,
|
|
37
|
+
updated: time,
|
|
38
|
+
revision: 0,
|
|
34
39
|
};
|
|
35
40
|
}
|
|
41
|
+
// if this is the second time this function is called, we need to update the revision number
|
|
42
|
+
else {
|
|
43
|
+
const needle_Extras = extras["needle"];
|
|
44
|
+
if (needle_Extras) {
|
|
45
|
+
needle_Extras.updated = new Date().toISOString();
|
|
46
|
+
needle_Extras.revision = needle_Extras.revision + 1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
36
49
|
return extras;
|
|
37
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.5.0-beta",
|
|
3
|
+
"version": "2.5.0-beta.1",
|
|
4
4
|
"description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|