@lionweb/validation 0.6.13-beta.4 → 0.6.13-beta.5
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/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/issues/LanguageIssues.d.ts +4 -4
- package/dist/issues/LanguageIssues.d.ts.map +1 -1
- package/dist/issues/LanguageIssues.js +1 -1
- package/dist/issues/LanguageIssues.js.map +1 -1
- package/dist/issues/ReferenceIssues.d.ts +6 -6
- package/dist/issues/ReferenceIssues.d.ts.map +1 -1
- package/dist/issues/ReferenceIssues.js +3 -3
- package/dist/issues/ReferenceIssues.js.map +1 -1
- package/dist/issues/SyntaxIssues.d.ts +1 -1
- package/dist/issues/SyntaxIssues.d.ts.map +1 -1
- package/dist/issues/ValidationIssue.d.ts +1 -1
- package/dist/issues/ValidationIssue.d.ts.map +1 -1
- package/dist/issues/ValidationIssue.js.map +1 -1
- package/dist/issues/index.d.ts +0 -1
- package/dist/issues/index.d.ts.map +1 -1
- package/dist/issues/index.js +0 -1
- package/dist/issues/index.js.map +1 -1
- package/dist/languages/CompositeLionWebLanguageWrapper.d.ts +1 -1
- package/dist/languages/CompositeLionWebLanguageWrapper.d.ts.map +1 -1
- package/dist/languages/LanguageRegistry.d.ts +1 -1
- package/dist/languages/LanguageRegistry.d.ts.map +1 -1
- package/dist/languages/LanguageUtils.d.ts +1 -1
- package/dist/languages/LanguageUtils.d.ts.map +1 -1
- package/dist/languages/LanguageUtils.js +5 -5
- package/dist/languages/LanguageUtils.js.map +1 -1
- package/dist/languages/LionWebLanguageWrapper.d.ts +3 -3
- package/dist/languages/LionWebLanguageWrapper.d.ts.map +1 -1
- package/dist/languages/LionWebLanguageWrapper.js +2 -2
- package/dist/languages/LionWebLanguageWrapper.js.map +1 -1
- package/dist/languages/MetaPointerMap.d.ts +2 -2
- package/dist/languages/MetaPointerMap.d.ts.map +1 -1
- package/dist/languages/MetaPointerMap.js +1 -1
- package/dist/languages/MetaPointerMap.js.map +1 -1
- package/dist/runners/FileUtils.d.ts.map +1 -1
- package/dist/runners/FileUtils.js +1 -1
- package/dist/runners/FileUtils.js.map +1 -1
- package/dist/runners/RunCheckFolderWithLanguage.js.map +1 -1
- package/dist/runners/RunLioncoreDiff.js +1 -1
- package/dist/runners/RunLioncoreDiff.js.map +1 -1
- package/dist/validators/LionWebChunkDefinitions.d.ts.map +1 -1
- package/dist/validators/LionWebChunkDefinitions.js +1 -1
- package/dist/validators/LionWebChunkDefinitions.js.map +1 -1
- package/dist/validators/LionWebLanguageReferenceValidator.d.ts +2 -4
- package/dist/validators/LionWebLanguageReferenceValidator.d.ts.map +1 -1
- package/dist/validators/LionWebLanguageReferenceValidator.js +2 -6
- package/dist/validators/LionWebLanguageReferenceValidator.js.map +1 -1
- package/dist/validators/LionWebLanguageValidator.d.ts +2 -3
- package/dist/validators/LionWebLanguageValidator.d.ts.map +1 -1
- package/dist/validators/LionWebLanguageValidator.js +2 -4
- package/dist/validators/LionWebLanguageValidator.js.map +1 -1
- package/dist/validators/LionWebReferenceValidator.d.ts +3 -4
- package/dist/validators/LionWebReferenceValidator.d.ts.map +1 -1
- package/dist/validators/LionWebReferenceValidator.js +2 -3
- package/dist/validators/LionWebReferenceValidator.js.map +1 -1
- package/dist/validators/LionWebSyntaxValidator.d.ts.map +1 -1
- package/dist/validators/LionWebSyntaxValidator.js +1 -1
- package/dist/validators/LionWebSyntaxValidator.js.map +1 -1
- package/dist/validators/LionWebValidator.d.ts +1 -1
- package/dist/validators/LionWebValidator.d.ts.map +1 -1
- package/dist/validators/LionWebValidator.js +2 -2
- package/dist/validators/LionWebValidator.js.map +1 -1
- package/dist/validators/ValidationFunctions.d.ts +5 -1
- package/dist/validators/ValidationFunctions.d.ts.map +1 -1
- package/dist/validators/ValidationFunctions.js +0 -4
- package/dist/validators/ValidationFunctions.js.map +1 -1
- package/dist/validators/generic/SyntaxValidator.d.ts +1 -1
- package/dist/validators/generic/SyntaxValidator.d.ts.map +1 -1
- package/dist/validators/generic/SyntaxValidator.js +1 -1
- package/dist/validators/generic/SyntaxValidator.js.map +1 -1
- package/dist/validators/generic/ValidationTypes.d.ts +1 -1
- package/dist/validators/generic/ValidationTypes.d.ts.map +1 -1
- package/dist/validators/generic/ValidationTypes.js.map +1 -1
- package/package.json +6 -1
- package/src/index.ts +0 -3
- package/src/issues/LanguageIssues.ts +12 -14
- package/src/issues/ReferenceIssues.ts +9 -9
- package/src/issues/SyntaxIssues.ts +5 -5
- package/src/issues/ValidationIssue.ts +7 -4
- package/src/issues/index.ts +0 -1
- package/src/languages/CompositeLionWebLanguageWrapper.ts +1 -1
- package/src/languages/LanguageRegistry.ts +1 -1
- package/src/languages/LanguageUtils.ts +6 -6
- package/src/languages/LionWebLanguageWrapper.ts +5 -9
- package/src/languages/MetaPointerMap.ts +7 -6
- package/src/runners/FileUtils.ts +1 -1
- package/src/runners/RunCheckFolderWithLanguage.ts +1 -1
- package/src/runners/RunLioncoreDiff.ts +2 -2
- package/src/validators/LionWebChunkDefinitions.ts +1 -6
- package/src/validators/LionWebLanguageReferenceValidator.ts +17 -20
- package/src/validators/LionWebLanguageValidator.ts +2 -4
- package/src/validators/LionWebReferenceValidator.ts +6 -14
- package/src/validators/LionWebSyntaxValidator.ts +1 -1
- package/src/validators/LionWebValidator.ts +3 -3
- package/src/validators/ValidationFunctions.ts +1 -1
- package/src/validators/generic/SyntaxValidator.ts +1 -1
- package/src/validators/generic/ValidationTypes.ts +4 -5
- package/dist/diff/DiffResult.d.ts +0 -9
- package/dist/diff/DiffResult.d.ts.map +0 -1
- package/dist/diff/DiffResult.js +0 -18
- package/dist/diff/DiffResult.js.map +0 -1
- package/dist/diff/LionWebJsonDiff.d.ts +0 -25
- package/dist/diff/LionWebJsonDiff.d.ts.map +0 -1
- package/dist/diff/LionWebJsonDiff.js +0 -249
- package/dist/diff/LionWebJsonDiff.js.map +0 -1
- package/dist/diff/changes/Change.d.ts +0 -34
- package/dist/diff/changes/Change.d.ts.map +0 -1
- package/dist/diff/changes/Change.js +0 -38
- package/dist/diff/changes/Change.js.map +0 -1
- package/dist/diff/changes/ChunkChange.d.ts +0 -43
- package/dist/diff/changes/ChunkChange.d.ts.map +0 -1
- package/dist/diff/changes/ChunkChange.js +0 -57
- package/dist/diff/changes/ChunkChange.js.map +0 -1
- package/dist/diff/changes/ContainmentChange.d.ts +0 -25
- package/dist/diff/changes/ContainmentChange.d.ts.map +0 -1
- package/dist/diff/changes/ContainmentChange.js +0 -34
- package/dist/diff/changes/ContainmentChange.js.map +0 -1
- package/dist/diff/changes/NodeChange.d.ts +0 -41
- package/dist/diff/changes/NodeChange.d.ts.map +0 -1
- package/dist/diff/changes/NodeChange.js +0 -54
- package/dist/diff/changes/NodeChange.js.map +0 -1
- package/dist/diff/changes/PropertyChange.d.ts +0 -24
- package/dist/diff/changes/PropertyChange.d.ts.map +0 -1
- package/dist/diff/changes/PropertyChange.js +0 -29
- package/dist/diff/changes/PropertyChange.js.map +0 -1
- package/dist/diff/changes/ReferenceChange.d.ts +0 -25
- package/dist/diff/changes/ReferenceChange.d.ts.map +0 -1
- package/dist/diff/changes/ReferenceChange.js +0 -34
- package/dist/diff/changes/ReferenceChange.js.map +0 -1
- package/dist/diff/changes/index.d.ts +0 -7
- package/dist/diff/changes/index.d.ts.map +0 -1
- package/dist/diff/changes/index.js +0 -7
- package/dist/diff/changes/index.js.map +0 -1
- package/dist/diff/index.d.ts +0 -4
- package/dist/diff/index.d.ts.map +0 -1
- package/dist/diff/index.js +0 -4
- package/dist/diff/index.js.map +0 -1
- package/dist/json/ChunkUtils.d.ts +0 -26
- package/dist/json/ChunkUtils.d.ts.map +0 -1
- package/dist/json/ChunkUtils.js +0 -46
- package/dist/json/ChunkUtils.js.map +0 -1
- package/dist/json/JsonContext.d.ts +0 -11
- package/dist/json/JsonContext.d.ts.map +0 -1
- package/dist/json/JsonContext.js +0 -25
- package/dist/json/JsonContext.js.map +0 -1
- package/dist/json/LionWebJson.d.ts +0 -50
- package/dist/json/LionWebJson.d.ts.map +0 -1
- package/dist/json/LionWebJson.js +0 -27
- package/dist/json/LionWebJson.js.map +0 -1
- package/dist/json/LionWebJsonChunkWrapper.d.ts +0 -39
- package/dist/json/LionWebJsonChunkWrapper.d.ts.map +0 -1
- package/dist/json/LionWebJsonChunkWrapper.js +0 -119
- package/dist/json/LionWebJsonChunkWrapper.js.map +0 -1
- package/dist/json/M3definitions.d.ts +0 -176
- package/dist/json/M3definitions.d.ts.map +0 -1
- package/dist/json/M3definitions.js +0 -174
- package/dist/json/M3definitions.js.map +0 -1
- package/dist/json/NodeUtils.d.ts +0 -23
- package/dist/json/NodeUtils.d.ts.map +0 -1
- package/dist/json/NodeUtils.js +0 -57
- package/dist/json/NodeUtils.js.map +0 -1
- package/dist/json/index.d.ts +0 -7
- package/dist/json/index.d.ts.map +0 -1
- package/dist/json/index.js +0 -7
- package/dist/json/index.js.map +0 -1
- package/dist/util/graphs.d.ts +0 -18
- package/dist/util/graphs.d.ts.map +0 -1
- package/dist/util/graphs.js +0 -27
- package/dist/util/graphs.js.map +0 -1
- package/src/diff/DiffResult.ts +0 -21
- package/src/diff/LionWebJsonDiff.ts +0 -309
- package/src/diff/changes/Change.ts +0 -76
- package/src/diff/changes/ChunkChange.ts +0 -68
- package/src/diff/changes/ContainmentChange.ts +0 -32
- package/src/diff/changes/NodeChange.ts +0 -63
- package/src/diff/changes/PropertyChange.ts +0 -31
- package/src/diff/changes/ReferenceChange.ts +0 -34
- package/src/diff/changes/index.ts +0 -6
- package/src/diff/index.ts +0 -3
- package/src/json/ChunkUtils.ts +0 -49
- package/src/json/JsonContext.ts +0 -31
- package/src/json/LionWebJson.ts +0 -80
- package/src/json/LionWebJsonChunkWrapper.ts +0 -136
- package/src/json/M3definitions.ts +0 -177
- package/src/json/NodeUtils.ts +0 -75
- package/src/json/index.ts +0 -6
- package/src/util/graphs.ts +0 -36
package/src/json/NodeUtils.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isEqualMetaPointer,
|
|
3
|
-
isEqualReferenceTarget,
|
|
4
|
-
LionWebJsonContainment, LionWebJsonMetaPointer,
|
|
5
|
-
LionWebJsonNode,
|
|
6
|
-
LionWebJsonProperty,
|
|
7
|
-
LionWebJsonReference,
|
|
8
|
-
LionWebJsonReferenceTarget
|
|
9
|
-
} from "./LionWebJson.js"
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Utility functions for LionWebJsonNode's
|
|
13
|
-
*/
|
|
14
|
-
export class NodeUtils {
|
|
15
|
-
/**
|
|
16
|
-
* Find property with key equals `key` in `node`.
|
|
17
|
-
* @param node
|
|
18
|
-
* @param key
|
|
19
|
-
*/
|
|
20
|
-
static findProperty(node: LionWebJsonNode, property: LionWebJsonMetaPointer): LionWebJsonProperty | undefined {
|
|
21
|
-
if (node === undefined) {
|
|
22
|
-
return undefined
|
|
23
|
-
}
|
|
24
|
-
return node.properties.find(
|
|
25
|
-
prop => isEqualMetaPointer(prop.property, property)
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Find containment child with key equals `key` in `node`.
|
|
31
|
-
* @param node
|
|
32
|
-
* @param key
|
|
33
|
-
*/
|
|
34
|
-
static findChild(node: LionWebJsonNode, key: string): LionWebJsonContainment | undefined {
|
|
35
|
-
if (node === undefined) {
|
|
36
|
-
return undefined
|
|
37
|
-
}
|
|
38
|
-
for (const containment of node.containments) {
|
|
39
|
-
if (containment.containment.key === key) {
|
|
40
|
-
return containment
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return undefined
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static findContainment(node: LionWebJsonNode, containment: LionWebJsonMetaPointer): LionWebJsonContainment | undefined {
|
|
47
|
-
if (node === undefined) {
|
|
48
|
-
return undefined
|
|
49
|
-
}
|
|
50
|
-
return node.containments.find(cont => isEqualMetaPointer(cont.containment, containment))
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
static findReference(node: LionWebJsonNode, reference: LionWebJsonMetaPointer): LionWebJsonReference | undefined {
|
|
54
|
-
if (node === undefined) {
|
|
55
|
-
return undefined
|
|
56
|
-
}
|
|
57
|
-
return node.references.find(ref => isEqualMetaPointer(ref.reference, reference))
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static findReferenceTarget(
|
|
61
|
-
referenceTargets: LionWebJsonReferenceTarget[],
|
|
62
|
-
target: LionWebJsonReferenceTarget,
|
|
63
|
-
): LionWebJsonReferenceTarget | undefined {
|
|
64
|
-
for (const refTarget of referenceTargets) {
|
|
65
|
-
if (isEqualReferenceTarget(refTarget, target)) {
|
|
66
|
-
return refTarget
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return undefined
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
static findContainmentContainingChild(containments: LionWebJsonContainment[], childId: string): LionWebJsonContainment | undefined {
|
|
73
|
-
return containments.find(cont => cont.children.includes(childId))
|
|
74
|
-
}
|
|
75
|
-
}
|
package/src/json/index.ts
DELETED
package/src/util/graphs.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// NB This is an almost identical copy of packages/core/utils/recursion.ts
|
|
2
|
-
// Copied to avoid package dependencies
|
|
3
|
-
/**
|
|
4
|
-
* Type def. of a generic "flatMap" function.
|
|
5
|
-
*/
|
|
6
|
-
export type ResultMapper<T, R> = (t: T) => R[]
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Returns a function that performs a "flatMap" on a graph that's specified as a start vertex. and a function that computes (outgoing) edges.
|
|
10
|
-
* The "flatMap" is performed depth-first, and doesn't loop on cycles.
|
|
11
|
-
*
|
|
12
|
-
* @param mapper The function that calculates the result values
|
|
13
|
-
* @param nextVertices The function that calculates the next edges to visit.
|
|
14
|
-
* @returns A function that takes a starting vertex and resursively calculates the result values for each vertex visited.
|
|
15
|
-
*/
|
|
16
|
-
export const visitAndMap =
|
|
17
|
-
<T, R>(mapper: ResultMapper<T, R>, nextVertices: (t: T) => T[]): ResultMapper<T, R> =>
|
|
18
|
-
(startVertex: T): R[] => {
|
|
19
|
-
const visited: T[] = []
|
|
20
|
-
const rs: R[] = []
|
|
21
|
-
const recurse = (t: T) => {
|
|
22
|
-
if (visited.indexOf(t) > -1) {
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
visited.push(t)
|
|
26
|
-
rs.push(...mapper(t))
|
|
27
|
-
nextVertices(t).forEach(recurse)
|
|
28
|
-
}
|
|
29
|
-
recurse(startVertex)
|
|
30
|
-
return rs
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* A mapper function that returns the node itself as result
|
|
35
|
-
*/
|
|
36
|
-
export const selfMapper = <T>(t: T) => [t]
|