core-3nweb-client-lib 0.41.0 → 0.41.2

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.
@@ -48,6 +48,7 @@ declare namespace web3n.files {
48
48
  remoteNotSet?: true;
49
49
  notLinkableFile?: true;
50
50
  notLinkableFolder?: true;
51
+ badFnCallArguments?: true;
51
52
  }
52
53
 
53
54
  interface exceptionCode {
@@ -27,7 +27,8 @@ function userIdToFolderName(userId) {
27
27
  return buffer_utils_1.base64urlSafe.pack(buffer_utils_1.utf8.pack(userId));
28
28
  }
29
29
  function folderNameToUserId(folderName) {
30
- return buffer_utils_1.utf8.open(buffer_utils_1.base64urlSafe.open(folderName));
30
+ const str = buffer_utils_1.utf8.open(buffer_utils_1.base64urlSafe.open(folderName));
31
+ return (str.includes('@') ? str : undefined);
31
32
  }
32
33
  exports.UTIL_DIR = 'util';
33
34
  const INBOX_DIR = 'inbox';
@@ -70,7 +71,10 @@ function appDirs(appDir) {
70
71
  continue;
71
72
  }
72
73
  try {
73
- users.push(folderNameToUserId(entry.name));
74
+ const userId = folderNameToUserId(entry.name);
75
+ if (userId) {
76
+ users.push(userId);
77
+ }
74
78
  }
75
79
  catch (e) {
76
80
  continue;
@@ -462,6 +462,9 @@ class FolderNode extends node_in_fs_1.NodeInFS {
462
462
  return { node, key };
463
463
  }
464
464
  create(type, name, exclusive, changes, linkParams) {
465
+ if ((typeof name !== 'string') || (name.length === 0)) {
466
+ throw (0, file_1.makeFileException)('badFnCallArguments', name, `Given name is invalid for making ${type} node`);
467
+ }
465
468
  return this.doChange(true, async () => {
466
469
  // do check for concurrent creation of a node
467
470
  if (this.getNodeInfo(name, true)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-3nweb-client-lib",
3
- "version": "0.41.0",
3
+ "version": "0.41.2",
4
4
  "description": "3NWeb client core library, embeddable into different environments",
5
5
  "main": "build/lib-index.js",
6
6
  "types": "build/lib-index.d.ts",