@existdb/node-exist
Advanced tools
@@ -7,3 +7,3 @@ const { getMimeType } = require('./util') | ||
| function parseLocal (client, handle, filename, options) { | ||
| function parseLocal (client, handle, filename, options = {}) { | ||
| // set default values | ||
@@ -16,3 +16,3 @@ const mimeType = getMimeType(filename, options && options.mimetype ? options.mimetype : null) | ||
| function read (client, documentName, options) { | ||
| function read (client, documentName, options = {}) { | ||
| return client.promisedMethodCall('getDocument', [documentName, options]) | ||
@@ -19,0 +19,0 @@ } |
@@ -12,12 +12,11 @@ /** | ||
| */ | ||
| function read (client, query, options) { | ||
| function read (client, query, options = {}) { | ||
| const limit = options.limit || 1 | ||
| const start = options.start || 1 // yes, it seems to be 1-based | ||
| const queryOptions = options || {} | ||
| const start = options.start || 1 // yes, start it seems to be 1-based | ||
| // these cause null exceptions in exist XML RPC | ||
| delete queryOptions.start | ||
| delete queryOptions.limit | ||
| // remmove them from options as they cause NPEs in exist-db XML-RPC | ||
| delete options.limit | ||
| delete options.start | ||
| return client.promisedMethodCall('query', [query, limit, start, queryOptions]) | ||
| return client.promisedMethodCall('query', [query, limit, start, options]) | ||
| } | ||
@@ -32,3 +31,3 @@ | ||
| */ | ||
| function execute (client, queryStringOrBuffer, options) { | ||
| function execute (client, queryStringOrBuffer, options = {}) { | ||
| return client.promisedMethodCall('executeQuery', [queryStringOrBuffer, options]) | ||
@@ -57,3 +56,3 @@ } | ||
| function readAll (client, queryStringOrBuffer, options) { | ||
| function readAll (client, queryStringOrBuffer, options = {}) { | ||
| let resultHandle = -1 | ||
@@ -60,0 +59,0 @@ let resultPages = -1 |
+1
-1
@@ -56,3 +56,3 @@ { | ||
| }, | ||
| "version": "5.5.1" | ||
| "version": "5.5.2" | ||
| } |
+3
-3
@@ -114,3 +114,3 @@ # node-exist | ||
| db.documents.upload(Buffer.from('<root/>')) | ||
| .then(fileHandle => db.documents.parseLocal(fileHandle, '/db/apps/test/file.xml', {})) | ||
| .then(fileHandle => db.documents.parseLocal(fileHandle, '/db/apps/test/file.xml')) | ||
| .then(result => db.documents.read('/db/apps/test/file.xml')) | ||
@@ -357,3 +357,3 @@ .then(result => console.log('test file contents', result)) | ||
| ```js | ||
| db.documents.parseLocal(fileHandle, 'foo/test.txt', {}) | ||
| db.documents.parseLocal(fileHandle, 'foo/test.txt') | ||
| ``` | ||
@@ -371,3 +371,3 @@ | ||
| ```js | ||
| db.documents.read('foo.xml', {}) | ||
| db.documents.read('foo.xml') | ||
| ``` | ||
@@ -374,0 +374,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
50880
-0.03%840
-0.12%