sliftutils 1.7.73 → 1.7.74
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/index.d.ts
CHANGED
|
@@ -2161,6 +2161,8 @@ declare module "sliftutils/storage/IArchives" {
|
|
|
2161
2161
|
export type GetInfoConfig = {
|
|
2162
2162
|
/** Also report size-0 entries (tombstones - an empty file IS a missing file). Off by default, so a deleted key reports undefined, matching get. Synchronization-style callers pass this when they need a deletion's write time (e.g. to compare it against a write they are about to make). */
|
|
2163
2163
|
includeTombstones?: boolean;
|
|
2164
|
+
/** See GetConfig.noFallbacks: answer ONLY from the primary source (the one writes would target) instead of falling back across the redundant sources. */
|
|
2165
|
+
noFallbacks?: boolean;
|
|
2164
2166
|
};
|
|
2165
2167
|
export type ChangesAfterConfig = {
|
|
2166
2168
|
time: number;
|
package/package.json
CHANGED
package/storage/IArchives.d.ts
CHANGED
|
@@ -79,6 +79,8 @@ export type DelConfig = {
|
|
|
79
79
|
export type GetInfoConfig = {
|
|
80
80
|
/** Also report size-0 entries (tombstones - an empty file IS a missing file). Off by default, so a deleted key reports undefined, matching get. Synchronization-style callers pass this when they need a deletion's write time (e.g. to compare it against a write they are about to make). */
|
|
81
81
|
includeTombstones?: boolean;
|
|
82
|
+
/** See GetConfig.noFallbacks: answer ONLY from the primary source (the one writes would target) instead of falling back across the redundant sources. */
|
|
83
|
+
noFallbacks?: boolean;
|
|
82
84
|
};
|
|
83
85
|
export type ChangesAfterConfig = {
|
|
84
86
|
time: number;
|
package/storage/IArchives.ts
CHANGED
|
@@ -118,6 +118,8 @@ export type DelConfig = {
|
|
|
118
118
|
export type GetInfoConfig = {
|
|
119
119
|
/** Also report size-0 entries (tombstones - an empty file IS a missing file). Off by default, so a deleted key reports undefined, matching get. Synchronization-style callers pass this when they need a deletion's write time (e.g. to compare it against a write they are about to make). */
|
|
120
120
|
includeTombstones?: boolean;
|
|
121
|
+
/** See GetConfig.noFallbacks: answer ONLY from the primary source (the one writes would target) instead of falling back across the redundant sources. */
|
|
122
|
+
noFallbacks?: boolean;
|
|
121
123
|
};
|
|
122
124
|
|
|
123
125
|
export type ChangesAfterConfig = {
|
|
@@ -233,7 +235,7 @@ export async function copyArchiveFile(config: {
|
|
|
233
235
|
let size = config.size;
|
|
234
236
|
let writeTime = config.writeTime;
|
|
235
237
|
if (size === undefined || writeTime === undefined) {
|
|
236
|
-
let info = await from.getInfo(path);
|
|
238
|
+
let info = await from.getInfo(path, { noFallbacks: config.noFallbacks });
|
|
237
239
|
if (!info) return undefined;
|
|
238
240
|
size = info.size;
|
|
239
241
|
writeTime = info.writeTime;
|
|
@@ -618,7 +618,7 @@ export class ArchivesChain implements IArchives {
|
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
620
|
public async getInfo(fileName: string, config?: GetInfoConfig): Promise<{ writeTime: number; size: number; url: string } | undefined> {
|
|
621
|
-
return await this.request({ route: getRoute(fileName) }, async (archives, url) => {
|
|
621
|
+
return await this.request({ route: getRoute(fileName), noFallbacks: config?.noFallbacks }, async (archives, url) => {
|
|
622
622
|
let result = await archives.getInfo(fileName, config);
|
|
623
623
|
return result && { ...result, url } || undefined;
|
|
624
624
|
});
|