@shaclmate/compiler 4.0.34 → 4.0.36
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/generators/ts/AbstractCollectionType.d.ts +2 -1
- package/dist/generators/ts/AbstractCollectionType.js +14 -13
- package/dist/generators/ts/AbstractContainerType.d.ts +2 -0
- package/dist/generators/ts/AbstractContainerType.js +20 -0
- package/dist/generators/ts/AbstractDateType.d.ts +1 -1
- package/dist/generators/ts/AbstractDateType.js +3 -3
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +1 -0
- package/dist/generators/ts/AbstractLazyObjectType.js +1 -0
- package/dist/generators/ts/AbstractLiteralType.d.ts +1 -1
- package/dist/generators/ts/AbstractLiteralType.js +2 -2
- package/dist/generators/ts/AbstractNamedUnionType.js +33 -20
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -8
- package/dist/generators/ts/AbstractNumericType.js +2 -16
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -0
- package/dist/generators/ts/AbstractPrimitiveType.js +2 -1
- package/dist/generators/ts/AbstractTermType.d.ts +2 -1
- package/dist/generators/ts/AbstractTermType.js +3 -2
- package/dist/generators/ts/AbstractType.d.ts +19 -8
- package/dist/generators/ts/AbstractUnionType.d.ts +3 -2
- package/dist/generators/ts/AbstractUnionType.js +14 -13
- package/dist/generators/ts/BigDecimalType.d.ts +3 -2
- package/dist/generators/ts/BigDecimalType.js +5 -12
- package/dist/generators/ts/BigIntType.js +1 -1
- package/dist/generators/ts/BlankNodeType.d.ts +3 -2
- package/dist/generators/ts/BlankNodeType.js +6 -5
- package/dist/generators/ts/BooleanType.d.ts +1 -2
- package/dist/generators/ts/BooleanType.js +2 -16
- package/dist/generators/ts/DateTimeType.d.ts +0 -1
- package/dist/generators/ts/DateTimeType.js +0 -9
- package/dist/generators/ts/DateType.d.ts +0 -1
- package/dist/generators/ts/DateType.js +0 -9
- package/dist/generators/ts/DefaultValueType.d.ts +2 -1
- package/dist/generators/ts/DefaultValueType.js +5 -4
- package/dist/generators/ts/IdentifierType.d.ts +3 -2
- package/dist/generators/ts/IdentifierType.js +6 -5
- package/dist/generators/ts/IriType.d.ts +3 -11
- package/dist/generators/ts/IriType.js +6 -5
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +3 -3
- package/dist/generators/ts/LazyObjectSetType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectSetType.js +3 -3
- package/dist/generators/ts/LazyObjectType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectType.js +3 -3
- package/dist/generators/ts/LiteralType.d.ts +2 -1
- package/dist/generators/ts/LiteralType.js +4 -3
- package/dist/generators/ts/NamedObjectType.d.ts +2 -1
- package/dist/generators/ts/NamedObjectType.js +9 -16
- package/dist/generators/ts/NamedObjectUnionType.js +14 -5
- package/dist/generators/ts/OptionType.d.ts +4 -3
- package/dist/generators/ts/OptionType.js +20 -17
- package/dist/generators/ts/Snippets.d.ts +7 -11
- package/dist/generators/ts/Snippets.js +46 -74
- package/dist/generators/ts/StringType.d.ts +1 -2
- package/dist/generators/ts/StringType.js +2 -16
- package/dist/generators/ts/TermType.d.ts +2 -1
- package/dist/generators/ts/TermType.js +6 -16
- package/dist/generators/ts/TsFeature.d.ts +1 -1
- package/dist/generators/ts/TsFeature.js +25 -7
- package/dist/generators/ts/TsGenerator.d.ts +1 -1
- package/dist/generators/ts/TsGenerator.js +66 -8
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +2 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js +6 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.js +6 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +30 -9
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +6 -6
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +6 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +2 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +6 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js +3 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +26 -4
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +12 -6
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.js +2 -2
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.js +2 -2
- package/dist/generators/ts/_snippets/snippets_convertToIri.js +2 -2
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.js +3 -3
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.js +4 -4
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.js +13 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.js +7 -0
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +1 -1
- package/dist/generators/ts/objectSetDeclarations.js +7 -10
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +0 -6
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +0 -6
- package/dist/input/generated.d.ts +8 -8
- package/dist/input/generated.js +188 -191
- package/package.json +2 -2
- package/dist/generators/ts/_snippets/snippets_convertToBigDecimal.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToBigDecimal.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToBoolean.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToBoolean.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToDate.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToDate.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToDateTime.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToDateTime.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToMutableArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToMutableArray.js +0 -14
- package/dist/generators/ts/_snippets/snippets_convertToNumeric.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToNumeric.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToObject.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToReadonlyArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToReadonlyArray.js +0 -14
- package/dist/generators/ts/_snippets/snippets_convertToString.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToString.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToTerm.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToTerm.js +0 -6
- package/dist/generators/ts/_snippets/snippets_convertToUnion.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToUnion.js +0 -6
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.d.ts +0 -12
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.js +0 -21
|
@@ -6,11 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { NodeKind } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { xsd } from "@tpluscode/rdf-ns-builders";
|
|
9
|
+
import { Maybe } from "purify-ts";
|
|
9
10
|
import { invariant } from "ts-invariant";
|
|
10
11
|
import { Memoize } from "typescript-memoize";
|
|
11
12
|
import { AbstractTermType } from "./AbstractTermType.js";
|
|
12
13
|
import { code, joinCode } from "./ts-poet-wrapper.js";
|
|
13
14
|
export class TermType extends AbstractTermType {
|
|
15
|
+
conversionFunction = Maybe.empty();
|
|
14
16
|
filterFunction = code `${this.reusables.snippets.filterTerm}`;
|
|
15
17
|
filterType = code `${this.reusables.snippets.TermFilter}`;
|
|
16
18
|
kind = "TermType";
|
|
@@ -23,17 +25,6 @@ export class TermType extends AbstractTermType {
|
|
|
23
25
|
invariant(this.nodeKinds.has("Literal") &&
|
|
24
26
|
(this.nodeKinds.has("BlankNode") || this.nodeKinds.has("IRI")), "should be IdentifierType or LiteralType");
|
|
25
27
|
}
|
|
26
|
-
get conversionFunction() {
|
|
27
|
-
return {
|
|
28
|
-
code: code `${this.reusables.snippets.convertToTerm}<${this.name}>`,
|
|
29
|
-
sourceTypes: [
|
|
30
|
-
{
|
|
31
|
-
name: this.name,
|
|
32
|
-
typeof: "object",
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
28
|
get graphqlType() {
|
|
38
29
|
throw new Error("not implemented");
|
|
39
30
|
}
|
|
@@ -55,7 +46,9 @@ export class TermType extends AbstractTermType {
|
|
|
55
46
|
.map((import_) => code `${import_}`), { on: " | " })})`;
|
|
56
47
|
}
|
|
57
48
|
fromJsonExpression({ variables, }) {
|
|
58
|
-
return
|
|
49
|
+
return code `${this.reusables.imports.Either}.of<Error, ${this.name}>(${[
|
|
50
|
+
...this.nodeKinds,
|
|
51
|
+
].reduce((expression, nodeKind) => {
|
|
59
52
|
let valueToNodeKind;
|
|
60
53
|
switch (nodeKind) {
|
|
61
54
|
case "BlankNode":
|
|
@@ -73,7 +66,7 @@ export class TermType extends AbstractTermType {
|
|
|
73
66
|
return expression == null
|
|
74
67
|
? valueToNodeKind
|
|
75
68
|
: code `((${variables.value}.termType === "${NodeKind.toTermType(nodeKind)}") ? (${valueToNodeKind}) : (${expression}))`;
|
|
76
|
-
}, null)
|
|
69
|
+
}, null)})`;
|
|
77
70
|
}
|
|
78
71
|
graphqlResolveExpression(_parameters) {
|
|
79
72
|
throw new Error("not implemented");
|
|
@@ -119,9 +112,6 @@ export class TermType extends AbstractTermType {
|
|
|
119
112
|
}, null);
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
|
-
__decorate([
|
|
123
|
-
Memoize()
|
|
124
|
-
], TermType.prototype, "conversionFunction", null);
|
|
125
115
|
__decorate([
|
|
126
116
|
Memoize()
|
|
127
117
|
], TermType.prototype, "name", null);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type TsFeature = (typeof TS_FEATURES)[number];
|
|
2
|
-
export declare const TS_FEATURES: readonly ["create", "equals", "
|
|
2
|
+
export declare const TS_FEATURES: readonly ["GraphQL", "JSON", "Object.create", "Object.equals", "Object.filter", "Object.fromJson", "Object.fromRdf", "Object.hash", "Object.JSON", "Object.JSON.type", "Object.JSON.parse", "Object.JSON.schema", "Object.JSON.uiSchema", "Object.RDF", "Object.schema", "Object.SPARQL", "Object.toJson", "Object.toRdf", "Object.toString", "Object.type", "ObjectSet", "RDF", "RdfjsDatasetObjectSet", "SPARQL", "SparqlObjectSet"];
|
|
3
3
|
//# sourceMappingURL=TsFeature.d.ts.map
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
export const TS_FEATURES = [
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
2
|
+
"GraphQL",
|
|
3
|
+
"JSON",
|
|
4
|
+
"Object.create",
|
|
5
|
+
"Object.equals",
|
|
6
|
+
"Object.filter",
|
|
7
|
+
"Object.fromJson",
|
|
8
|
+
"Object.fromRdf",
|
|
9
|
+
"Object.hash",
|
|
10
|
+
"Object.JSON",
|
|
11
|
+
"Object.JSON.type",
|
|
12
|
+
"Object.JSON.parse",
|
|
13
|
+
"Object.JSON.schema",
|
|
14
|
+
"Object.JSON.uiSchema",
|
|
15
|
+
"Object.RDF",
|
|
16
|
+
"Object.schema",
|
|
17
|
+
"Object.SPARQL",
|
|
18
|
+
"Object.toJson",
|
|
19
|
+
"Object.toRdf",
|
|
20
|
+
"Object.toString",
|
|
21
|
+
"Object.type",
|
|
22
|
+
"ObjectSet",
|
|
23
|
+
"RDF",
|
|
24
|
+
"RdfjsDatasetObjectSet",
|
|
25
|
+
"SPARQL",
|
|
26
|
+
"SparqlObjectSet",
|
|
9
27
|
];
|
|
10
28
|
//# sourceMappingURL=TsFeature.js.map
|
|
@@ -24,8 +24,8 @@ export declare namespace TsGenerator {
|
|
|
24
24
|
readonly syntheticNamePrefix: string;
|
|
25
25
|
}
|
|
26
26
|
namespace Configuration {
|
|
27
|
+
function inferFeatures(features: ReadonlySet<TsFeature>): Set<"JSON" | "GraphQL" | "Object.create" | "Object.equals" | "Object.filter" | "Object.fromJson" | "Object.fromRdf" | "Object.hash" | "Object.JSON" | "Object.JSON.type" | "Object.JSON.parse" | "Object.JSON.schema" | "Object.JSON.uiSchema" | "Object.RDF" | "Object.schema" | "Object.SPARQL" | "Object.toJson" | "Object.toRdf" | "Object.toString" | "Object.type" | "ObjectSet" | "RDF" | "RdfjsDatasetObjectSet" | "SPARQL" | "SparqlObjectSet">;
|
|
27
28
|
const default_: Configuration;
|
|
28
|
-
function inferFeatures(features: ReadonlySet<TsFeature>): Set<"equals" | "create" | "graphql" | "hash" | "json" | "rdf" | "sparql">;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=TsGenerator.d.ts.map
|
|
@@ -150,21 +150,79 @@ export class TsGenerator {
|
|
|
150
150
|
(function (TsGenerator) {
|
|
151
151
|
let Configuration;
|
|
152
152
|
(function (Configuration) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
const featureDependencies = {
|
|
154
|
+
GraphQL: ["ObjectSet"],
|
|
155
|
+
// Alias for other features, not dependencies per se
|
|
156
|
+
JSON: ["Object.JSON"],
|
|
157
|
+
"Object.create": ["Object.schema", "Object.toString", "Object.type"],
|
|
158
|
+
"Object.equals": ["Object.type"],
|
|
159
|
+
"Object.filter": ["Object.type"],
|
|
160
|
+
"Object.fromJson": [
|
|
161
|
+
"Object.create",
|
|
162
|
+
"Object.JSON.type",
|
|
163
|
+
"Object.type",
|
|
164
|
+
"ObjectSet",
|
|
165
|
+
],
|
|
166
|
+
"Object.fromRdf": [
|
|
167
|
+
"Object.create",
|
|
168
|
+
"Object.schema",
|
|
169
|
+
"ObjectSet",
|
|
170
|
+
"RdfjsDatasetObjectSet",
|
|
171
|
+
],
|
|
172
|
+
"Object.hash": [],
|
|
173
|
+
// Alias for other features, not dependencies per se
|
|
174
|
+
"Object.JSON": [
|
|
175
|
+
"Object.fromJson",
|
|
176
|
+
"Object.JSON.parse",
|
|
177
|
+
"Object.JSON.schema",
|
|
178
|
+
"Object.JSON.type",
|
|
179
|
+
"Object.JSON.uiSchema",
|
|
180
|
+
"Object.toJson",
|
|
181
|
+
],
|
|
182
|
+
"Object.JSON.parse": ["Object.JSON.schema", "Object.JSON.type"],
|
|
183
|
+
"Object.JSON.type": [],
|
|
184
|
+
"Object.JSON.schema": ["Object.JSON.type"],
|
|
185
|
+
"Object.JSON.uiSchema": [],
|
|
186
|
+
// Alias for other features, not dependencies per se
|
|
187
|
+
"Object.RDF": ["Object.fromRdf", "Object.toRdf"],
|
|
188
|
+
"Object.schema": [],
|
|
189
|
+
"Object.toJson": ["Object.JSON.type", "Object.type"],
|
|
190
|
+
"Object.toRdf": ["Object.schema", "Object.type"],
|
|
191
|
+
"Object.toString": ["Object.type"],
|
|
192
|
+
"Object.SPARQL": ["Object.schema"],
|
|
193
|
+
"Object.type": [], // Implies Object.Identifier
|
|
194
|
+
ObjectSet: ["Object.filter"],
|
|
195
|
+
// Alias for other features, not dependencies per se
|
|
196
|
+
RDF: ["Object.RDF", "RdfjsDatasetObjectSet"],
|
|
197
|
+
RdfjsDatasetObjectSet: ["Object.fromRdf", "ObjectSet"],
|
|
198
|
+
SPARQL: ["Object.SPARQL", "SparqlObjectSet"],
|
|
199
|
+
SparqlObjectSet: ["Object.SPARQL", "ObjectSet"],
|
|
156
200
|
};
|
|
157
201
|
function inferFeatures(features) {
|
|
158
202
|
const inferredFeatures = new Set(features);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
203
|
+
const queue = [...features];
|
|
204
|
+
while (queue.length > 0) {
|
|
205
|
+
const feature = queue.shift();
|
|
206
|
+
for (const featureDependency of featureDependencies[feature]) {
|
|
207
|
+
if (!inferredFeatures.has(featureDependency)) {
|
|
208
|
+
inferredFeatures.add(featureDependency);
|
|
209
|
+
queue.push(featureDependency);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
164
212
|
}
|
|
165
213
|
return inferredFeatures;
|
|
166
214
|
}
|
|
167
215
|
Configuration.inferFeatures = inferFeatures;
|
|
216
|
+
Configuration.default_ = {
|
|
217
|
+
features: inferFeatures(new Set([
|
|
218
|
+
"Object.create",
|
|
219
|
+
"Object.equals",
|
|
220
|
+
"Object.hash",
|
|
221
|
+
"JSON",
|
|
222
|
+
"RDF",
|
|
223
|
+
])),
|
|
224
|
+
syntheticNamePrefix: "$",
|
|
225
|
+
};
|
|
168
226
|
})(Configuration = TsGenerator.Configuration || (TsGenerator.Configuration = {}));
|
|
169
227
|
})(TsGenerator || (TsGenerator = {}));
|
|
170
228
|
//# sourceMappingURL=TsGenerator.js.map
|
|
@@ -23,7 +23,8 @@ export class IdentifierProperty extends AbstractProperty {
|
|
|
23
23
|
get constructorParameter() {
|
|
24
24
|
let hasQuestionToken = false;
|
|
25
25
|
const typeNames = [code `(() => ${this.typeAlias})`];
|
|
26
|
-
for (const type of this.type.conversionFunction.
|
|
26
|
+
for (const type of this.type.conversionFunction.unsafeCoerce()
|
|
27
|
+
.sourceTypes) {
|
|
27
28
|
if (type.typeof === "undefined") {
|
|
28
29
|
hasQuestionToken = true;
|
|
29
30
|
}
|
|
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
|
|
|
2
2
|
import { invariant } from "ts-invariant";
|
|
3
3
|
import { code, joinCode, literalOf } from "../ts-poet-wrapper.js";
|
|
4
4
|
export function NamedObjectType_createFunctionDeclaration() {
|
|
5
|
-
if (!this.configuration.features.has("create")) {
|
|
5
|
+
if (!this.configuration.features.has("Object.create")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
8
8
|
const parametersPropertySignatures = this.properties.flatMap((property) => property.constructorParameter.toList());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_equalsFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("equals")) {
|
|
4
|
+
if (!this.configuration.features.has("Object.equals")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
const chain = [];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
3
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_filterFunctionDeclaration(this: NamedObjectType): Code
|
|
4
|
+
export declare function NamedObjectType_filterFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
4
5
|
//# sourceMappingURL=NamedObjectType_filterFunctionDeclaration.d.ts.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
3
|
export function NamedObjectType_filterFunctionDeclaration() {
|
|
4
|
+
if (!this.configuration.features.has("Object.filter")) {
|
|
5
|
+
return Maybe.empty();
|
|
6
|
+
}
|
|
3
7
|
const statements = [];
|
|
4
8
|
for (const parentObjectType of this.parentObjectTypes) {
|
|
5
9
|
statements.push(code `if (!${parentObjectType.filterFunction}(filter, value)) { return false; }`);
|
|
@@ -12,9 +16,9 @@ export function NamedObjectType_filterFunctionDeclaration() {
|
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
statements.push(code `return true;`);
|
|
15
|
-
return code `\
|
|
19
|
+
return Maybe.of(code `\
|
|
16
20
|
export function filter(filter: ${this.filterType}, value: ${this.name}): boolean {
|
|
17
21
|
${joinCode(statements)}
|
|
18
|
-
}
|
|
22
|
+
}`);
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=NamedObjectType_filterFunctionDeclaration.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
3
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_filterTypeDeclaration(this: NamedObjectType): Code
|
|
4
|
+
export declare function NamedObjectType_filterTypeDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
4
5
|
//# sourceMappingURL=NamedObjectType_filterTypeDeclaration.d.ts.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
3
|
export function NamedObjectType_filterTypeDeclaration() {
|
|
4
|
+
if (!this.configuration.features.has("Object.filter")) {
|
|
5
|
+
return Maybe.empty();
|
|
6
|
+
}
|
|
3
7
|
const members = [];
|
|
4
8
|
if (this.properties.length > 0) {
|
|
5
9
|
const filterProperties = {};
|
|
@@ -15,7 +19,7 @@ export function NamedObjectType_filterTypeDeclaration() {
|
|
|
15
19
|
for (const parentObjectType of this.parentObjectTypes) {
|
|
16
20
|
members.push(code `${parentObjectType.name}.Filter`);
|
|
17
21
|
}
|
|
18
|
-
return code `\
|
|
19
|
-
export type Filter = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"}
|
|
22
|
+
return Maybe.of(code `\
|
|
23
|
+
export type Filter = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`);
|
|
20
24
|
}
|
|
21
25
|
//# sourceMappingURL=NamedObjectType_filterTypeDeclaration.js.map
|
|
@@ -7,7 +7,7 @@ const variables = {
|
|
|
7
7
|
variablePrefix: code `parameters.variablePrefix`,
|
|
8
8
|
};
|
|
9
9
|
export function NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration() {
|
|
10
|
-
if (!this.configuration.features.has("
|
|
10
|
+
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
11
11
|
return Maybe.empty();
|
|
12
12
|
}
|
|
13
13
|
const rdfClassVariable = code `${this.reusables.imports.dataFactory}.variable!(\`\${${variables.variablePrefix}}RdfClass\`)`;
|
|
@@ -8,7 +8,7 @@ const variables = {
|
|
|
8
8
|
variablePrefix: code `parameters.variablePrefix`,
|
|
9
9
|
};
|
|
10
10
|
export function NamedObjectType_focusSparqlWherePatternsFunctionDeclaration() {
|
|
11
|
-
if (!this.configuration.features.has("
|
|
11
|
+
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
12
12
|
return Maybe.empty();
|
|
13
13
|
}
|
|
14
14
|
const rdfClassVariable = code `${this.reusables.imports.dataFactory}.variable!(\`\${${variables.variablePrefix}}RdfClass\`)`;
|
|
@@ -1,22 +1,43 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_fromJsonFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.fromJson")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
|
-
let initializers = [];
|
|
8
|
-
const statements = [];
|
|
9
7
|
const variables = {
|
|
10
8
|
jsonObject: code `${this.configuration.syntheticNamePrefix}json`,
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const chains = [];
|
|
11
|
+
this.parentObjectTypes.forEach((parentObjectType, parentObjectTypeI) => {
|
|
12
|
+
chains.push({
|
|
13
|
+
expression: code `${parentObjectType.name}.fromJson(${variables.jsonObject})`,
|
|
14
|
+
variable: `super${parentObjectTypeI}`,
|
|
15
|
+
});
|
|
14
16
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const propertyInitializers = this.properties.flatMap((property) => property.fromJsonInitializer({ variables }).toList());
|
|
18
|
+
if (propertyInitializers.length > 0) {
|
|
19
|
+
chains.push({
|
|
20
|
+
expression: code `${this.reusables.snippets.sequenceRecord}({ ${joinCode(propertyInitializers, { on: "," })} })`,
|
|
21
|
+
variable: "properties",
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
let returnExpression;
|
|
25
|
+
switch (chains.length) {
|
|
26
|
+
case 0:
|
|
27
|
+
returnExpression = code `create({})`;
|
|
28
|
+
break;
|
|
29
|
+
case 1:
|
|
30
|
+
returnExpression = code `(${chains[0].expression}).chain(create)`;
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
returnExpression = code `${chains
|
|
34
|
+
.reverse()
|
|
35
|
+
.reduce((acc, { expression, variable }) => code `(${expression}).chain(${variable} => ${acc})`, code `(create({ ${chains.map((chain) => `...${chain.variable}`).join(", ")} }))`)}`;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
17
38
|
return Maybe.of(code `\
|
|
18
|
-
export function fromJson(${variables.jsonObject}: ${this.jsonType().name}): ${this.name} {
|
|
19
|
-
${
|
|
39
|
+
export function fromJson(${variables.jsonObject}: ${this.jsonType().name}): ${this.reusables.imports.Either}<Error, ${this.name}> {
|
|
40
|
+
return ${returnExpression};
|
|
20
41
|
}`);
|
|
21
42
|
}
|
|
22
43
|
//# sourceMappingURL=NamedObjectType_fromJsonFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js
CHANGED
|
@@ -2,7 +2,7 @@ import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
4
|
export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
|
|
5
|
-
if (!this.configuration.features.has("
|
|
5
|
+
if (!this.configuration.features.has("Object.fromRdf")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
8
8
|
const syntheticNamePrefix = this.configuration.syntheticNamePrefix;
|
|
@@ -84,19 +84,19 @@ export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
|
|
|
84
84
|
partialsJoined = code `{ ${partials.map((partial) => `...${partial}`).join(", ")} }`;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
let returnExpression;
|
|
88
88
|
const resultExpression = code `create(${partialsJoined})`;
|
|
89
89
|
if (chains.length === 0) {
|
|
90
|
-
|
|
90
|
+
returnExpression = code `${this.reusables.imports.Right}(${resultExpression})`;
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
|
-
|
|
93
|
+
returnExpression = code `${chains
|
|
94
94
|
.reverse()
|
|
95
|
-
.reduce((acc, { expression, variable }) => code `(${expression}).chain(${variable} => ${acc})`, code `(${resultExpression})`)}
|
|
95
|
+
.reduce((acc, { expression, variable }) => code `(${expression}).chain(${variable} => ${acc})`, code `(${resultExpression})`)}`;
|
|
96
96
|
}
|
|
97
97
|
return Maybe.of(code `\
|
|
98
98
|
export const _fromRdfResource: ${this.reusables.snippets._FromRdfResourceFunction}<${this.name}> = (${variables.resource}, ${optionsVariable}) => {
|
|
99
|
-
${
|
|
99
|
+
return ${returnExpression};
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export const fromRdfResource = ${this.reusables.snippets.wrap_FromRdfResourceFunction}(_fromRdfResource);`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_fromRdfResourceValuesFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.fromRdf")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
return Maybe.of(code `\
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_fromRdfTypeVariableStatement() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.fromRdf")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
return this.fromRdfType.map((fromRdfType) => code `\
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_graphqlTypeVariableStatement() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("GraphQL")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
if (this.synthetic) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
2
|
const hasherVariable = code `hasher`;
|
|
3
3
|
export function NamedObjectType_hashFunctionDeclarations() {
|
|
4
|
-
if (!this.configuration.features.has("hash")) {
|
|
4
|
+
if (!this.configuration.features.has("Object.hash")) {
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
7
|
const hashOwnShaclPropertiesStatements = this.properties.flatMap((property) => property.kind === "ShaclProperty"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
3
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_isTypeFunctionDeclaration(this: NamedObjectType): Code
|
|
4
|
+
export declare function NamedObjectType_isTypeFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
4
5
|
//# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.d.ts.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
2
3
|
export function NamedObjectType_isTypeFunctionDeclaration() {
|
|
3
|
-
|
|
4
|
+
if (!this.configuration.features.has("Object.type")) {
|
|
5
|
+
return Maybe.empty();
|
|
6
|
+
}
|
|
7
|
+
return Maybe.of(code `\
|
|
4
8
|
export function is${this.name}(object: ${this.configuration.syntheticNamePrefix}Object): object is ${this.name} {
|
|
5
9
|
switch (object.${this._discriminantProperty.name}) {
|
|
6
10
|
${this._discriminantProperty.type.descendantValues
|
|
@@ -8,6 +12,6 @@ export function is${this.name}(object: ${this.configuration.syntheticNamePrefix}
|
|
|
8
12
|
.map((value) => `case "${value}":`)
|
|
9
13
|
.join("\n")} return true; default: return false;
|
|
10
14
|
}
|
|
11
|
-
}
|
|
15
|
+
}`);
|
|
12
16
|
}
|
|
13
17
|
//# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_jsonParseFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.JSON.parse")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
return Maybe.of(code `\
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_jsonSchemaFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.JSON.schema")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
let properties = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_jsonTypeAliasDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.JSON.type")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
const members = [];
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_jsonUiSchemaFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.JSON.uiSchema")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
const variables = { scopePrefix: code `scopePrefix` };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
3
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_schemaVariableStatement(this: NamedObjectType): Code
|
|
4
|
+
export declare function NamedObjectType_schemaVariableStatement(this: NamedObjectType): Maybe<Code>;
|
|
4
5
|
//# sourceMappingURL=NamedObjectType_schemaVariableStatement.d.ts.map
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
3
|
export function NamedObjectType_schemaVariableStatement() {
|
|
3
|
-
|
|
4
|
+
if (!this.configuration.features.has("Object.schema")) {
|
|
5
|
+
return Maybe.empty();
|
|
6
|
+
}
|
|
7
|
+
return Maybe.of(code `\
|
|
4
8
|
export const schema = { properties: { ${joinCode(this.parentObjectTypes
|
|
5
9
|
.map((parentObjectType) => code `...${parentObjectType.name}.schema.properties`)
|
|
6
|
-
.concat(this.properties.map((property) => code `${property.name}: ${property.schema}`)), { on: ", " })} } } as const
|
|
10
|
+
.concat(this.properties.map((property) => code `${property.name}: ${property.schema}`)), { on: ", " })} } } as const;`);
|
|
7
11
|
}
|
|
8
12
|
//# sourceMappingURL=NamedObjectType_schemaVariableStatement.js.map
|
|
@@ -2,7 +2,7 @@ import { camelCase } from "change-case";
|
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { code } from "../ts-poet-wrapper.js";
|
|
4
4
|
export function NamedObjectType_sparqlConstructQueryFunctionDeclaration() {
|
|
5
|
-
if (!this.configuration.features.has("
|
|
5
|
+
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
8
8
|
return Maybe.of(code `\
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_sparqlConstructQueryStringFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
return Maybe.of(code `\
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_toJsonFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.toJson")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
const jsonObjectMembers = [];
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js
CHANGED
|
@@ -2,7 +2,7 @@ import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
4
|
export function NamedObjectType_toRdfResourceFunctionDeclaration() {
|
|
5
|
-
if (!this.configuration.features.has("
|
|
5
|
+
if (!this.configuration.features.has("Object.toRdf")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
8
8
|
const statements = this.parentObjectTypes.map((parentObjectType) => code `${parentObjectType.name}._toRdfResource({ ...parameters, ignoreRdfType: true });`);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
2
|
export function NamedObjectType_toStringFunctionDeclarations() {
|
|
3
|
+
if (!this.configuration.features.has("Object.toString")) {
|
|
4
|
+
return [];
|
|
5
|
+
}
|
|
3
6
|
let propertiesToStringInitializers = [];
|
|
4
7
|
if (this.parentObjectTypes.length > 0) {
|
|
5
8
|
for (const parentObjectType of this.parentObjectTypes) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
return Maybe.of(code `\
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
3
|
export function NamedObjectType_valueSparqlWherePatternsFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("
|
|
4
|
+
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
5
5
|
return Maybe.empty();
|
|
6
6
|
}
|
|
7
7
|
return Maybe.of(code `\
|