@nsail/stack 0.1.909 → 0.1.921

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/strings.d.ts CHANGED
@@ -13,7 +13,8 @@ export declare class Strings {
13
13
  count(key: string, count: number): string;
14
14
  enumValue(type: EnumType, value: string | null | undefined): string;
15
15
  /** "Problems.{Code}.{Source}", then "Problems.{Code}", then the message the sender wrote; the
16
- * entity argument is a key and resolves to its label first. */
16
+ * entity argument is a key and resolves to its label first, the at argument
17
+ * (ISO 8601 UTC) to the reader's own date and time. */
17
18
  issue(issue: Issue): string;
18
19
  problem(problem: Problem): string;
19
20
  }
package/dist/strings.js CHANGED
@@ -44,7 +44,8 @@ export class Strings {
44
44
  return this.translate(`${type.key}.${value}`, value);
45
45
  }
46
46
  /** "Problems.{Code}.{Source}", then "Problems.{Code}", then the message the sender wrote; the
47
- * entity argument is a key and resolves to its label first. */
47
+ * entity argument is a key and resolves to its label first, the at argument
48
+ * (ISO 8601 UTC) to the reader's own date and time. */
48
49
  issue(issue) {
49
50
  const scoped = issue.source ? this.#entries[`Problems.${issue.code}.${issue.source}`] : undefined;
50
51
  const text = scoped ?? this.#entries[`Problems.${issue.code}`] ?? issue.message;
@@ -52,6 +53,9 @@ export class Strings {
52
53
  if (args?.entity) {
53
54
  args.entity = this.translate(args.entity, args.entity.slice(args.entity.lastIndexOf(".") + 1));
54
55
  }
56
+ if (args?.at && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ$/.test(args.at)) {
57
+ args.at = new Date(args.at).toLocaleString(this.language, { dateStyle: "short", timeStyle: "short" });
58
+ }
55
59
  return fill(text, args);
56
60
  }
57
61
  problem(problem) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsail/stack",
3
- "version": "0.1.909",
3
+ "version": "0.1.921",
4
4
  "description": "NSail's vendor-free client half: sends messages from the descriptors an Sdk generates, speaks the catalog, and holds the hooks a page reads with.",
5
5
  "license": "MIT",
6
6
  "repository": {