@lumjs/core 1.16.0 → 1.19.0

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.
@@ -1,7 +1,7 @@
1
1
  const {F, S, B} = require('./js');
2
2
  const {isType, isa} = require('./isa');
3
3
  const {isObj, isComplex} = require('./basics');
4
- const console = require('./console');
4
+ const console = require('../console');
5
5
 
6
6
  /**
7
7
  * If a value is not an object, throw an error.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Return the number of _local_ properties in an object.
3
+ *
4
+ * @param {(object|function)} v - The value we want the property count of.
5
+ *
6
+ * This can be any kind of `object`, or it can be a `function` that has
7
+ * a `prototype` property which is a `object`. Anything else is invalid.
8
+ *
9
+ * @param {number} [level=0] Determine which properties to count.
10
+ *
11
+ * - `== 0` : Counts only enumerable properties.
12
+ * - `> 0` : Includes all properties with string names.
13
+ * - `> 1` : Also includes symbol properties.
14
+ *
15
+ * @returns {number} The number of matching properties.
16
+ *
17
+ * If `v` was an invalid value, this will return `-1`.
18
+ *
19
+ * @alias module:@lumjs/core/types.ownCount
20
+ */
21
+ function ownCount(v, level=0)
22
+ {
23
+ if (typeof v === F && isObj(v.prototype))
24
+ { // If a class constructor is passed, we use the prototype.
25
+ v = v.prototype;
26
+ }
27
+
28
+ if (!isObj(v))
29
+ { // Nothing more to do here.
30
+ return -1;
31
+ }
32
+
33
+ if (level == 0)
34
+ { // Enumerable properties only.
35
+ return Object.keys(v).length;
36
+ }
37
+
38
+ // Include all properties with string names.
39
+
40
+ let count = Object.getOwnPropertyNames(v).length;
41
+
42
+ if (level > 1)
43
+ { // Also include symbol properties.
44
+ count += Object.getOwnPropertySymbols(v).length;
45
+ }
46
+
47
+ return count;
48
+ }
49
+
50
+ module.exports = ownCount;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@lumjs/core",
3
- "version": "1.16.0",
3
+ "version": "1.19.0",
4
4
  "main": "lib/index.js",
5
5
  "exports":
6
6
  {
7
7
  ".": "./lib/index.js",
8
8
 
9
- "./arrays": "./lib/arrays.js",
9
+ "./arrays": "./lib/arrays/index.js",
10
+ "./maps": "./lib/maps.js",
10
11
  "./context": "./lib/context.js",
11
12
  "./enum": "./lib/enum.js",
12
13
  "./flags": "./lib/flags.js",
@@ -1,107 +0,0 @@
1
- 0 verbose cli /usr/bin/node /usr/bin/npm
2
- 1 info using npm@9.7.1
3
- 2 info using node@v18.16.0
4
- 3 timing npm:load:whichnode Completed in 1ms
5
- 4 timing config:load:defaults Completed in 1ms
6
- 5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
7
- 6 timing config:load:builtin Completed in 1ms
8
- 7 timing config:load:cli Completed in 1ms
9
- 8 timing config:load:env Completed in 0ms
10
- 9 timing config:load:file:/system/docs/dev/js/lumjs/core/.npmrc Completed in 0ms
11
- 10 timing config:load:project Completed in 1ms
12
- 11 timing config:load:file:/home/novus/.npmrc Completed in 1ms
13
- 12 timing config:load:user Completed in 1ms
14
- 13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
15
- 14 timing config:load:global Completed in 0ms
16
- 15 timing config:load:setEnvs Completed in 1ms
17
- 16 timing config:load Completed in 6ms
18
- 17 timing npm:load:configload Completed in 6ms
19
- 18 timing config:load:flatten Completed in 1ms
20
- 19 timing npm:load:mkdirpcache Completed in 0ms
21
- 20 timing npm:load:mkdirplogs Completed in 0ms
22
- 21 verbose title npm publish
23
- 22 verbose argv "publish"
24
- 23 timing npm:load:setTitle Completed in 0ms
25
- 24 timing npm:load:display Completed in 1ms
26
- 25 verbose logfile logs-max:10 dir:/home/novus/.npm/_logs/2023-06-08T19_55_05_247Z-
27
- 26 verbose logfile /home/novus/.npm/_logs/2023-06-08T19_55_05_247Z-debug-0.log
28
- 27 timing npm:load:logFile Completed in 5ms
29
- 28 timing npm:load:timers Completed in 0ms
30
- 29 timing npm:load:configScope Completed in 0ms
31
- 30 timing npm:load Completed in 22ms
32
- 31 verbose publish [ '.' ]
33
- 32 silly logfile start cleaning logs, removing 1 files
34
- 33 silly logfile done cleaning log files
35
- 34 timing arborist:ctor Completed in 0ms
36
- 35 notice
37
- 36 notice 📦 @lumjs/core@1.16.0
38
- 37 notice === Tarball Contents ===
39
- 38 notice 928B README.md
40
- 38 notice 627B TODO.md
41
- 38 notice 501B jsdoc.json
42
- 38 notice 8.6kB lib/arrays.js
43
- 38 notice 6.4kB lib/context.js
44
- 38 notice 5.8kB lib/enum.js
45
- 38 notice 1.3kB lib/flags.js
46
- 38 notice 3.6kB lib/index.js
47
- 38 notice 3.8kB lib/meta.js
48
- 38 notice 3.6kB lib/modules.js
49
- 38 notice 1.2kB lib/obj/apply.js
50
- 38 notice 12.1kB lib/obj/clone.js
51
- 38 notice 1.2kB lib/obj/copyall.js
52
- 38 notice 12.5kB lib/obj/copyprops.js
53
- 38 notice 3.2kB lib/obj/getmethods.js
54
- 38 notice 1.2kB lib/obj/getproperty.js
55
- 38 notice 870B lib/obj/index.js
56
- 38 notice 2.2kB lib/obj/lock.js
57
- 38 notice 2.8kB lib/obj/merge.js
58
- 38 notice 6.8kB lib/obj/ns.js
59
- 38 notice 2.5kB lib/objectid.js
60
- 38 notice 8.7kB lib/observable.js
61
- 38 notice 2.2kB lib/opt.js
62
- 38 notice 5.3kB lib/strings.js
63
- 38 notice 6.0kB lib/types/basics.js
64
- 38 notice 4.7kB lib/types/console.js
65
- 38 notice 7.2kB lib/types/def.js
66
- 38 notice 1.1kB lib/types/dt.js
67
- 38 notice 1.8kB lib/types/index.js
68
- 38 notice 4.9kB lib/types/isa.js
69
- 38 notice 457B lib/types/js.js
70
- 38 notice 7.2kB lib/types/lazy.js
71
- 38 notice 3.4kB lib/types/needs.js
72
- 38 notice 2.7kB lib/types/root.js
73
- 38 notice 3.8kB lib/types/stringify.js
74
- 38 notice 5.5kB lib/types/typelist.js
75
- 38 notice 826B package.json
76
- 39 notice === Tarball Details ===
77
- 40 notice name: @lumjs/core
78
- 40 notice version: 1.16.0
79
- 40 notice filename: lumjs-core-1.16.0.tgz
80
- 40 notice package size: 42.7 kB
81
- 40 notice unpacked size: 147.6 kB
82
- 40 notice shasum: 424727206c94f94fbf8e18c5f62eab4aa64e52af
83
- 40 notice integrity: sha512-iPLVQTAe/Bf8P[...]TV8PNxn6/ji5A==
84
- 40 notice total files: 37
85
- 41 notice
86
- 42 notice Publishing to https://registry.npmjs.org/ with tag latest and default access
87
- 43 http fetch PUT 401 https://registry.npmjs.org/@lumjs%2fcore 277ms
88
- 44 timing command:publish Completed in 367ms
89
- 45 verbose stack HttpErrorGeneral: 401 Unauthorized - PUT https://registry.npmjs.org/@lumjs%2fcore - unexpected status code from "get-packument" = 401
90
- 45 verbose stack at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
91
- 45 verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
92
- 45 verbose stack at async publish (/usr/lib/node_modules/npm/node_modules/libnpmpublish/lib/publish.js:54:17)
93
- 45 verbose stack at async otplease (/usr/lib/node_modules/npm/lib/utils/otplease.js:4:12)
94
- 45 verbose stack at async Publish.exec (/usr/lib/node_modules/npm/lib/commands/publish.js:123:7)
95
- 45 verbose stack at async module.exports (/usr/lib/node_modules/npm/lib/cli-entry.js:61:5)
96
- 46 verbose statusCode 401
97
- 47 verbose pkgid @lumjs/core@1.16.0
98
- 48 verbose cwd /system/docs/dev/js/lumjs/core
99
- 49 verbose Linux 5.10.0-22-amd64
100
- 50 verbose node v18.16.0
101
- 51 verbose npm v9.7.1
102
- 52 error code E401
103
- 53 error 401 Unauthorized - PUT https://registry.npmjs.org/@lumjs%2fcore - unexpected status code from "get-packument" = 401
104
- 54 verbose exit 1
105
- 55 timing npm Completed in 495ms
106
- 56 verbose code 1
107
- 57 error A complete log of this run can be found in: /home/novus/.npm/_logs/2023-06-08T19_55_05_247Z-debug-0.log