node-opcua-service-translate-browse-path
Advanced tools
Comparing version 2.31.0 to 2.32.0
@@ -0,2 +1,6 @@ | ||
import { NodeId, NodeIdLike } from "node-opcua-nodeid"; | ||
import { BrowsePath } from "node-opcua-types"; | ||
export declare function makeBrowsePath(rootNode: any, relativePathBNF: string): BrowsePath; | ||
export declare type NodeIdLikeOrWithNodeId = NodeIdLike | { | ||
nodeId: NodeId; | ||
}; | ||
export declare function makeBrowsePath(rootNode: NodeIdLikeOrWithNodeId, relativePathBNF: string): BrowsePath; |
@@ -8,3 +8,3 @@ "use strict"; | ||
function _get_nodeId(node) { | ||
if (node.nodeId) { | ||
if (node.hasOwnProperty("nodeId")) { | ||
return node.nodeId; | ||
@@ -11,0 +11,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { RelativePath } from "node-opcua-types"; | ||
/** | ||
@@ -14,2 +15,2 @@ * construct a RelativePath from a string containing the relative path description. | ||
*/ | ||
export declare function makeRelativePath(str: string, addressSpace?: any): any; | ||
export declare function makeRelativePath(str: string, addressSpace?: any): RelativePath; |
@@ -136,5 +136,5 @@ "use strict"; | ||
// match 3 => "#" or null | ||
includeSubtypes = (matches[3] !== "#"); | ||
includeSubtypes = matches[3] !== "#"; | ||
// match 4 => "!" or null | ||
isInverse = (matches[4] === "!"); | ||
isInverse = matches[4] === "!"; | ||
// match 5 | ||
@@ -141,0 +141,0 @@ // namespace match 6 ( ns:) |
{ | ||
"name": "node-opcua-service-translate-browse-path", | ||
"version": "2.31.0", | ||
"version": "2.32.0", | ||
"description": "pure nodejs OPCUA SDK - module -service-translate-browse-path", | ||
@@ -14,15 +14,15 @@ "scripts": { | ||
"node-opcua-assert": "2.29.0", | ||
"node-opcua-basic-types": "2.31.0", | ||
"node-opcua-basic-types": "2.32.0", | ||
"node-opcua-binary-stream": "2.29.0", | ||
"node-opcua-constants": "2.29.0", | ||
"node-opcua-data-model": "2.31.0", | ||
"node-opcua-factory": "2.31.0", | ||
"node-opcua-data-model": "2.32.0", | ||
"node-opcua-factory": "2.32.0", | ||
"node-opcua-nodeid": "2.31.0", | ||
"node-opcua-service-secure-channel": "2.31.0", | ||
"node-opcua-types": "2.31.0" | ||
"node-opcua-service-secure-channel": "2.32.0", | ||
"node-opcua-types": "2.32.0" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-generator": "2.31.0", | ||
"node-opcua-generator": "2.32.0", | ||
"should": "^13.2.3", | ||
"sinon": "^9.2.3" | ||
"sinon": "^9.2.4" | ||
}, | ||
@@ -44,3 +44,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "344be19d71445220cf23569881e0234a79d63ee2" | ||
"gitHead": "0837f665b683c6a891d495ae8cf6f701e4a8450e" | ||
} |
@@ -5,13 +5,18 @@ /** | ||
import { assert } from "node-opcua-assert"; | ||
import { NodeId, resolveNodeId } from "node-opcua-nodeid"; | ||
import { NodeId, NodeIdLike, resolveNodeId } from "node-opcua-nodeid"; | ||
import { BrowsePath } from "node-opcua-types"; | ||
import { makeRelativePath } from "./make_relative_path"; | ||
function _get_nodeId(node: any): NodeId { | ||
if (node.nodeId) { | ||
return node.nodeId; | ||
export declare type NodeIdLikeOrWithNodeId = | ||
| NodeIdLike | ||
| { | ||
nodeId: NodeId; | ||
}; | ||
function _get_nodeId(node: NodeIdLikeOrWithNodeId): NodeId { | ||
if (node.hasOwnProperty("nodeId")) { | ||
return (node as any).nodeId; | ||
} | ||
return resolveNodeId(node); | ||
return resolveNodeId(node as NodeIdLike); | ||
} | ||
export function makeBrowsePath(rootNode: any, relativePathBNF: string) { | ||
export function makeBrowsePath(rootNode: NodeIdLikeOrWithNodeId, relativePathBNF: string): BrowsePath { | ||
return new BrowsePath({ | ||
@@ -18,0 +23,0 @@ startingNode: _get_nodeId(rootNode), |
@@ -112,4 +112,3 @@ /** | ||
*/ | ||
export function makeRelativePath(str: string, addressSpace?: any) { | ||
export function makeRelativePath(str: string, addressSpace?: any): RelativePath { | ||
let r: any = { | ||
@@ -139,3 +138,2 @@ elements: [] | ||
} else if (refStr === ".") { | ||
referenceTypeId = aggregatesReferenceTypeNodeId; | ||
@@ -145,8 +143,7 @@ isInverse = false; | ||
} else { | ||
// match 3 => "#" or null | ||
includeSubtypes = (matches[3] !== "#"); | ||
includeSubtypes = matches[3] !== "#"; | ||
// match 4 => "!" or null | ||
isInverse = (matches[4] === "!"); | ||
isInverse = matches[4] === "!"; | ||
@@ -160,3 +157,2 @@ // match 5 | ||
referenceTypeId = resolveNodeId(name); | ||
} else { | ||
@@ -171,3 +167,3 @@ // AddressSpace.prototype.findReferenceType = function (refType,namespace) | ||
r.elements.push({referenceTypeId, isInverse, includeSubtypes, targetName}); | ||
r.elements.push({ referenceTypeId, isInverse, includeSubtypes, targetName }); | ||
@@ -174,0 +170,0 @@ str = str.substr(matches[0].length); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31068
512
+ Addednode-opcua-basic-types@2.32.0(transitive)
+ Addednode-opcua-data-model@2.32.0(transitive)
+ Addednode-opcua-data-value@2.32.0(transitive)
+ Addednode-opcua-extension-object@2.32.0(transitive)
+ Addednode-opcua-factory@2.32.0(transitive)
+ Addednode-opcua-generator@2.32.0(transitive)
+ Addednode-opcua-numeric-range@2.32.0(transitive)
+ Addednode-opcua-packet-analyzer@2.32.0(transitive)
+ Addednode-opcua-schemas@2.32.0(transitive)
+ Addednode-opcua-service-secure-channel@2.32.0(transitive)
+ Addednode-opcua-types@2.32.0(transitive)
+ Addednode-opcua-utils@2.32.0(transitive)
+ Addednode-opcua-variant@2.32.0(transitive)
+ Addednode-opcua-xml2json@2.32.0(transitive)
- Removednode-opcua-basic-types@2.31.0(transitive)
- Removednode-opcua-data-model@2.31.0(transitive)
- Removednode-opcua-data-value@2.31.0(transitive)
- Removednode-opcua-extension-object@2.31.0(transitive)
- Removednode-opcua-factory@2.31.0(transitive)
- Removednode-opcua-generator@2.31.0(transitive)
- Removednode-opcua-numeric-range@2.31.0(transitive)
- Removednode-opcua-packet-analyzer@2.31.0(transitive)
- Removednode-opcua-schemas@2.31.0(transitive)
- Removednode-opcua-service-secure-channel@2.31.0(transitive)
- Removednode-opcua-types@2.31.0(transitive)
- Removednode-opcua-utils@2.31.0(transitive)
- Removednode-opcua-variant@2.31.0(transitive)
- Removednode-opcua-xml2json@2.31.0(transitive)
Updatednode-opcua-data-model@2.32.0
Updatednode-opcua-factory@2.32.0
Updatednode-opcua-types@2.32.0