@rdfx/literal 0.0.19 → 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.
@@ -169,15 +169,13 @@ export var LiteralDecoder;
169
169
  }
170
170
  switch (literalDatatypeDefinition.kind) {
171
171
  case "bigdecimal":
172
- return Left(new LiteralDatatypeError(literal, "unable to decode bigdecimal Literal"));
172
+ case "date":
173
+ case "datetime":
174
+ return Left(new LiteralDatatypeError(literal, `unable to decode ${literalDatatypeDefinition.kind} Literal`));
173
175
  case "bigint":
174
176
  return decodeBigIntLiteralValue(literal);
175
177
  case "boolean":
176
178
  return decodeBooleanLiteralValue(literal);
177
- case "date":
178
- return decodeDateLiteralValue(literal);
179
- case "datetime":
180
- return decodeDateTimeLiteralValue(literal);
181
179
  case "float":
182
180
  return decodeFloatLiteralValue(literal);
183
181
  case "int":
@@ -178,12 +178,6 @@ export class LiteralFactory {
178
178
  return this.bigint(value, datatype);
179
179
  case "boolean":
180
180
  return this.boolean(value, datatype);
181
- case "object": {
182
- if (value instanceof Date) {
183
- return this.date(value, datatype);
184
- }
185
- throw new Error("not implemented");
186
- }
187
181
  case "number":
188
182
  return this.number(value, datatype);
189
183
  case "string":
@@ -1,2 +1,2 @@
1
- export type Primitive = bigint | boolean | Date | number | string;
1
+ export type Primitive = bigint | boolean | number | string;
2
2
  //# sourceMappingURL=Primitive.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./LiteralDecoder.js";
2
2
  export * from "./LiteralFactory.js";
3
3
  export * from "./literalDatatypeDefinitions.js";
4
+ export type * from "./Primitive.js";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -97,7 +97,8 @@ export const literalDatatypeDefinitions = {
97
97
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString": {
98
98
  kind: "string",
99
99
  },
100
- "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString": { kind: "string" },
100
+ // rdf:langString can't be encoded and decoded losslessly from a string.
101
+ // "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString": { kind: "string" },
101
102
  "http://www.w3.org/2001/XMLSchema#anyURI": { kind: "string" },
102
103
  "http://www.w3.org/2001/XMLSchema#base64Binary": { kind: "string" },
103
104
  "http://www.w3.org/2001/XMLSchema#duration": { kind: "string" },
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "purify-ts": "~2.1.4"
5
5
  },
6
6
  "devDependencies": {
7
- "@rdfx/data-factory": "0.0.19",
7
+ "@rdfx/data-factory": "0.0.21",
8
8
  "@tpluscode/rdf-ns-builders": "~4.3.0"
9
9
  },
10
10
  "files": [
@@ -30,5 +30,5 @@
30
30
  },
31
31
  "type": "module",
32
32
  "types": "./dist/index.d.ts",
33
- "version": "0.0.19"
33
+ "version": "0.0.21"
34
34
  }