@photostructure/fs-metadata 0.1.4 → 0.1.5

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.
Files changed (268) hide show
  1. package/dist/index.cjs +1318 -0
  2. package/dist/index.mjs +1270 -0
  3. package/dist/types/array.d.ts +0 -1
  4. package/dist/types/async.d.ts +0 -1
  5. package/dist/types/cache.d.ts +0 -1
  6. package/dist/types/debuglog.d.ts +0 -1
  7. package/dist/types/defer.d.ts +0 -1
  8. package/dist/types/error.d.ts +0 -1
  9. package/dist/types/exports.d.ts +0 -1
  10. package/dist/types/fs.d.ts +0 -1
  11. package/dist/types/glob.d.ts +0 -1
  12. package/dist/types/hidden.d.ts +0 -1
  13. package/dist/types/index.d.ts +0 -1
  14. package/dist/types/linux/dev_disk.d.ts +0 -1
  15. package/dist/types/linux/mount_points.d.ts +0 -1
  16. package/dist/types/linux/mtab.d.ts +0 -1
  17. package/dist/types/mount_point.d.ts +0 -1
  18. package/dist/types/number.d.ts +0 -1
  19. package/dist/types/object.d.ts +0 -1
  20. package/dist/types/options.d.ts +0 -1
  21. package/dist/types/path.d.ts +0 -1
  22. package/dist/types/platform.d.ts +0 -1
  23. package/dist/types/random.d.ts +0 -1
  24. package/dist/types/remote_info.d.ts +0 -1
  25. package/dist/types/setup.d.ts +0 -1
  26. package/dist/types/string.d.ts +0 -1
  27. package/dist/types/string_enum.d.ts +0 -1
  28. package/dist/types/system_volume.d.ts +0 -1
  29. package/dist/types/types/native_bindings.d.ts +0 -1
  30. package/dist/types/unc.d.ts +0 -1
  31. package/dist/types/units.d.ts +0 -1
  32. package/dist/types/uuid.d.ts +0 -1
  33. package/dist/types/volume_health_status.d.ts +0 -1
  34. package/dist/types/volume_metadata.d.ts +0 -1
  35. package/jest.config.cjs +33 -0
  36. package/package.json +26 -36
  37. package/prebuilds/darwin-arm64/@photostructure+fs-metadata.glibc.node +0 -0
  38. package/prebuilds/linux-arm64/@photostructure+fs-metadata.musl.node +0 -0
  39. package/prebuilds/linux-x64/@photostructure+fs-metadata.glibc.node +0 -0
  40. package/prebuilds/linux-x64/@photostructure+fs-metadata.musl.node +0 -0
  41. package/prebuilds/win32-x64/@photostructure+fs-metadata.glibc.node +0 -0
  42. package/src/darwin/volume_metadata.cpp +26 -12
  43. package/src/linux/volume_metadata.cpp +21 -4
  44. package/dist/cjs/array.cjs +0 -57
  45. package/dist/cjs/array.js.map +0 -1
  46. package/dist/cjs/async.cjs +0 -116
  47. package/dist/cjs/async.js.map +0 -1
  48. package/dist/cjs/cache.cjs +0 -28
  49. package/dist/cjs/cache.js.map +0 -1
  50. package/dist/cjs/debuglog.cjs +0 -35
  51. package/dist/cjs/debuglog.js.map +0 -1
  52. package/dist/cjs/defer.cjs +0 -26
  53. package/dist/cjs/defer.js.map +0 -1
  54. package/dist/cjs/error.cjs +0 -63
  55. package/dist/cjs/error.js.map +0 -1
  56. package/dist/cjs/exports.cjs +0 -14
  57. package/dist/cjs/exports.js.map +0 -1
  58. package/dist/cjs/fs.cjs +0 -81
  59. package/dist/cjs/fs.js.map +0 -1
  60. package/dist/cjs/glob.cjs +0 -117
  61. package/dist/cjs/glob.js.map +0 -1
  62. package/dist/cjs/hidden.cjs +0 -163
  63. package/dist/cjs/hidden.js.map +0 -1
  64. package/dist/cjs/index.cjs +0 -23
  65. package/dist/cjs/index.cjs.map +0 -1
  66. package/dist/cjs/linux/dev_disk.cjs +0 -66
  67. package/dist/cjs/linux/dev_disk.js.map +0 -1
  68. package/dist/cjs/linux/mount_points.cjs +0 -81
  69. package/dist/cjs/linux/mount_points.js.map +0 -1
  70. package/dist/cjs/linux/mtab.cjs +0 -88
  71. package/dist/cjs/linux/mtab.js.map +0 -1
  72. package/dist/cjs/mount_point.cjs +0 -67
  73. package/dist/cjs/mount_point.js.map +0 -1
  74. package/dist/cjs/number.cjs +0 -41
  75. package/dist/cjs/number.js.map +0 -1
  76. package/dist/cjs/object.cjs +0 -59
  77. package/dist/cjs/object.js.map +0 -1
  78. package/dist/cjs/options.cjs +0 -115
  79. package/dist/cjs/options.js.map +0 -1
  80. package/dist/cjs/path.cjs +0 -50
  81. package/dist/cjs/path.js.map +0 -1
  82. package/dist/cjs/platform.cjs +0 -10
  83. package/dist/cjs/platform.js.map +0 -1
  84. package/dist/cjs/random.cjs +0 -43
  85. package/dist/cjs/random.js.map +0 -1
  86. package/dist/cjs/remote_info.cjs +0 -123
  87. package/dist/cjs/remote_info.js.map +0 -1
  88. package/dist/cjs/setup.cjs +0 -47
  89. package/dist/cjs/setup.js.map +0 -1
  90. package/dist/cjs/string.cjs +0 -89
  91. package/dist/cjs/string.js.map +0 -1
  92. package/dist/cjs/string_enum.cjs +0 -27
  93. package/dist/cjs/string_enum.js.map +0 -1
  94. package/dist/cjs/system_volume.cjs +0 -44
  95. package/dist/cjs/system_volume.js.map +0 -1
  96. package/dist/cjs/types/native_bindings.cjs +0 -4
  97. package/dist/cjs/types/native_bindings.js.map +0 -1
  98. package/dist/cjs/unc.cjs +0 -52
  99. package/dist/cjs/unc.js.map +0 -1
  100. package/dist/cjs/units.cjs +0 -35
  101. package/dist/cjs/units.js.map +0 -1
  102. package/dist/cjs/uuid.cjs +0 -25
  103. package/dist/cjs/uuid.js.map +0 -1
  104. package/dist/cjs/volume_health_status.cjs +0 -50
  105. package/dist/cjs/volume_health_status.js.map +0 -1
  106. package/dist/cjs/volume_metadata.cjs +0 -169
  107. package/dist/cjs/volume_metadata.js.map +0 -1
  108. package/dist/esm/array.js +0 -50
  109. package/dist/esm/array.js.map +0 -1
  110. package/dist/esm/async.js +0 -109
  111. package/dist/esm/async.js.map +0 -1
  112. package/dist/esm/cache.js +0 -25
  113. package/dist/esm/cache.js.map +0 -1
  114. package/dist/esm/debuglog.js +0 -30
  115. package/dist/esm/debuglog.js.map +0 -1
  116. package/dist/esm/defer.js +0 -23
  117. package/dist/esm/defer.js.map +0 -1
  118. package/dist/esm/error.js +0 -58
  119. package/dist/esm/error.js.map +0 -1
  120. package/dist/esm/exports.js +0 -4
  121. package/dist/esm/exports.js.map +0 -1
  122. package/dist/esm/fs.js +0 -73
  123. package/dist/esm/fs.js.map +0 -1
  124. package/dist/esm/glob.js +0 -113
  125. package/dist/esm/glob.js.map +0 -1
  126. package/dist/esm/hidden.js +0 -155
  127. package/dist/esm/hidden.js.map +0 -1
  128. package/dist/esm/index.js +0 -7
  129. package/dist/esm/index.js.map +0 -1
  130. package/dist/esm/linux/dev_disk.js +0 -61
  131. package/dist/esm/linux/dev_disk.js.map +0 -1
  132. package/dist/esm/linux/mount_points.js +0 -77
  133. package/dist/esm/linux/mount_points.js.map +0 -1
  134. package/dist/esm/linux/mtab.js +0 -82
  135. package/dist/esm/linux/mtab.js.map +0 -1
  136. package/dist/esm/mount_point.js +0 -63
  137. package/dist/esm/mount_point.js.map +0 -1
  138. package/dist/esm/number.js +0 -32
  139. package/dist/esm/number.js.map +0 -1
  140. package/dist/esm/object.js +0 -52
  141. package/dist/esm/object.js.map +0 -1
  142. package/dist/esm/options.js +0 -111
  143. package/dist/esm/options.js.map +0 -1
  144. package/dist/esm/path.js +0 -44
  145. package/dist/esm/path.js.map +0 -1
  146. package/dist/esm/platform.js +0 -7
  147. package/dist/esm/platform.js.map +0 -1
  148. package/dist/esm/random.js +0 -37
  149. package/dist/esm/random.js.map +0 -1
  150. package/dist/esm/remote_info.js +0 -116
  151. package/dist/esm/remote_info.js.map +0 -1
  152. package/dist/esm/setup.js +0 -41
  153. package/dist/esm/setup.js.map +0 -1
  154. package/dist/esm/string.js +0 -78
  155. package/dist/esm/string.js.map +0 -1
  156. package/dist/esm/string_enum.js +0 -24
  157. package/dist/esm/string_enum.js.map +0 -1
  158. package/dist/esm/system_volume.js +0 -40
  159. package/dist/esm/system_volume.js.map +0 -1
  160. package/dist/esm/types/native_bindings.js +0 -3
  161. package/dist/esm/types/native_bindings.js.map +0 -1
  162. package/dist/esm/unc.js +0 -49
  163. package/dist/esm/unc.js.map +0 -1
  164. package/dist/esm/units.js +0 -31
  165. package/dist/esm/units.js.map +0 -1
  166. package/dist/esm/uuid.js +0 -22
  167. package/dist/esm/uuid.js.map +0 -1
  168. package/dist/esm/volume_health_status.js +0 -46
  169. package/dist/esm/volume_health_status.js.map +0 -1
  170. package/dist/esm/volume_metadata.js +0 -164
  171. package/dist/esm/volume_metadata.js.map +0 -1
  172. package/dist/types/array.d.ts.map +0 -1
  173. package/dist/types/array.js +0 -50
  174. package/dist/types/array.js.map +0 -1
  175. package/dist/types/async.d.ts.map +0 -1
  176. package/dist/types/async.js +0 -109
  177. package/dist/types/async.js.map +0 -1
  178. package/dist/types/cache.d.ts.map +0 -1
  179. package/dist/types/cache.js +0 -25
  180. package/dist/types/cache.js.map +0 -1
  181. package/dist/types/debuglog.d.ts.map +0 -1
  182. package/dist/types/debuglog.js +0 -30
  183. package/dist/types/debuglog.js.map +0 -1
  184. package/dist/types/defer.d.ts.map +0 -1
  185. package/dist/types/defer.js +0 -23
  186. package/dist/types/defer.js.map +0 -1
  187. package/dist/types/error.d.ts.map +0 -1
  188. package/dist/types/error.js +0 -58
  189. package/dist/types/error.js.map +0 -1
  190. package/dist/types/exports.d.ts.map +0 -1
  191. package/dist/types/exports.js +0 -4
  192. package/dist/types/exports.js.map +0 -1
  193. package/dist/types/fs.d.ts.map +0 -1
  194. package/dist/types/fs.js +0 -73
  195. package/dist/types/fs.js.map +0 -1
  196. package/dist/types/glob.d.ts.map +0 -1
  197. package/dist/types/glob.js +0 -113
  198. package/dist/types/glob.js.map +0 -1
  199. package/dist/types/hidden.d.ts.map +0 -1
  200. package/dist/types/hidden.js +0 -155
  201. package/dist/types/hidden.js.map +0 -1
  202. package/dist/types/index.d.ts.map +0 -1
  203. package/dist/types/index.js +0 -7
  204. package/dist/types/index.js.map +0 -1
  205. package/dist/types/linux/dev_disk.d.ts.map +0 -1
  206. package/dist/types/linux/dev_disk.js +0 -61
  207. package/dist/types/linux/dev_disk.js.map +0 -1
  208. package/dist/types/linux/mount_points.d.ts.map +0 -1
  209. package/dist/types/linux/mount_points.js +0 -77
  210. package/dist/types/linux/mount_points.js.map +0 -1
  211. package/dist/types/linux/mtab.d.ts.map +0 -1
  212. package/dist/types/linux/mtab.js +0 -82
  213. package/dist/types/linux/mtab.js.map +0 -1
  214. package/dist/types/mount_point.d.ts.map +0 -1
  215. package/dist/types/mount_point.js +0 -63
  216. package/dist/types/mount_point.js.map +0 -1
  217. package/dist/types/number.d.ts.map +0 -1
  218. package/dist/types/number.js +0 -32
  219. package/dist/types/number.js.map +0 -1
  220. package/dist/types/object.d.ts.map +0 -1
  221. package/dist/types/object.js +0 -52
  222. package/dist/types/object.js.map +0 -1
  223. package/dist/types/options.d.ts.map +0 -1
  224. package/dist/types/options.js +0 -111
  225. package/dist/types/options.js.map +0 -1
  226. package/dist/types/path.d.ts.map +0 -1
  227. package/dist/types/path.js +0 -44
  228. package/dist/types/path.js.map +0 -1
  229. package/dist/types/platform.d.ts.map +0 -1
  230. package/dist/types/platform.js +0 -7
  231. package/dist/types/platform.js.map +0 -1
  232. package/dist/types/random.d.ts.map +0 -1
  233. package/dist/types/random.js +0 -37
  234. package/dist/types/random.js.map +0 -1
  235. package/dist/types/remote_info.d.ts.map +0 -1
  236. package/dist/types/remote_info.js +0 -116
  237. package/dist/types/remote_info.js.map +0 -1
  238. package/dist/types/setup.d.ts.map +0 -1
  239. package/dist/types/setup.js +0 -41
  240. package/dist/types/setup.js.map +0 -1
  241. package/dist/types/string.d.ts.map +0 -1
  242. package/dist/types/string.js +0 -78
  243. package/dist/types/string.js.map +0 -1
  244. package/dist/types/string_enum.d.ts.map +0 -1
  245. package/dist/types/string_enum.js +0 -24
  246. package/dist/types/string_enum.js.map +0 -1
  247. package/dist/types/system_volume.d.ts.map +0 -1
  248. package/dist/types/system_volume.js +0 -40
  249. package/dist/types/system_volume.js.map +0 -1
  250. package/dist/types/types/native_bindings.d.ts.map +0 -1
  251. package/dist/types/types/native_bindings.js +0 -3
  252. package/dist/types/types/native_bindings.js.map +0 -1
  253. package/dist/types/unc.d.ts.map +0 -1
  254. package/dist/types/unc.js +0 -49
  255. package/dist/types/unc.js.map +0 -1
  256. package/dist/types/units.d.ts.map +0 -1
  257. package/dist/types/units.js +0 -31
  258. package/dist/types/units.js.map +0 -1
  259. package/dist/types/uuid.d.ts.map +0 -1
  260. package/dist/types/uuid.js +0 -22
  261. package/dist/types/uuid.js.map +0 -1
  262. package/dist/types/volume_health_status.d.ts.map +0 -1
  263. package/dist/types/volume_health_status.js +0 -46
  264. package/dist/types/volume_health_status.js.map +0 -1
  265. package/dist/types/volume_metadata.d.ts.map +0 -1
  266. package/dist/types/volume_metadata.js +0 -164
  267. package/dist/types/volume_metadata.js.map +0 -1
  268. package/scripts/fix-cjs.mjs +0 -35
@@ -28,4 +28,3 @@ export declare function times<T>(length: number, fn: (index: number) => T): T[];
28
28
  * @return a new array with elements that are not `null` or `undefined`.
29
29
  */
30
30
  export declare function compact<T>(arr: (T | null | undefined)[] | undefined): T[];
31
- //# sourceMappingURL=array.d.ts.map
@@ -40,4 +40,3 @@ export declare function mapConcurrent<I, O>({ items, fn, maxConcurrency, }: {
40
40
  fn: (t: I) => Promise<O>;
41
41
  maxConcurrency?: number;
42
42
  }): Promise<(O | Error)[]>;
43
- //# sourceMappingURL=async.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Cache the result of a function for a given time-to-live (TTL).
3
3
  */
4
4
  export declare function ttlCache<Args extends unknown[], R>(fn: (...args: Args) => R, ttl: number): (...args: Args) => R;
5
- //# sourceMappingURL=cache.d.ts.map
@@ -6,4 +6,3 @@ export declare const isDebugEnabled: (() => boolean) & {
6
6
  };
7
7
  export declare function debug(msg: string, ...args: unknown[]): void;
8
8
  export declare function resetDebugLog(): void;
9
- //# sourceMappingURL=debuglog.d.ts.map
@@ -9,4 +9,3 @@ type Defer<T> = (() => T) & {
9
9
  */
10
10
  export declare function defer<T>(thunk: () => T): Defer<T>;
11
11
  export {};
12
- //# sourceMappingURL=defer.d.ts.map
@@ -15,4 +15,3 @@ export declare class WrappedError extends Error {
15
15
  toString(): string;
16
16
  }
17
17
  export declare function toError(cause: unknown): Error;
18
- //# sourceMappingURL=error.d.ts.map
@@ -96,4 +96,3 @@ export type ExportedFunctions = {
96
96
  setHidden: typeof setHidden;
97
97
  };
98
98
  export { IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, OptionsDefault, optionsWithDefaults, SystemFsTypesDefault, SystemPathPatternsDefault, TimeoutMsDefault, VolumeHealthStatuses, };
99
- //# sourceMappingURL=exports.d.ts.map
@@ -20,4 +20,3 @@ export declare function existsSync(path: string): boolean;
20
20
  * @throws {Error} if `dir` does not exist or is not a directory or cannot be read.
21
21
  */
22
22
  export declare function canReaddir(dir: string, timeoutMs: number): Promise<true>;
23
- //# sourceMappingURL=fs.d.ts.map
@@ -15,4 +15,3 @@
15
15
  export declare function compileGlob(patterns: string[] | readonly string[] | undefined): RegExp;
16
16
  export declare const AlwaysMatchRE: RegExp;
17
17
  export declare const NeverMatchRE: RegExp;
18
- //# sourceMappingURL=glob.d.ts.map
@@ -64,4 +64,3 @@ export type SetHiddenResult = {
64
64
  };
65
65
  };
66
66
  export declare function setHidden(pathname: string, hide: boolean, method: HideMethod, nativeFn: NativeBindingsFn): Promise<SetHiddenResult>;
67
- //# sourceMappingURL=hidden.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export * from "./exports.js";
2
2
  export declare const getVolumeMountPoints: typeof import("./exports.js").getVolumeMountPoints, getVolumeMetadata: typeof import("./exports.js").getVolumeMetadata, getAllVolumeMetadata: typeof import("./exports.js").getAllVolumeMetadata, isHidden: typeof import("./exports.js").isHidden, isHiddenRecursive: typeof import("./exports.js").isHiddenRecursive, getHiddenMetadata: typeof import("./exports.js").getHiddenMetadata, setHidden: typeof import("./exports.js").setHidden;
3
- //# sourceMappingURL=index.d.ts.map
@@ -11,4 +11,3 @@ export declare function getUuidFromDevDisk(devicePath: string): Promise<string |
11
11
  */
12
12
  export declare function getLabelFromDevDisk(devicePath: string): Promise<string | undefined>;
13
13
  export declare function getBasenameLinkedTo(linkDir: string, linkPath: string): Promise<string | undefined>;
14
- //# sourceMappingURL=dev_disk.d.ts.map
@@ -4,4 +4,3 @@ import type { NativeBindingsFn } from "../types/native_bindings.js";
4
4
  import { MountEntry } from "./mtab.js";
5
5
  export declare function getLinuxMountPoints(native: NativeBindingsFn, opts?: Pick<Options, "linuxMountTablePaths">): Promise<MountPoint[]>;
6
6
  export declare function getLinuxMtabMetadata(mountPoint: string, opts?: Pick<Options, "linuxMountTablePaths">): Promise<MountEntry>;
7
- //# sourceMappingURL=mount_points.d.ts.map
@@ -45,4 +45,3 @@ export declare function parseMtab(content: string): MountEntry[];
45
45
  * @returns Formatted mtab file content
46
46
  */
47
47
  export declare function formatMtab(entries: MountEntry[]): string;
48
- //# sourceMappingURL=mtab.d.ts.map
@@ -53,4 +53,3 @@ export type GetVolumeMountPointOptions = Partial<Pick<Options, "timeoutMs" | "li
53
53
  * Helper function for {@link getVolumeMountPoints}.
54
54
  */
55
55
  export declare function getVolumeMountPoints(opts: Required<GetVolumeMountPointOptions>, nativeFn: NativeBindingsFn): Promise<MountPoint[]>;
56
- //# sourceMappingURL=mount_point.d.ts.map
@@ -5,4 +5,3 @@ export declare function gte0(value: unknown): value is number;
5
5
  export declare function toGt0(value: unknown): number | undefined;
6
6
  export declare function toGte0(value: unknown): number | undefined;
7
7
  export declare function lte(a: number | undefined, b: number | undefined): boolean;
8
- //# sourceMappingURL=number.d.ts.map
@@ -15,4 +15,3 @@ export declare function omit<T extends object, K extends keyof T>(obj: T, ...key
15
15
  */
16
16
  export declare function pick<T extends object, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K>;
17
17
  export declare function compactValues<T extends object>(obj: T | undefined): Partial<T>;
18
- //# sourceMappingURL=object.d.ts.map
@@ -77,4 +77,3 @@ export declare const OptionsDefault: Options;
77
77
  * {@link OptionsDefault} for missing fields.
78
78
  */
79
79
  export declare function optionsWithDefaults<T extends Options>(overrides?: Partial<T>): T;
80
- //# sourceMappingURL=options.d.ts.map
@@ -15,4 +15,3 @@ export declare function normalizeWindowsPath(mountPoint: string): string;
15
15
  * directory is a drive letter followed by a colon, e.g. "C:\".
16
16
  */
17
17
  export declare function isRootDirectory(path: string): boolean;
18
- //# sourceMappingURL=path.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare const isLinux: boolean;
2
2
  export declare const isWindows: boolean;
3
3
  export declare const isMacOS: boolean;
4
- //# sourceMappingURL=platform.d.ts.map
@@ -10,4 +10,3 @@ export declare function randomLetters(length: number): string;
10
10
  */
11
11
  export declare function shuffle<T>(a: T[]): T[];
12
12
  export declare function pickRandom<T>(a: T[]): T;
13
- //# sourceMappingURL=random.d.ts.map
@@ -36,4 +36,3 @@ export declare function normalizeProtocol(protocol: string): string;
36
36
  export declare function isRemoteFsType(fstype: string | undefined): boolean;
37
37
  export declare function parseURL(s: string): URL | undefined;
38
38
  export declare function extractRemoteInfo(fsSpec: string | undefined): RemoteInfo | undefined;
39
- //# sourceMappingURL=remote_info.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ExportedFunctions } from "./exports.js";
2
2
  export declare function setup(dirname: string): ExportedFunctions;
3
- //# sourceMappingURL=setup.d.ts.map
@@ -35,4 +35,3 @@ export declare function sortByLocale(arr: string[], locales?: Intl.LocalesArgume
35
35
  * @param options The collation options to use for sorting.
36
36
  */
37
37
  export declare function sortObjectsByLocale<T>(arr: T[], fn: (key: T) => string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): T[];
38
- //# sourceMappingURL=string.d.ts.map
@@ -17,4 +17,3 @@ export type Direction = StringEnumKeys<typeof Directions>
17
17
 
18
18
  */
19
19
  export declare function stringEnum<T extends string>(...o: T[]): StringEnum<T>;
20
- //# sourceMappingURL=string_enum.d.ts.map
@@ -12,4 +12,3 @@ export type SystemVolumeConfig = Pick<Options, "systemPathPatterns" | "systemFsT
12
12
  */
13
13
  export declare function isSystemVolume(mountPoint: string, fstype: string | undefined, config?: Partial<SystemVolumeConfig>): boolean;
14
14
  export declare function assignSystemVolume(mp: MountPoint, config: Partial<SystemVolumeConfig>): void;
15
- //# sourceMappingURL=system_volume.d.ts.map
@@ -49,4 +49,3 @@ export type GetVolumeMetadataOptions = {
49
49
  device?: string;
50
50
  } & Partial<Pick<Options, "timeoutMs">>;
51
51
  export type NativeBindingsFn = () => NativeBindings | Promise<NativeBindings>;
52
- //# sourceMappingURL=native_bindings.d.ts.map
@@ -9,4 +9,3 @@ import { RemoteInfo } from "./remote_info.js";
9
9
  * @returns boolean - True if the string is a valid UNC path, false otherwise
10
10
  */
11
11
  export declare function parseUNCPath(path: string | null | undefined): RemoteInfo | undefined;
12
- //# sourceMappingURL=unc.d.ts.map
@@ -14,4 +14,3 @@ export declare const MiB: number;
14
14
  */
15
15
  export declare const GiB: number;
16
16
  export declare function fmtBytes(bytes: number): string;
17
- //# sourceMappingURL=units.d.ts.map
@@ -14,4 +14,3 @@
14
14
  * (case-insensitive).
15
15
  */
16
16
  export declare function extractUUID(uuid: string | undefined): string | undefined;
17
- //# sourceMappingURL=uuid.d.ts.map
@@ -22,4 +22,3 @@ export declare function directoryStatus(dir: string, timeoutMs: number, canReadd
22
22
  status: VolumeHealthStatus;
23
23
  error?: Error;
24
24
  }>;
25
- //# sourceMappingURL=volume_health_status.d.ts.map
@@ -52,4 +52,3 @@ export declare function getAllVolumeMetadata(opts: Required<Options> & {
52
52
  maxConcurrency?: number;
53
53
  }, nativeFn: NativeBindingsFn): Promise<VolumeMetadata[]>;
54
54
  export declare const _: undefined;
55
- //# sourceMappingURL=volume_metadata.d.ts.map
@@ -0,0 +1,33 @@
1
+ // @ts-check
2
+
3
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
4
+
5
+ const config = {
6
+ displayName: "@photostructure/fs-metadata (CJS)",
7
+ testEnvironment: "jest-environment-node",
8
+ roots: ["<rootDir>/src"],
9
+ coverageProvider: "v8",
10
+ moduleNameMapper: {
11
+ "^(\\.{1,2}/.*)\\.js$": "$1",
12
+ },
13
+ transform: {
14
+ "^.+\\.(c)?ts$": [
15
+ "ts-jest",
16
+ {
17
+ useESM: false,
18
+ tsconfig: "tsconfig.jest-cjs.json",
19
+ },
20
+ ],
21
+ },
22
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
23
+ collectCoverage: false,
24
+ verbose: true,
25
+ silent: false,
26
+ randomize: true,
27
+ setupFilesAfterEnv: [
28
+ "jest-extended/all",
29
+ "<rootDir>/src/test-utils/jest-matchers.ts",
30
+ ],
31
+ };
32
+
33
+ module.exports = config;
package/package.json CHANGED
@@ -1,21 +1,11 @@
1
1
  {
2
2
  "name": "@photostructure/fs-metadata",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Cross-platform native filesystem metadata retrieval for Node.js",
5
5
  "homepage": "https://photostructure.github.io/fs-metadata/",
6
- "type": "module",
7
- "// exports": "https://nodejs.org/api/packages.html#conditional-exports",
8
6
  "types": "./dist/types/index.d.ts",
9
- "main": "./dist/cjs/index.cjs",
10
- "module": "./dist/esm/index.js",
11
- "exports": {
12
- ".": {
13
- "types": "./dist/types/index.d.ts",
14
- "require": "./dist/cjs/index.cjs",
15
- "import": "./dist/esm/index.js",
16
- "default": "./dist/esm/index.js"
17
- }
18
- },
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.mjs",
19
9
  "repository": {
20
10
  "type": "git",
21
11
  "url": "git+ssh://git@github.com/photostructure/fs-metadata.git"
@@ -28,28 +18,29 @@
28
18
  "clean:gyp-cache": "del-cli build %USERPROFILE%/.node-gyp ~/.node-gyp",
29
19
  "clean:gyp": "node-gyp clean",
30
20
  "node-gyp-rebuild": "node-gyp rebuild",
31
- "// scripts/configure.js checks if gio is installed": "",
32
21
  "configure": "node scripts/configure.mjs",
33
22
  "prebuildify": "prebuildify --napi --tag-libc --strip",
34
- "// prebuild": "is called by .github/workflows/build.yml",
35
23
  "prebuild": "run-s configure prebuildify",
36
- "prep": "run-s clean prebuild tsc",
37
- "tsc": "run-p tsc:*",
38
- "tsc:esm": "tsc -p tsconfig.esm.json",
39
- "tsc:types": "tsc -p tsconfig.types.json",
40
- "tsc:cjs": "tsc -p tsconfig.cjs.json",
41
- "posttsc:cjs": "node scripts/fix-cjs.mjs",
42
- "tsc:tests": "tsc -p tsconfig.json",
43
- "watch": "tsc --watch --project tsconfig.watch.json",
24
+ "compile": "run-p compile:*",
25
+ "compile:esm": "tsc -p tsconfig.esm.json --noEmit",
26
+ "compile:cjs": "tsc -p tsconfig.cjs.json --noEmit",
27
+ "compile:types": "tsc -p tsconfig.types.json",
28
+ "postcompile:types": "mv dist/types/index.d.mts dist/types/index.d.ts",
29
+ "watch": "tsc --watch",
30
+ "bundle": "run-p bundle:* compile:types",
31
+ "bundle:cjs": "tsup src/index.cts --format cjs --tsconfig tsconfig.cjs.json",
32
+ "bundle:esm": "tsup src/index.mts --format esm --tsconfig tsconfig.esm.json",
44
33
  "docs": "typedoc --out docs src/index.ts",
45
34
  "jest:coverage": "jest --coverage",
46
35
  "jest:watch": "npm t -- --watch",
47
36
  "jest:clear": "jest --clearCache",
48
- "// tests": "is called by .github/workflows/test.yml",
49
- "tests": "run-s lint test test:memory",
50
- "test": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js --coverage",
37
+ "// tests": "`compile` validates the typescript compiles with tsc. `lint` checks for style issues. `bundle` uses tsup to emit the CJS and ESM rollups that the integration tests depend on. `test:*` runs the tests.",
38
+ "tests": "run-s compile lint bundle test:*",
39
+ "test": "npm run test:cjs",
40
+ "test:cjs": "jest --config jest.config.cjs",
41
+ "test:esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js --config jest.config.mjs",
51
42
  "// test:memory:todo": "set up valgrind or similar",
52
- "test:memory": "cross-env TEST_MEMORY=1 node --expose-gc --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js --no-coverage src/memory.test.ts",
43
+ "test:memory": "cross-env TEST_MEMORY=1 node --expose-gc --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js --config jest.config.mjs --no-coverage src/memory.test.ts",
53
44
  "lint": "eslint",
54
45
  "lint:fix": "eslint --fix",
55
46
  "fmt": "run-p fmt:*",
@@ -58,11 +49,9 @@
58
49
  "fmt:js": "prettier --write \"scripts/**/*.?js\" \"*.?js\"",
59
50
  "fmt:json": "prettier --write \"**/*.json\"",
60
51
  "fmt:pkg": "npm pkg fix",
61
- "fmt:ts": "prettier --write \"src/**/*.ts\"",
62
- "// precommit": "is called manually before committing",
63
- "precommit": "run-s fmt prep tests",
64
- "// release": "is called by .github/workflows/release.yml and should only be run via GitHub Actions",
65
- "prerelease": "tsc",
52
+ "fmt:ts": "prettier --write \"**/*.(c|m)?ts\"",
53
+ "precommit": "run-s fmt clean prebuild tests",
54
+ "prepare-release": "npm run bundle",
66
55
  "release": "release-it"
67
56
  },
68
57
  "gypfile": true,
@@ -105,19 +94,20 @@
105
94
  "del-cli": "^6.0.0",
106
95
  "eslint": "^9.17.0",
107
96
  "globals": "^15.14.0",
108
- "jest": "^29.7.0",
109
97
  "jest-environment-node": "^29.7.0",
110
98
  "jest-extended": "^4.0.2",
99
+ "jest": "^29.7.0",
111
100
  "node-gyp": "^11.0.0",
112
101
  "npm-run-all": "4.1.5",
113
102
  "prebuildify": "^6.0.1",
114
- "prettier": "^3.4.2",
115
103
  "prettier-plugin-organize-imports": "4.1.0",
104
+ "prettier": "^3.4.2",
116
105
  "release-it": "^17.10.0",
117
106
  "terser": "^5.37.0",
118
107
  "ts-jest": "^29.2.5",
108
+ "tsup": "^8.3.5",
119
109
  "typedoc": "^0.27.5",
120
- "typescript": "^5.7.2",
121
- "typescript-eslint": "^8.18.1"
110
+ "typescript-eslint": "^8.18.1",
111
+ "typescript": "^5.7.2"
122
112
  }
123
113
  }
@@ -131,28 +131,42 @@ private:
131
131
 
132
132
  // Calculate sizes using uint64_t to prevent overflow
133
133
  const uint64_t blockSize = vfs.f_frsize ? vfs.f_frsize : vfs.f_bsize;
134
- const uint64_t totalBlocks = vfs.f_blocks;
135
- const uint64_t availBlocks = vfs.f_bavail;
136
- const uint64_t freeBlocks = vfs.f_bfree;
134
+ const uint64_t totalBlocks = static_cast<uint64_t>(vfs.f_blocks);
135
+ const uint64_t availBlocks = static_cast<uint64_t>(vfs.f_bavail);
136
+ const uint64_t freeBlocks = static_cast<uint64_t>(vfs.f_bfree);
137
137
 
138
138
  // Check for overflow before multiplication
139
- if (blockSize > 0 &&
140
- totalBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
141
- SetError("Volume size calculation would overflow");
142
- return false;
139
+ if (blockSize > 0) {
140
+ if (totalBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
141
+ SetError("Total volume size calculation would overflow");
142
+ return false;
143
+ }
144
+ if (availBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
145
+ SetError("Available space calculation would overflow");
146
+ return false;
147
+ }
148
+ if (freeBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
149
+ SetError("Free space calculation would overflow");
150
+ return false;
151
+ }
143
152
  }
144
153
 
145
- metadata.size = static_cast<double>(blockSize * totalBlocks);
146
- metadata.available = static_cast<double>(blockSize * availBlocks);
147
- metadata.used = static_cast<double>(blockSize * (totalBlocks - freeBlocks));
154
+ const uint64_t totalSize = blockSize * totalBlocks;
155
+ const uint64_t availableSize = blockSize * availBlocks;
156
+ const uint64_t usedSize = blockSize * (totalBlocks - freeBlocks);
157
+
158
+ // Convert to double for JavaScript compatibility
159
+ metadata.size = static_cast<double>(totalSize);
160
+ metadata.available = static_cast<double>(availableSize);
161
+ metadata.used = static_cast<double>(usedSize);
148
162
 
149
163
  metadata.fstype = fs.f_fstypename;
150
164
  metadata.mountFrom = fs.f_mntfromname;
151
165
  metadata.mountName = fs.f_mntonname;
152
166
  metadata.status = "ready";
153
167
 
154
- DEBUG_LOG("[GetVolumeMetadataWorker] Volume info - size: %f, available: "
155
- "%f, used: %f",
168
+ DEBUG_LOG("[GetVolumeMetadataWorker] Volume info - size: %.0f, available: "
169
+ "%.0f, used: %.0f",
156
170
  metadata.size, metadata.available, metadata.used);
157
171
  return true;
158
172
  }
@@ -29,12 +29,29 @@ public:
29
29
  throw FSException(CreateErrorMessage("statvfs", errno));
30
30
  }
31
31
 
32
- uint64_t blockSize = vfs.f_frsize ? vfs.f_frsize : vfs.f_bsize;
32
+ const uint64_t blockSize = vfs.f_frsize ? vfs.f_frsize : vfs.f_bsize;
33
+ const uint64_t totalBlocks = static_cast<uint64_t>(vfs.f_blocks);
34
+ const uint64_t availBlocks = static_cast<uint64_t>(vfs.f_bavail);
35
+ const uint64_t freeBlocks = static_cast<uint64_t>(vfs.f_bfree);
36
+
37
+ // Check for overflow before multiplication
38
+ if (blockSize > 0) {
39
+ if (totalBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
40
+ throw FSException("Total volume size calculation would overflow");
41
+ }
42
+ if (availBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
43
+ throw FSException("Available space calculation would overflow");
44
+ }
45
+ if (freeBlocks > std::numeric_limits<uint64_t>::max() / blockSize) {
46
+ throw FSException("Free space calculation would overflow");
47
+ }
48
+ }
49
+
33
50
  metadata.remote = false;
34
- metadata.size = static_cast<double>(blockSize) * vfs.f_blocks;
35
- metadata.available = static_cast<double>(blockSize) * vfs.f_bavail;
51
+ metadata.size = static_cast<double>(blockSize * totalBlocks);
52
+ metadata.available = static_cast<double>(blockSize * availBlocks);
36
53
  metadata.used =
37
- metadata.size - (static_cast<double>(blockSize) * vfs.f_bfree);
54
+ static_cast<double>(blockSize * (totalBlocks - freeBlocks));
38
55
 
39
56
  DEBUG_LOG("[LinuxMetadataWorker] %s {size: %.3f GB, available: %.3f GB}",
40
57
  mountPoint.c_str(), metadata.size / 1e9,
@@ -1,57 +0,0 @@
1
- "use strict";
2
- // src/array.ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.asyncFilter = asyncFilter;
5
- exports.uniq = uniq;
6
- exports.uniqBy = uniqBy;
7
- exports.times = times;
8
- exports.compact = compact;
9
- /**
10
- * @return a new array whose elements return true based on the given `predicate`
11
- * function.
12
- */
13
- async function asyncFilter(arr, predicate) {
14
- const results = await Promise.all(arr.map(async (ea) => predicate(ea)));
15
- return arr.filter((_item, index) => results[index]);
16
- }
17
- /**
18
- * Remove duplicate elements from an array.
19
- *
20
- * - Primitive values are compared using strict equality.
21
- * - Objects and arrays are compared by reference.
22
- *
23
- * @return A new array with duplicate elements removed
24
- */
25
- function uniq(arr) {
26
- return Array.from(new Set(arr));
27
- }
28
- /**
29
- * Remove duplicate elements from an array based on a key function.
30
- * @param keyFn A function that returns a key for each element. Elements that
31
- * the key function returns nullish will be removed from the returned array.
32
- * @return a new array omitting duplicate elements based on a key function.
33
- */
34
- function uniqBy(arr, keyFn) {
35
- const seen = new Set();
36
- return arr.filter((item) => {
37
- const key = keyFn(item);
38
- if (key == null || seen.has(key))
39
- return false;
40
- seen.add(key);
41
- return true;
42
- });
43
- }
44
- /**
45
- * @return an array of specified length, with each element created by calling
46
- * the provided function.
47
- */
48
- function times(length, fn) {
49
- return Array.from({ length }, (_, i) => fn(i));
50
- }
51
- /**
52
- * @return a new array with elements that are not `null` or `undefined`.
53
- */
54
- function compact(arr) {
55
- return arr == null ? [] : arr.filter((ea) => ea != null);
56
- }
57
- //# sourceMappingURL=array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/array.ts"],"names":[],"mappings":";AAAA,eAAe;;AAMf,kCAMC;AAUD,oBAEC;AAQD,wBAQC;AAMD,sBAEC;AAKD,0BAEC;AArDD;;;GAGG;AACI,KAAK,UAAU,WAAW,CAC/B,GAAQ,EACR,SAAkD;IAElD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxE,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,IAAI,CAAI,GAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,MAAM,CAAO,GAAQ,EAAE,KAAiC;IACtE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAK,CAAC;IAC1B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAI,MAAc,EAAE,EAAwB;IAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAI,GAAyC;IAClE,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,EAAW,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC;AACpE,CAAC"}
@@ -1,116 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimeoutError = void 0;
4
- exports.withTimeout = withTimeout;
5
- exports.delay = delay;
6
- exports.mapConcurrent = mapConcurrent;
7
- const node_os_1 = require("node:os");
8
- const node_process_1 = require("node:process");
9
- const number_js_1 = require("./number.cjs");
10
- const string_js_1 = require("./string.cjs");
11
- /**
12
- * An error that is thrown when a promise does not resolve within the specified
13
- * time.
14
- */
15
- class TimeoutError extends Error {
16
- constructor(message, captureStackTrace = true) {
17
- super(message);
18
- this.name = "TimeoutError";
19
- // Capture the stack trace up to the calling site
20
- if (captureStackTrace && Error.captureStackTrace) {
21
- Error.captureStackTrace(this, this.constructor);
22
- }
23
- }
24
- }
25
- exports.TimeoutError = TimeoutError;
26
- /**
27
- * Rejects the promise with a TimeoutError if it does not resolve within the
28
- * specified time.
29
- *
30
- * @param promise The promise to wrap.
31
- * @param timeoutMs The timeout in milliseconds. Timeouts are disabled if this is 0.
32
- * @returns A promise that resolves when the input promise resolves, or rejects
33
- * with a TimeoutError if the input promise does not resolve within the
34
- * specified time.
35
- * @throws {TimeoutError} if the input promise does not resolve within the
36
- * specified time.
37
- * @throws {TypeError} if timeoutMs is not a number that is greater than 0.
38
- */
39
- async function withTimeout(opts) {
40
- const desc = (0, string_js_1.isBlank)(opts.desc) ? "thenOrTimeout()" : opts.desc;
41
- if (!(0, number_js_1.isNumber)(opts.timeoutMs)) {
42
- throw new TypeError(desc +
43
- ": Expected timeoutMs to be numeric, but got " +
44
- JSON.stringify(opts.timeoutMs));
45
- }
46
- const timeoutMs = Math.floor(opts.timeoutMs);
47
- if (timeoutMs < 0) {
48
- throw new TypeError(desc + ": Expected timeoutMs to be > 0, but got " + timeoutMs);
49
- }
50
- if (timeoutMs === 0) {
51
- return opts.promise;
52
- }
53
- // Create error here to captured the caller's stack trace. If we create it in
54
- // the timeout callback, the stack trace will be truncated to this function.
55
- const timeoutError = new TimeoutError(`${desc}: timeout after ${timeoutMs}ms`);
56
- if (node_process_1.env["NODE_ENV"] === "test" && timeoutMs === 1) {
57
- timeoutError.message += "(timeout test)";
58
- opts.promise.catch(() => { }); // < avoid unhandled rejection warnings
59
- throw timeoutError;
60
- }
61
- let timeoutId;
62
- opts.promise
63
- .catch(() => { }) // < avoid unhandled rejection warnings
64
- .finally(() => {
65
- if (timeoutId != null) {
66
- clearTimeout(timeoutId);
67
- timeoutId = undefined;
68
- }
69
- });
70
- const timeoutPromise = new Promise((_, reject) => {
71
- timeoutId = setTimeout(() => {
72
- if (timeoutId != null) {
73
- timeoutError.message += "(timeout callback)";
74
- reject(timeoutError);
75
- }
76
- timeoutId = undefined;
77
- }, timeoutMs);
78
- });
79
- return Promise.race([opts.promise, timeoutPromise]);
80
- }
81
- /**
82
- * Delay for the specified number of milliseconds.
83
- *
84
- * @param ms The number of milliseconds to delay
85
- * @param t Optional value to resolve with after delay
86
- * @returns Promise that resolves with the provided value (or void if none provided)
87
- */
88
- async function delay(ms, t) {
89
- return new Promise((resolve) => setTimeout(() => resolve(t), ms));
90
- }
91
- /**
92
- * Apply `fn` to every item in `items` with a maximum concurrency of
93
- * `maxConcurrency`.
94
- */
95
- async function mapConcurrent({ items, fn, maxConcurrency = (0, node_os_1.availableParallelism)(), }) {
96
- // Validate maxConcurrency
97
- if (!(0, number_js_1.gt0)(maxConcurrency)) {
98
- throw new Error(`maxConcurrency must be a positive integer, got: ${maxConcurrency}`);
99
- }
100
- if (typeof fn !== "function") {
101
- throw new TypeError(`fn must be a function, got: ${typeof fn}`);
102
- }
103
- const results = [];
104
- const executing = new Set();
105
- for (const [index, item] of items.entries()) {
106
- // Create a wrapped promise that handles cleanup
107
- while (executing.size >= maxConcurrency) {
108
- await Promise.race(executing);
109
- }
110
- const p = (results[index] = fn(item).catch((error) => error));
111
- executing.add(p);
112
- p.finally(() => executing.delete(p));
113
- }
114
- return Promise.all(results);
115
- }
116
- //# sourceMappingURL=async.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/async.ts"],"names":[],"mappings":";;;AAgCA,kCA6DC;AASD,sBAEC;AAMD,sCAkCC;AAhJD,qCAA+C;AAC/C,+CAAmC;AACnC,2CAA4C;AAC5C,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