@nextcloud/files 3.4.0 → 3.4.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.
- package/dist/files/node.d.ts +7 -4
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -699,14 +699,12 @@ class Node {
|
|
|
699
699
|
if (this.readonlyAttributes.includes(prop)) {
|
|
700
700
|
return false;
|
|
701
701
|
}
|
|
702
|
-
this.updateMtime();
|
|
703
702
|
return Reflect.set(target, prop, value);
|
|
704
703
|
},
|
|
705
704
|
deleteProperty: (target, prop) => {
|
|
706
705
|
if (this.readonlyAttributes.includes(prop)) {
|
|
707
706
|
return false;
|
|
708
707
|
}
|
|
709
|
-
this.updateMtime();
|
|
710
708
|
return Reflect.deleteProperty(target, prop);
|
|
711
709
|
},
|
|
712
710
|
// TODO: This is deprecated and only needed for files v3
|
|
@@ -723,7 +721,6 @@ class Node {
|
|
|
723
721
|
this._data = { ...data, attributes: {} };
|
|
724
722
|
this._attributes = new Proxy(this._data.attributes, this.handler);
|
|
725
723
|
this.update(data.attributes ?? {});
|
|
726
|
-
this._data.mtime = data.mtime;
|
|
727
724
|
if (davService) {
|
|
728
725
|
this._knownDavService = davService;
|
|
729
726
|
}
|
|
@@ -788,12 +785,16 @@ class Node {
|
|
|
788
785
|
}
|
|
789
786
|
/**
|
|
790
787
|
* Get the file modification time
|
|
791
|
-
* There is no setter as the modification time is not meant to be changed manually.
|
|
792
|
-
* It will be automatically updated when the attributes are changed.
|
|
793
788
|
*/
|
|
794
789
|
get mtime() {
|
|
795
790
|
return this._data.mtime;
|
|
796
791
|
}
|
|
792
|
+
/**
|
|
793
|
+
* Set the file modification time
|
|
794
|
+
*/
|
|
795
|
+
set mtime(mtime) {
|
|
796
|
+
this._data.mtime = mtime;
|
|
797
|
+
}
|
|
797
798
|
/**
|
|
798
799
|
* Get the file creation time
|
|
799
800
|
* There is no setter as the creation time is not meant to be changed
|
|
@@ -925,7 +926,7 @@ class Node {
|
|
|
925
926
|
this.move(dirname(this.source) + "/" + basename2);
|
|
926
927
|
}
|
|
927
928
|
/**
|
|
928
|
-
* Update the mtime if exists
|
|
929
|
+
* Update the mtime if exists
|
|
929
930
|
*/
|
|
930
931
|
updateMtime() {
|
|
931
932
|
if (this._data.mtime) {
|
|
@@ -934,6 +935,7 @@ class Node {
|
|
|
934
935
|
}
|
|
935
936
|
/**
|
|
936
937
|
* Update the attributes of the node
|
|
938
|
+
* Warning, updating attributes will NOT automatically update the mtime.
|
|
937
939
|
*
|
|
938
940
|
* @param attributes The new attributes to update on the Node attributes
|
|
939
941
|
*/
|