node-opcua-service-translate-browse-path
Advanced tools
Comparing version 2.139.0 to 2.141.0
@@ -1,2 +0,7 @@ | ||
import { RelativePath } from "node-opcua-types"; | ||
import { RelativePath, RelativePathElement } from "node-opcua-types"; | ||
export declare function unescape(str: string): string; | ||
export declare function escape(str: string): string; | ||
export interface RelativePathEx extends RelativePath { | ||
elements: RelativePathElement[]; | ||
} | ||
/** | ||
@@ -15,2 +20,2 @@ * construct a RelativePath from a string containing the relative path description. | ||
*/ | ||
export declare function makeRelativePath(str: string, addressSpace?: any): RelativePath; | ||
export declare function makeRelativePath(str: string, addressSpace?: any): RelativePathEx; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unescape = unescape; | ||
exports.escape = escape; | ||
exports.makeRelativePath = makeRelativePath; | ||
@@ -75,3 +77,5 @@ /** | ||
// | ||
// regular character | ||
const regCharacters = /[^/.<>:#!&]/; | ||
// reserved character | ||
const regReservedCharacters = /[/.<>:#!&]/; | ||
@@ -84,4 +88,24 @@ const regName = new RegExp("(" + regCharacters.source + "|(&" + regReservedCharacters.source + "))+"); | ||
function unescape(str) { | ||
return str.replace(/&/g, ""); | ||
// replace all &x by | ||
str = str.replace(/&\//g, "/"); | ||
str = str.replace(/&\./g, "."); | ||
str = str.replace(/&</g, "<"); | ||
str = str.replace(/&>/g, ">"); | ||
str = str.replace(/&:/g, ":"); | ||
str = str.replace(/&#/g, "#"); | ||
str = str.replace(/&!/g, "!"); | ||
return str.replace(/&&/g, "&"); | ||
} | ||
function escape(str) { | ||
// replace all &x by | ||
str = str.replace(/&/g, "&&"); | ||
str = str.replace(/\//g, "&/"); | ||
str = str.replace(/\./g, "&."); | ||
str = str.replace(/</g, "&<"); | ||
str = str.replace(/>/g, "&>"); | ||
str = str.replace(/:/g, "&:"); | ||
str = str.replace(/#/g, "&#"); | ||
str = str.replace(/!/g, "&!"); | ||
return str; | ||
} | ||
function makeQualifiedName(mm) { | ||
@@ -88,0 +112,0 @@ const strName = mm[10]; |
@@ -1,2 +0,2 @@ | ||
import { QualifiedName } from "node-opcua-data-model"; | ||
import { QualifiedNameLike } from "node-opcua-data-model"; | ||
import { NodeId } from "node-opcua-nodeid"; | ||
@@ -10,2 +10,2 @@ import { BrowsePath } from "./imports"; | ||
nodeId: NodeId; | ||
}, targetNames: QualifiedName[] | null): BrowsePath; | ||
}, targetNames: QualifiedNameLike[] | null): BrowsePath; |
{ | ||
"name": "node-opcua-service-translate-browse-path", | ||
"version": "2.139.0", | ||
"version": "2.141.0", | ||
"description": "pure nodejs OPCUA SDK - module service-translate-browse-path", | ||
@@ -17,3 +17,3 @@ "scripts": { | ||
"node-opcua-nodeid": "2.139.0", | ||
"node-opcua-types": "2.139.0" | ||
"node-opcua-types": "2.141.0" | ||
}, | ||
@@ -35,3 +35,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "b7a01d31c7602d323e60a5f4a54428199a266f29", | ||
"gitHead": "7467e145ce9ebad2c80cabb096189bda7714083d", | ||
"files": [ | ||
@@ -38,0 +38,0 @@ "dist", |
@@ -7,3 +7,3 @@ /** | ||
import { NodeId, resolveNodeId } from "node-opcua-nodeid"; | ||
import { RelativePath } from "node-opcua-types"; | ||
import { RelativePath, RelativePathElement } from "node-opcua-types"; | ||
/*= | ||
@@ -77,7 +77,14 @@ * Release 1.03 page 152 OPC Unified Architecture, Part 4 | ||
// | ||
// regular character | ||
const regCharacters = /[^/.<>:#!&]/; | ||
// reserved character | ||
const regReservedCharacters = /[/.<>:#!&]/; | ||
const regName = new RegExp("(" + regCharacters.source + "|(&" + regReservedCharacters.source + "))+"); | ||
const regNamespaceIndex = /[0-9]+/; | ||
const regBrowseName = new RegExp("(" + regNamespaceIndex.source + ":)?(" + regName.source + ")"); | ||
const regReferenceType = new RegExp("/|\\.|(<(#)?(!)?(" + regBrowseName.source + ")>)"); | ||
@@ -87,6 +94,27 @@ | ||
function unescape(str: string): string { | ||
return str.replace(/&/g, ""); | ||
export function unescape(str: string): string { | ||
// replace all &x by | ||
str = str.replace(/&\//g, "/"); | ||
str = str.replace(/&\./g, "."); | ||
str = str.replace(/&</g, "<"); | ||
str = str.replace(/&>/g, ">"); | ||
str = str.replace(/&:/g, ":"); | ||
str = str.replace(/&#/g, "#"); | ||
str = str.replace(/&!/g, "!"); | ||
return str.replace(/&&/g, "&"); | ||
} | ||
export function escape(str: string): string { | ||
// replace all &x by | ||
str = str.replace(/&/g, "&&"); | ||
str = str.replace(/\//g, "&/"); | ||
str = str.replace(/\./g, "&."); | ||
str = str.replace(/</g, "&<"); | ||
str = str.replace(/>/g, "&>"); | ||
str = str.replace(/:/g, "&:"); | ||
str = str.replace(/#/g, "&#"); | ||
str = str.replace(/!/g, "&!"); | ||
return str; | ||
} | ||
function makeQualifiedName(mm: RegExpMatchArray): QualifiedName { | ||
@@ -102,2 +130,7 @@ const strName = mm[10]; | ||
export interface RelativePathEx extends RelativePath { | ||
elements: RelativePathElement[]; | ||
} | ||
/** | ||
@@ -116,3 +149,3 @@ * construct a RelativePath from a string containing the relative path description. | ||
*/ | ||
export function makeRelativePath(str: string, addressSpace?: any): RelativePath { | ||
export function makeRelativePath(str: string, addressSpace?: any): RelativePathEx { | ||
let r: any = { | ||
@@ -119,0 +152,0 @@ elements: [] |
@@ -5,3 +5,3 @@ /** | ||
import { ReferenceTypeIds } from "node-opcua-constants"; | ||
import { QualifiedName } from "node-opcua-data-model"; | ||
import { QualifiedName, QualifiedNameLike } from "node-opcua-data-model"; | ||
import { makeNodeId, NodeId } from "node-opcua-nodeid"; | ||
@@ -20,3 +20,3 @@ import { BrowsePath } from "./imports"; | ||
startingNode: { nodeId: NodeId }, | ||
targetNames: QualifiedName[] | null | ||
targetNames: QualifiedNameLike[] | null | ||
): BrowsePath { | ||
@@ -23,0 +23,0 @@ targetNames = targetNames || []; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35200
575
+ Added@types/assert@1.5.11(transitive)
+ Addedassert@2.1.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedfor-each@0.3.5(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.1.0(transitive)
+ Addedis-nan@1.3.2(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedis-typed-array@1.1.15(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addednode-opcua-generator@2.141.0(transitive)
+ Addednode-opcua-schemas@2.141.0(transitive)
+ Addednode-opcua-types@2.141.0(transitive)
+ Addednode-opcua-xml2json@2.141.0(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.7(transitive)
+ Addedpossible-typed-array-names@1.1.0(transitive)
+ Addedsafe-regex-test@1.1.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedthenify-ex@4.2.0(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedwhich-typed-array@1.1.18(transitive)
- Removednode-opcua-generator@2.139.0(transitive)
- Removednode-opcua-schemas@2.139.0(transitive)
- Removednode-opcua-types@2.139.0(transitive)
- Removednode-opcua-xml2json@2.139.0(transitive)
- Removedthenify@3.3.1(transitive)
Updatednode-opcua-types@2.141.0