@netlify/cache 1.3.0 → 1.4.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/main.cjs CHANGED
@@ -20,6 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/main.ts
21
21
  var main_exports = {};
22
22
  __export(main_exports, {
23
+ DAY: () => DAY,
24
+ HOUR: () => HOUR,
25
+ MINUTE: () => MINUTE,
26
+ WEEK: () => WEEK,
27
+ YEAR: () => YEAR,
23
28
  fetchWithCache: () => fetchWithCache,
24
29
  getCacheStatus: () => getCacheStatus,
25
30
  setCacheHeaders: () => setCacheHeaders
@@ -290,8 +295,20 @@ var fetchWithCache = async (request, optionsOrCacheSettings, cacheOptionsParam)
290
295
  }
291
296
  return fresh;
292
297
  };
298
+
299
+ // src/constants.ts
300
+ var MINUTE = 60;
301
+ var HOUR = 60 * MINUTE;
302
+ var DAY = 24 * HOUR;
303
+ var WEEK = 7 * DAY;
304
+ var YEAR = 365 * DAY;
293
305
  // Annotate the CommonJS export names for ESM import in node:
294
306
  0 && (module.exports = {
307
+ DAY,
308
+ HOUR,
309
+ MINUTE,
310
+ WEEK,
311
+ YEAR,
295
312
  fetchWithCache,
296
313
  getCacheStatus,
297
314
  setCacheHeaders
package/dist/main.d.cts CHANGED
@@ -153,4 +153,25 @@ type FetchWithCache = {
153
153
  */
154
154
  declare const fetchWithCache: FetchWithCache;
155
155
 
156
- export { fetchWithCache, getCacheStatus, setCacheHeaders };
156
+ /**
157
+ * Number of seconds in one minute.
158
+ */
159
+ declare const MINUTE = 60;
160
+ /**
161
+ * Number of seconds in one hour.
162
+ */
163
+ declare const HOUR: number;
164
+ /**
165
+ * Number of seconds in one day.
166
+ */
167
+ declare const DAY: number;
168
+ /**
169
+ * Number of seconds in one week.
170
+ */
171
+ declare const WEEK: number;
172
+ /**
173
+ * Number of seconds in one year.
174
+ */
175
+ declare const YEAR: number;
176
+
177
+ export { DAY, HOUR, MINUTE, WEEK, YEAR, fetchWithCache, getCacheStatus, setCacheHeaders };
package/dist/main.d.ts CHANGED
@@ -153,4 +153,25 @@ type FetchWithCache = {
153
153
  */
154
154
  declare const fetchWithCache: FetchWithCache;
155
155
 
156
- export { fetchWithCache, getCacheStatus, setCacheHeaders };
156
+ /**
157
+ * Number of seconds in one minute.
158
+ */
159
+ declare const MINUTE = 60;
160
+ /**
161
+ * Number of seconds in one hour.
162
+ */
163
+ declare const HOUR: number;
164
+ /**
165
+ * Number of seconds in one day.
166
+ */
167
+ declare const DAY: number;
168
+ /**
169
+ * Number of seconds in one week.
170
+ */
171
+ declare const WEEK: number;
172
+ /**
173
+ * Number of seconds in one year.
174
+ */
175
+ declare const YEAR: number;
176
+
177
+ export { DAY, HOUR, MINUTE, WEEK, YEAR, fetchWithCache, getCacheStatus, setCacheHeaders };
package/dist/main.js CHANGED
@@ -263,7 +263,19 @@ var fetchWithCache = async (request, optionsOrCacheSettings, cacheOptionsParam)
263
263
  }
264
264
  return fresh;
265
265
  };
266
+
267
+ // src/constants.ts
268
+ var MINUTE = 60;
269
+ var HOUR = 60 * MINUTE;
270
+ var DAY = 24 * HOUR;
271
+ var WEEK = 7 * DAY;
272
+ var YEAR = 365 * DAY;
266
273
  export {
274
+ DAY,
275
+ HOUR,
276
+ MINUTE,
277
+ WEEK,
278
+ YEAR,
267
279
  fetchWithCache,
268
280
  getCacheStatus,
269
281
  setCacheHeaders
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/cache",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "TypeScript utilities for interacting with the Netlify cache",
5
5
  "type": "module",
6
6
  "engines": {