@rdfx/resource 0.0.20 → 0.0.21

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.
@@ -0,0 +1,12 @@
1
+ import { MistypedValueError } from "./MistypedValueError.js";
2
+ import { PropertyPath } from "./PropertyPath.js";
3
+ import type { Resource } from "./Resource.js";
4
+ export declare class MistypedDateValueError extends MistypedValueError<Date> {
5
+ constructor({ actualValue, expectedValueType, focusResource, propertyPath, }: {
6
+ actualValue: Date;
7
+ expectedValueType: string;
8
+ focusResource: Resource;
9
+ propertyPath: PropertyPath;
10
+ });
11
+ }
12
+ //# sourceMappingURL=MistypedDateValueError.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { MistypedValueError } from "./MistypedValueError.js";
2
+ import { PropertyPath } from "./PropertyPath.js";
3
+ export class MistypedDateValueError extends MistypedValueError {
4
+ constructor({ actualValue, expectedValueType, focusResource, propertyPath, }) {
5
+ super({
6
+ actualValue,
7
+ expectedValueType,
8
+ focusResource,
9
+ message: `expected ${focusResource.identifier} ${PropertyPath.toString(propertyPath)} to be a ${expectedValueType}, was ${typeof actualValue}`,
10
+ propertyPath,
11
+ });
12
+ }
13
+ }
14
+ //# sourceMappingURL=MistypedDateValueError.js.map
@@ -1,5 +1,5 @@
1
+ import type { Primitive } from "@rdfx/literal";
1
2
  import { MistypedValueError } from "./MistypedValueError.js";
2
- import type { Primitive } from "./Primitive.js";
3
3
  import { PropertyPath } from "./PropertyPath.js";
4
4
  import type { Resource } from "./Resource.js";
5
5
  export declare class MistypedPrimitiveValueError extends MistypedValueError<Primitive> {
package/dist/Value.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { BlankNode, DataFactory, Literal, NamedNode, Quad_Graph, Variable } from "@rdfjs/types";
2
+ import { type Primitive } from "@rdfx/literal";
2
3
  import { Either } from "purify-ts";
3
4
  import type { Identifier } from "./Identifier.js";
4
- import type { Primitive } from "./Primitive.js";
5
5
  import type { PropertyPath } from "./PropertyPath.js";
6
6
  import { Resource } from "./Resource.js";
7
7
  import type { Term } from "./Term.js";
package/dist/Value.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { LiteralDecoder } from "@rdfx/literal";
2
2
  import { NTriplesTerm } from "@rdfx/string";
3
3
  import { Either, Left } from "purify-ts";
4
+ import { MistypedDateValueError } from "./MistypedDateValueError.js";
4
5
  import { MistypedPrimitiveValueError } from "./MistypedPrimitiveValueError.js";
5
6
  import { MistypedTermValueError } from "./MistypedTermValueError.js";
6
7
  import { Resource } from "./Resource.js";
@@ -151,7 +152,7 @@ export class Value {
151
152
  }
152
153
  constrainDate(value, in_) {
153
154
  if (in_ && !in_.some((check) => value.getTime() === check.getTime())) {
154
- return Left(new MistypedPrimitiveValueError({
155
+ return Left(new MistypedDateValueError({
155
156
  actualValue: value,
156
157
  expectedValueType: in_.map((_) => _.toISOString()).join(" | "),
157
158
  focusResource: this.focusResource,
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "dependencies": {
3
- "@rdfx/literal": "0.0.20",
4
- "@rdfx/string": "0.0.20",
3
+ "@rdfx/literal": "0.0.21",
4
+ "@rdfx/string": "0.0.21",
5
5
  "@rdfjs/term-set": "~2.0.3",
6
6
  "@rdfjs/types": "~2.0.1",
7
7
  "@types/rdfjs__term-set": "~2.0.9",
8
8
  "purify-ts": "~2.1.4"
9
9
  },
10
10
  "devDependencies": {
11
- "@rdfx/data-factory": "0.0.20",
11
+ "@rdfx/data-factory": "0.0.21",
12
12
  "@rdfjs/dataset": "~2.0.2",
13
13
  "@tpluscode/rdf-ns-builders": "~4.3.0",
14
14
  "@types/rdfjs__dataset": "~2.0.7",
@@ -40,5 +40,5 @@
40
40
  },
41
41
  "type": "module",
42
42
  "types": "./dist/index.d.ts",
43
- "version": "0.0.20"
43
+ "version": "0.0.21"
44
44
  }
@@ -1,2 +0,0 @@
1
- export type Primitive = bigint | boolean | Date | number | string;
2
- //# sourceMappingURL=Primitive.d.ts.map
package/dist/Primitive.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Primitive.js.map