@yimingliao/cms 0.0.219 → 0.0.220

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.
@@ -1,5 +1,7 @@
1
- const toIsoTime = (date) => {
2
- if (!date) return void 0;
1
+ const toIsoTime = (input) => {
2
+ if (input == null) return void 0;
3
+ const date = typeof input === "string" ? new Date(input) : input;
4
+ if (isNaN(date.getTime())) return void 0;
3
5
  return date.toISOString();
4
6
  };
5
7
 
@@ -1,2 +1,2 @@
1
- export declare const toIsoTime: (date?: Date | null) => string | undefined;
1
+ export declare const toIsoTime: (input?: Date | string | null) => string | undefined;
2
2
  //# sourceMappingURL=to-iso-time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-iso-time.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/seo-metadata/utils/to-iso-time.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,OAAO,IAAI,GAAG,IAAI,KAAG,MAAM,GAAG,SAGvD,CAAC"}
1
+ {"version":3,"file":"to-iso-time.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/seo-metadata/utils/to-iso-time.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,QAAQ,IAAI,GAAG,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,SAQjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yimingliao/cms",
3
- "version": "0.0.219",
3
+ "version": "0.0.220",
4
4
  "author": "Yiming Liao",
5
5
  "license": "MIT",
6
6
  "type": "module",