@socketsecurity/lib 1.3.2 → 1.3.4
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.
- package/CHANGELOG.md +20 -0
- package/dist/abort.js +1 -60
- package/dist/abort.js.map +2 -2
- package/dist/agent.js +1 -289
- package/dist/agent.js.map +2 -2
- package/dist/ansi.js +1 -60
- package/dist/ansi.js.map +2 -2
- package/dist/argv/flags.js +1 -282
- package/dist/argv/flags.js.map +2 -2
- package/dist/argv/parse.js +1 -171
- package/dist/argv/parse.js.map +2 -2
- package/dist/arrays.js +1 -85
- package/dist/arrays.js.map +2 -2
- package/dist/bin.js +1 -402
- package/dist/bin.js.map +2 -2
- package/dist/cacache.js +1 -137
- package/dist/cacache.js.map +2 -2
- package/dist/cache-with-ttl.js +1 -223
- package/dist/cache-with-ttl.js.map +2 -2
- package/dist/constants/agents.js +1 -126
- package/dist/constants/agents.js.map +2 -2
- package/dist/constants/core.js +2 -57
- package/dist/constants/core.js.map +2 -2
- package/dist/constants/encoding.js +1 -48
- package/dist/constants/encoding.js.map +2 -2
- package/dist/constants/github.js +1 -30
- package/dist/constants/github.js.map +2 -2
- package/dist/constants/licenses.js +1 -66
- package/dist/constants/licenses.js.map +2 -2
- package/dist/constants/node.d.ts +2 -3
- package/dist/constants/node.js +1 -171
- package/dist/constants/node.js.map +3 -3
- package/dist/constants/packages.js +1 -128
- package/dist/constants/packages.js.map +2 -2
- package/dist/constants/paths.js +1 -150
- package/dist/constants/paths.js.map +2 -2
- package/dist/constants/platform.js +1 -41
- package/dist/constants/platform.js.map +2 -2
- package/dist/constants/process.js +1 -52
- package/dist/constants/process.js.map +2 -2
- package/dist/constants/socket.js +1 -81
- package/dist/constants/socket.js.map +2 -2
- package/dist/constants/testing.js +1 -36
- package/dist/constants/testing.js.map +2 -2
- package/dist/constants/time.js +1 -39
- package/dist/constants/time.js.map +2 -2
- package/dist/constants/typescript.js +1 -54
- package/dist/constants/typescript.js.map +2 -2
- package/dist/cover/code.js +1 -135
- package/dist/cover/code.js.map +2 -2
- package/dist/cover/formatters.js +11 -101
- package/dist/cover/formatters.js.map +2 -2
- package/dist/cover/type.js +1 -63
- package/dist/cover/type.js.map +2 -2
- package/dist/cover/types.js +1 -15
- package/dist/cover/types.js.map +2 -2
- package/dist/debug.js +2 -343
- package/dist/debug.js.map +2 -2
- package/dist/dlx-binary.js +1 -259
- package/dist/dlx-binary.js.map +2 -2
- package/dist/dlx-package.js +1 -149
- package/dist/dlx-package.js.map +2 -2
- package/dist/dlx.js +1 -166
- package/dist/dlx.js.map +2 -2
- package/dist/download-lock.js +1 -137
- package/dist/download-lock.js.map +2 -2
- package/dist/effects/pulse-frames.js +1 -64
- package/dist/effects/pulse-frames.js.map +2 -2
- package/dist/effects/text-shimmer.js +1 -174
- package/dist/effects/text-shimmer.js.map +2 -2
- package/dist/effects/types.js +1 -15
- package/dist/effects/types.js.map +2 -2
- package/dist/effects/ultra.js +1 -61
- package/dist/effects/ultra.js.map +2 -2
- package/dist/env/appdata.js +1 -28
- package/dist/env/appdata.js.map +2 -2
- package/dist/env/ci.js +1 -29
- package/dist/env/ci.js.map +2 -2
- package/dist/env/comspec.js +1 -28
- package/dist/env/comspec.js.map +2 -2
- package/dist/env/debug.js +1 -28
- package/dist/env/debug.js.map +2 -2
- package/dist/env/getters.js +1 -281
- package/dist/env/getters.js.map +2 -2
- package/dist/env/github-api-url.js +1 -28
- package/dist/env/github-api-url.js.map +2 -2
- package/dist/env/github-base-ref.js +1 -28
- package/dist/env/github-base-ref.js.map +2 -2
- package/dist/env/github-ref-name.js +1 -28
- package/dist/env/github-ref-name.js.map +2 -2
- package/dist/env/github-ref-type.js +1 -28
- package/dist/env/github-ref-type.js.map +2 -2
- package/dist/env/github-repository.js +1 -28
- package/dist/env/github-repository.js.map +2 -2
- package/dist/env/github-server-url.js +1 -28
- package/dist/env/github-server-url.js.map +2 -2
- package/dist/env/github-token.js +1 -28
- package/dist/env/github-token.js.map +2 -2
- package/dist/env/helpers.js +1 -47
- package/dist/env/helpers.js.map +2 -2
- package/dist/env/home.js +1 -28
- package/dist/env/home.js.map +2 -2
- package/dist/env/jest-worker-id.js +1 -28
- package/dist/env/jest-worker-id.js.map +2 -2
- package/dist/env/lang.js +1 -28
- package/dist/env/lang.js.map +2 -2
- package/dist/env/lc-all.js +1 -28
- package/dist/env/lc-all.js.map +2 -2
- package/dist/env/lc-messages.js +1 -28
- package/dist/env/lc-messages.js.map +2 -2
- package/dist/env/localappdata.js +1 -28
- package/dist/env/localappdata.js.map +2 -2
- package/dist/env/node-auth-token.js +1 -28
- package/dist/env/node-auth-token.js.map +2 -2
- package/dist/env/node-env.js +1 -28
- package/dist/env/node-env.js.map +2 -2
- package/dist/env/npm-config-registry.js +1 -28
- package/dist/env/npm-config-registry.js.map +2 -2
- package/dist/env/npm-config-user-agent.js +1 -28
- package/dist/env/npm-config-user-agent.js.map +2 -2
- package/dist/env/npm-lifecycle-event.js +1 -28
- package/dist/env/npm-lifecycle-event.js.map +2 -2
- package/dist/env/npm-registry.js +1 -28
- package/dist/env/npm-registry.js.map +2 -2
- package/dist/env/npm-token.js +1 -28
- package/dist/env/npm-token.js.map +2 -2
- package/dist/env/path.js +1 -28
- package/dist/env/path.js.map +2 -2
- package/dist/env/pre-commit.js +1 -29
- package/dist/env/pre-commit.js.map +2 -2
- package/dist/env/shell.js +1 -28
- package/dist/env/shell.js.map +2 -2
- package/dist/env/socket-accept-risks.js +1 -29
- package/dist/env/socket-accept-risks.js.map +2 -2
- package/dist/env/socket-api-base-url.js +1 -28
- package/dist/env/socket-api-base-url.js.map +2 -2
- package/dist/env/socket-api-proxy.js +1 -28
- package/dist/env/socket-api-proxy.js.map +2 -2
- package/dist/env/socket-api-timeout.js +1 -29
- package/dist/env/socket-api-timeout.js.map +2 -2
- package/dist/env/socket-api-token.js +1 -28
- package/dist/env/socket-api-token.js.map +2 -2
- package/dist/env/socket-cacache-dir.js +1 -28
- package/dist/env/socket-cacache-dir.js.map +2 -2
- package/dist/env/socket-cli-accept-risks.js +1 -31
- package/dist/env/socket-cli-accept-risks.js.map +2 -2
- package/dist/env/socket-cli-api-base-url.js +1 -28
- package/dist/env/socket-cli-api-base-url.js.map +2 -2
- package/dist/env/socket-cli-api-proxy.js +1 -28
- package/dist/env/socket-cli-api-proxy.js.map +2 -2
- package/dist/env/socket-cli-api-timeout.js +1 -29
- package/dist/env/socket-cli-api-timeout.js.map +2 -2
- package/dist/env/socket-cli-api-token.js +1 -28
- package/dist/env/socket-cli-api-token.js.map +2 -2
- package/dist/env/socket-cli-config.js +1 -28
- package/dist/env/socket-cli-config.js.map +2 -2
- package/dist/env/socket-cli-fix.js +1 -28
- package/dist/env/socket-cli-fix.js.map +2 -2
- package/dist/env/socket-cli-no-api-token.js +1 -31
- package/dist/env/socket-cli-no-api-token.js.map +2 -2
- package/dist/env/socket-cli-optimize.js +1 -29
- package/dist/env/socket-cli-optimize.js.map +2 -2
- package/dist/env/socket-cli-org-slug.js +1 -28
- package/dist/env/socket-cli-org-slug.js.map +2 -2
- package/dist/env/socket-cli-shadow-accept-risks.js +1 -31
- package/dist/env/socket-cli-shadow-accept-risks.js.map +2 -2
- package/dist/env/socket-cli-shadow-api-token.js +1 -28
- package/dist/env/socket-cli-shadow-api-token.js.map +2 -2
- package/dist/env/socket-cli-shadow-bin.js +1 -28
- package/dist/env/socket-cli-shadow-bin.js.map +2 -2
- package/dist/env/socket-cli-shadow-progress.js +1 -31
- package/dist/env/socket-cli-shadow-progress.js.map +2 -2
- package/dist/env/socket-cli-shadow-silent.js +1 -31
- package/dist/env/socket-cli-shadow-silent.js.map +2 -2
- package/dist/env/socket-cli-view-all-risks.js +1 -31
- package/dist/env/socket-cli-view-all-risks.js.map +2 -2
- package/dist/env/socket-config.js +1 -28
- package/dist/env/socket-config.js.map +2 -2
- package/dist/env/socket-debug.js +1 -28
- package/dist/env/socket-debug.js.map +2 -2
- package/dist/env/socket-home.js +1 -28
- package/dist/env/socket-home.js.map +2 -2
- package/dist/env/socket-no-api-token.js +1 -29
- package/dist/env/socket-no-api-token.js.map +2 -2
- package/dist/env/socket-npm-registry.js +1 -28
- package/dist/env/socket-npm-registry.js.map +2 -2
- package/dist/env/socket-org-slug.js +1 -28
- package/dist/env/socket-org-slug.js.map +2 -2
- package/dist/env/socket-registry-url.js +1 -28
- package/dist/env/socket-registry-url.js.map +2 -2
- package/dist/env/socket-view-all-risks.js +1 -29
- package/dist/env/socket-view-all-risks.js.map +2 -2
- package/dist/env/temp.js +1 -28
- package/dist/env/temp.js.map +2 -2
- package/dist/env/term.js +1 -28
- package/dist/env/term.js.map +2 -2
- package/dist/env/tmp.js +1 -28
- package/dist/env/tmp.js.map +2 -2
- package/dist/env/tmpdir.js +1 -28
- package/dist/env/tmpdir.js.map +2 -2
- package/dist/env/userprofile.js +1 -28
- package/dist/env/userprofile.js.map +2 -2
- package/dist/env/vitest.js +1 -29
- package/dist/env/vitest.js.map +2 -2
- package/dist/env/xdg-cache-home.js +1 -28
- package/dist/env/xdg-cache-home.js.map +2 -2
- package/dist/env/xdg-config-home.js +1 -28
- package/dist/env/xdg-config-home.js.map +2 -2
- package/dist/env/xdg-data-home.js +1 -28
- package/dist/env/xdg-data-home.js.map +2 -2
- package/dist/env.js +1 -61
- package/dist/env.js.map +2 -2
- package/dist/fs.js +3 -626
- package/dist/fs.js.map +2 -2
- package/dist/functions.js +1 -68
- package/dist/functions.js.map +2 -2
- package/dist/git.js +2 -320
- package/dist/git.js.map +2 -2
- package/dist/github.js +1 -201
- package/dist/github.js.map +2 -2
- package/dist/globs.js +1 -152
- package/dist/globs.js.map +2 -2
- package/dist/http-request.js +1 -313
- package/dist/http-request.js.map +2 -2
- package/dist/index.js +1 -62
- package/dist/index.js.map +2 -2
- package/dist/ipc.js +1 -232
- package/dist/ipc.js.map +2 -2
- package/dist/json.js +1 -73
- package/dist/json.js.map +2 -2
- package/dist/logger.js +1 -1254
- package/dist/logger.js.map +2 -2
- package/dist/maintained-node-versions.js +1 -35
- package/dist/maintained-node-versions.js.map +2 -2
- package/dist/memoization.js +1 -210
- package/dist/memoization.js.map +2 -2
- package/dist/objects.d.ts +0 -3
- package/dist/objects.js +1 -319
- package/dist/objects.js.map +3 -3
- package/dist/packages/editable.js +9 -356
- package/dist/packages/editable.js.map +2 -2
- package/dist/packages/exports.js +1 -162
- package/dist/packages/exports.js.map +2 -2
- package/dist/packages/isolation.js +1 -195
- package/dist/packages/isolation.js.map +2 -2
- package/dist/packages/licenses.js +1 -214
- package/dist/packages/licenses.js.map +2 -2
- package/dist/packages/manifest.js +1 -190
- package/dist/packages/manifest.js.map +2 -2
- package/dist/packages/normalize.js +1 -120
- package/dist/packages/normalize.js.map +2 -2
- package/dist/packages/operations.js +1 -304
- package/dist/packages/operations.js.map +2 -2
- package/dist/packages/paths.js +1 -53
- package/dist/packages/paths.js.map +2 -2
- package/dist/packages/provenance.js +1 -178
- package/dist/packages/provenance.js.map +2 -2
- package/dist/packages/registry.js +1 -28
- package/dist/packages/registry.js.map +2 -2
- package/dist/packages/specs.js +1 -83
- package/dist/packages/specs.js.map +2 -2
- package/dist/packages/validation.js +1 -51
- package/dist/packages/validation.js.map +2 -2
- package/dist/packages.js +1 -129
- package/dist/packages.js.map +2 -2
- package/dist/path.js +1 -448
- package/dist/path.js.map +2 -2
- package/dist/paths.js +1 -143
- package/dist/paths.js.map +2 -2
- package/dist/performance.js +15 -216
- package/dist/performance.js.map +2 -2
- package/dist/promise-queue.js +1 -109
- package/dist/promise-queue.js.map +2 -2
- package/dist/promises.js +1 -269
- package/dist/promises.js.map +2 -2
- package/dist/prompts.js +1 -58
- package/dist/prompts.js.map +2 -2
- package/dist/regexps.js +1 -30
- package/dist/regexps.js.map +2 -2
- package/dist/sea.js +1 -44
- package/dist/sea.js.map +2 -2
- package/dist/shadow.js +1 -58
- package/dist/shadow.js.map +2 -2
- package/dist/signal-exit.js +1 -248
- package/dist/signal-exit.js.map +2 -2
- package/dist/sorts.js +1 -94
- package/dist/sorts.js.map +2 -2
- package/dist/spawn.js +1 -199
- package/dist/spawn.js.map +2 -2
- package/dist/spinner.js +1 -865
- package/dist/spinner.js.map +2 -2
- package/dist/ssri.js +1 -71
- package/dist/ssri.js.map +2 -2
- package/dist/stdio/clear.js +1 -82
- package/dist/stdio/clear.js.map +2 -2
- package/dist/stdio/divider.js +3 -89
- package/dist/stdio/divider.js.map +2 -2
- package/dist/stdio/footer.js +2 -94
- package/dist/stdio/footer.js.map +2 -2
- package/dist/stdio/header.js +2 -100
- package/dist/stdio/header.js.map +2 -2
- package/dist/stdio/mask.js +5 -206
- package/dist/stdio/mask.js.map +2 -2
- package/dist/stdio/progress.js +2 -209
- package/dist/stdio/progress.js.map +2 -2
- package/dist/stdio/prompts.js +1 -88
- package/dist/stdio/prompts.js.map +2 -2
- package/dist/stdio/stderr.js +2 -89
- package/dist/stdio/stderr.js.map +2 -2
- package/dist/stdio/stdout.js +2 -103
- package/dist/stdio/stdout.js.map +2 -2
- package/dist/streams.js +1 -78
- package/dist/streams.js.map +2 -2
- package/dist/strings.js +3 -251
- package/dist/strings.js.map +2 -2
- package/dist/suppress-warnings.js +1 -98
- package/dist/suppress-warnings.js.map +2 -2
- package/dist/tables.js +3 -128
- package/dist/tables.js.map +2 -2
- package/dist/temporary-executor.js +1 -53
- package/dist/temporary-executor.js.map +2 -2
- package/dist/types.js +1 -72
- package/dist/types.js.map +2 -2
- package/dist/url.js +1 -142
- package/dist/url.js.map +2 -2
- package/dist/utils/get-ipc.js +1 -58
- package/dist/utils/get-ipc.js.map +2 -2
- package/dist/validation/json-parser.js +1 -127
- package/dist/validation/json-parser.js.map +2 -2
- package/dist/validation/types.js +1 -15
- package/dist/validation/types.js.map +2 -2
- package/dist/versions.js +1 -153
- package/dist/versions.js.map +2 -2
- package/dist/words.js +1 -50
- package/dist/words.js.map +2 -2
- package/dist/zod.js +1 -27
- package/dist/zod.js.map +2 -2
- package/package.json +4 -4
package/dist/objects.js
CHANGED
|
@@ -1,321 +1,3 @@
|
|
|
1
1
|
/* Socket Lib - Built with esbuild */
|
|
2
|
-
var
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var objects_exports = {};
|
|
20
|
-
__export(objects_exports, {
|
|
21
|
-
createConstantsObject: () => createConstantsObject,
|
|
22
|
-
createLazyGetter: () => createLazyGetter,
|
|
23
|
-
defineGetter: () => defineGetter,
|
|
24
|
-
defineLazyGetter: () => defineLazyGetter,
|
|
25
|
-
defineLazyGetters: () => defineLazyGetters,
|
|
26
|
-
entryKeyComparator: () => entryKeyComparator,
|
|
27
|
-
getKeys: () => getKeys,
|
|
28
|
-
getOwn: () => getOwn,
|
|
29
|
-
getOwnPropertyValues: () => getOwnPropertyValues,
|
|
30
|
-
hasKeys: () => hasKeys,
|
|
31
|
-
hasOwn: () => hasOwn,
|
|
32
|
-
isObject: () => isObject,
|
|
33
|
-
isObjectObject: () => isObjectObject,
|
|
34
|
-
merge: () => merge,
|
|
35
|
-
objectAssign: () => objectAssign,
|
|
36
|
-
objectEntries: () => objectEntries,
|
|
37
|
-
objectFreeze: () => objectFreeze,
|
|
38
|
-
toSortedObject: () => toSortedObject,
|
|
39
|
-
toSortedObjectFromEntries: () => toSortedObjectFromEntries
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(objects_exports);
|
|
42
|
-
var import_core = require("#constants/core");
|
|
43
|
-
var import_arrays = require("./arrays");
|
|
44
|
-
var import_sorts = require("./sorts");
|
|
45
|
-
const ObjectDefineProperties = Object.defineProperties;
|
|
46
|
-
const ObjectDefineProperty = Object.defineProperty;
|
|
47
|
-
const ObjectFreeze = Object.freeze;
|
|
48
|
-
const ObjectFromEntries = Object.fromEntries;
|
|
49
|
-
const ObjectGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
|
|
50
|
-
const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames;
|
|
51
|
-
const ObjectGetPrototypeOf = Object.getPrototypeOf;
|
|
52
|
-
const ObjectHasOwn = Object.hasOwn;
|
|
53
|
-
const ObjectKeys = Object.keys;
|
|
54
|
-
const ObjectPrototype = Object.prototype;
|
|
55
|
-
const ObjectSetPrototypeOf = Object.setPrototypeOf;
|
|
56
|
-
const __defineGetter__ = Object.prototype.__defineGetter__;
|
|
57
|
-
const ReflectOwnKeys = Reflect.ownKeys;
|
|
58
|
-
// @__NO_SIDE_EFFECTS__
|
|
59
|
-
function createLazyGetter(name, getter, stats) {
|
|
60
|
-
let lazyValue = import_core.UNDEFINED_TOKEN;
|
|
61
|
-
const { [name]: lazyGetter } = {
|
|
62
|
-
[name]() {
|
|
63
|
-
if (lazyValue === import_core.UNDEFINED_TOKEN) {
|
|
64
|
-
stats?.initialized?.add(name);
|
|
65
|
-
lazyValue = getter();
|
|
66
|
-
}
|
|
67
|
-
return lazyValue;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
return lazyGetter;
|
|
71
|
-
}
|
|
72
|
-
// @__NO_SIDE_EFFECTS__
|
|
73
|
-
function createConstantsObject(props, options_) {
|
|
74
|
-
const options = { __proto__: null, ...options_ };
|
|
75
|
-
const attributes = ObjectFreeze({
|
|
76
|
-
__proto__: null,
|
|
77
|
-
getters: options.getters ? ObjectFreeze(
|
|
78
|
-
ObjectSetPrototypeOf(/* @__PURE__ */ toSortedObject(options.getters), null)
|
|
79
|
-
) : void 0,
|
|
80
|
-
internals: options.internals ? ObjectFreeze(
|
|
81
|
-
ObjectSetPrototypeOf(/* @__PURE__ */ toSortedObject(options.internals), null)
|
|
82
|
-
) : void 0,
|
|
83
|
-
mixin: options.mixin ? ObjectFreeze(
|
|
84
|
-
ObjectDefineProperties(
|
|
85
|
-
{ __proto__: null },
|
|
86
|
-
ObjectGetOwnPropertyDescriptors(options.mixin)
|
|
87
|
-
)
|
|
88
|
-
) : void 0,
|
|
89
|
-
props: props ? ObjectFreeze(ObjectSetPrototypeOf(/* @__PURE__ */ toSortedObject(props), null)) : void 0
|
|
90
|
-
});
|
|
91
|
-
const lazyGetterStats = ObjectFreeze({
|
|
92
|
-
__proto__: null,
|
|
93
|
-
initialized: /* @__PURE__ */ new Set()
|
|
94
|
-
});
|
|
95
|
-
const object = /* @__PURE__ */ defineLazyGetters(
|
|
96
|
-
{
|
|
97
|
-
__proto__: null,
|
|
98
|
-
[import_core.kInternalsSymbol]: ObjectFreeze({
|
|
99
|
-
__proto__: null,
|
|
100
|
-
get attributes() {
|
|
101
|
-
return attributes;
|
|
102
|
-
},
|
|
103
|
-
get lazyGetterStats() {
|
|
104
|
-
return lazyGetterStats;
|
|
105
|
-
},
|
|
106
|
-
...attributes.internals
|
|
107
|
-
}),
|
|
108
|
-
kInternalsSymbol: import_core.kInternalsSymbol,
|
|
109
|
-
...attributes.props
|
|
110
|
-
},
|
|
111
|
-
attributes.getters,
|
|
112
|
-
lazyGetterStats
|
|
113
|
-
);
|
|
114
|
-
if (attributes.mixin) {
|
|
115
|
-
ObjectDefineProperties(
|
|
116
|
-
object,
|
|
117
|
-
/* @__PURE__ */ toSortedObjectFromEntries(
|
|
118
|
-
(/* @__PURE__ */ objectEntries(ObjectGetOwnPropertyDescriptors(attributes.mixin))).filter(
|
|
119
|
-
(p) => !ObjectHasOwn(object, p[0])
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
return ObjectFreeze(object);
|
|
125
|
-
}
|
|
126
|
-
// @__NO_SIDE_EFFECTS__
|
|
127
|
-
function defineGetter(object, propKey, getter) {
|
|
128
|
-
ObjectDefineProperty(object, propKey, {
|
|
129
|
-
get: getter,
|
|
130
|
-
enumerable: false,
|
|
131
|
-
configurable: true
|
|
132
|
-
});
|
|
133
|
-
return object;
|
|
134
|
-
}
|
|
135
|
-
// @__NO_SIDE_EFFECTS__
|
|
136
|
-
function defineLazyGetter(object, propKey, getter, stats) {
|
|
137
|
-
return /* @__PURE__ */ defineGetter(object, propKey, /* @__PURE__ */ createLazyGetter(propKey, getter, stats));
|
|
138
|
-
}
|
|
139
|
-
// @__NO_SIDE_EFFECTS__
|
|
140
|
-
function defineLazyGetters(object, getterDefObj, stats) {
|
|
141
|
-
if (getterDefObj !== null && typeof getterDefObj === "object") {
|
|
142
|
-
const keys = ReflectOwnKeys(getterDefObj);
|
|
143
|
-
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
144
|
-
const key = keys[i];
|
|
145
|
-
/* @__PURE__ */ defineLazyGetter(
|
|
146
|
-
object,
|
|
147
|
-
key,
|
|
148
|
-
/* @__PURE__ */ createLazyGetter(key, getterDefObj[key], stats)
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return object;
|
|
153
|
-
}
|
|
154
|
-
// @__NO_SIDE_EFFECTS__
|
|
155
|
-
function entryKeyComparator(a, b) {
|
|
156
|
-
const keyA = a[0];
|
|
157
|
-
const keyB = b[0];
|
|
158
|
-
const strKeyA = typeof keyA === "string" ? keyA : String(keyA);
|
|
159
|
-
const strKeyB = typeof keyB === "string" ? keyB : String(keyB);
|
|
160
|
-
return (0, import_sorts.localeCompare)(strKeyA, strKeyB);
|
|
161
|
-
}
|
|
162
|
-
// @__NO_SIDE_EFFECTS__
|
|
163
|
-
function getKeys(obj) {
|
|
164
|
-
return /* @__PURE__ */ isObject(obj) ? ObjectKeys(obj) : [];
|
|
165
|
-
}
|
|
166
|
-
// @__NO_SIDE_EFFECTS__
|
|
167
|
-
function getOwn(obj, propKey) {
|
|
168
|
-
if (obj === null || obj === void 0) {
|
|
169
|
-
return void 0;
|
|
170
|
-
}
|
|
171
|
-
return ObjectHasOwn(obj, propKey) ? obj[propKey] : void 0;
|
|
172
|
-
}
|
|
173
|
-
// @__NO_SIDE_EFFECTS__
|
|
174
|
-
function getOwnPropertyValues(obj) {
|
|
175
|
-
if (obj === null || obj === void 0) {
|
|
176
|
-
return [];
|
|
177
|
-
}
|
|
178
|
-
const keys = ObjectGetOwnPropertyNames(obj);
|
|
179
|
-
const { length } = keys;
|
|
180
|
-
const values = Array(length);
|
|
181
|
-
for (let i = 0; i < length; i += 1) {
|
|
182
|
-
values[i] = obj[keys[i]];
|
|
183
|
-
}
|
|
184
|
-
return values;
|
|
185
|
-
}
|
|
186
|
-
// @__NO_SIDE_EFFECTS__
|
|
187
|
-
function hasKeys(obj) {
|
|
188
|
-
if (obj === null || obj === void 0) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
for (const key in obj) {
|
|
192
|
-
if (ObjectHasOwn(obj, key)) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
// @__NO_SIDE_EFFECTS__
|
|
199
|
-
function hasOwn(obj, propKey) {
|
|
200
|
-
if (obj === null || obj === void 0) {
|
|
201
|
-
return false;
|
|
202
|
-
}
|
|
203
|
-
return ObjectHasOwn(obj, propKey);
|
|
204
|
-
}
|
|
205
|
-
// @__NO_SIDE_EFFECTS__
|
|
206
|
-
function isObject(value) {
|
|
207
|
-
return value !== null && typeof value === "object";
|
|
208
|
-
}
|
|
209
|
-
// @__NO_SIDE_EFFECTS__
|
|
210
|
-
function isObjectObject(value) {
|
|
211
|
-
if (value === null || typeof value !== "object" || (0, import_arrays.isArray)(value)) {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
const proto = ObjectGetPrototypeOf(value);
|
|
215
|
-
return proto === null || proto === ObjectPrototype;
|
|
216
|
-
}
|
|
217
|
-
const objectAssign = Object.assign;
|
|
218
|
-
// @__NO_SIDE_EFFECTS__
|
|
219
|
-
function objectEntries(obj) {
|
|
220
|
-
if (obj === null || obj === void 0) {
|
|
221
|
-
return [];
|
|
222
|
-
}
|
|
223
|
-
const keys = ReflectOwnKeys(obj);
|
|
224
|
-
const { length } = keys;
|
|
225
|
-
const entries = Array(length);
|
|
226
|
-
const record = obj;
|
|
227
|
-
for (let i = 0; i < length; i += 1) {
|
|
228
|
-
const key = keys[i];
|
|
229
|
-
entries[i] = [key, record[key]];
|
|
230
|
-
}
|
|
231
|
-
return entries;
|
|
232
|
-
}
|
|
233
|
-
const objectFreeze = Object.freeze;
|
|
234
|
-
// @__NO_SIDE_EFFECTS__
|
|
235
|
-
function merge(target, source) {
|
|
236
|
-
if (!/* @__PURE__ */ isObject(target) || !/* @__PURE__ */ isObject(source)) {
|
|
237
|
-
return target;
|
|
238
|
-
}
|
|
239
|
-
const queue = [[target, source]];
|
|
240
|
-
let pos = 0;
|
|
241
|
-
let { length: queueLength } = queue;
|
|
242
|
-
while (pos < queueLength) {
|
|
243
|
-
if (pos === import_core.LOOP_SENTINEL) {
|
|
244
|
-
throw new Error("Detected infinite loop in object crawl of merge");
|
|
245
|
-
}
|
|
246
|
-
const { 0: currentTarget, 1: currentSource } = queue[pos++];
|
|
247
|
-
if (!currentSource || !currentTarget) {
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
const isSourceArray = (0, import_arrays.isArray)(currentSource);
|
|
251
|
-
const isTargetArray = (0, import_arrays.isArray)(currentTarget);
|
|
252
|
-
if (isSourceArray || isTargetArray) {
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
const keys = ReflectOwnKeys(currentSource);
|
|
256
|
-
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
257
|
-
const key = keys[i];
|
|
258
|
-
const srcVal = currentSource[key];
|
|
259
|
-
const targetVal = currentTarget[key];
|
|
260
|
-
if ((0, import_arrays.isArray)(srcVal)) {
|
|
261
|
-
currentTarget[key] = srcVal;
|
|
262
|
-
} else if (/* @__PURE__ */ isObject(srcVal)) {
|
|
263
|
-
if (/* @__PURE__ */ isObject(targetVal) && !(0, import_arrays.isArray)(targetVal)) {
|
|
264
|
-
queue[queueLength++] = [targetVal, srcVal];
|
|
265
|
-
} else {
|
|
266
|
-
currentTarget[key] = srcVal;
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
currentTarget[key] = srcVal;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return target;
|
|
274
|
-
}
|
|
275
|
-
// @__NO_SIDE_EFFECTS__
|
|
276
|
-
function toSortedObject(obj) {
|
|
277
|
-
return /* @__PURE__ */ toSortedObjectFromEntries(/* @__PURE__ */ objectEntries(obj));
|
|
278
|
-
}
|
|
279
|
-
// @__NO_SIDE_EFFECTS__
|
|
280
|
-
function toSortedObjectFromEntries(entries) {
|
|
281
|
-
const otherEntries = [];
|
|
282
|
-
const symbolEntries = [];
|
|
283
|
-
for (const entry of entries) {
|
|
284
|
-
if (typeof entry[0] === "symbol") {
|
|
285
|
-
symbolEntries.push(entry);
|
|
286
|
-
} else {
|
|
287
|
-
otherEntries.push(entry);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (!otherEntries.length && !symbolEntries.length) {
|
|
291
|
-
return {};
|
|
292
|
-
}
|
|
293
|
-
return ObjectFromEntries([
|
|
294
|
-
// The String constructor is safe to use with symbols.
|
|
295
|
-
...symbolEntries.sort(entryKeyComparator),
|
|
296
|
-
...otherEntries.sort(entryKeyComparator)
|
|
297
|
-
]);
|
|
298
|
-
}
|
|
299
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
300
|
-
0 && (module.exports = {
|
|
301
|
-
createConstantsObject,
|
|
302
|
-
createLazyGetter,
|
|
303
|
-
defineGetter,
|
|
304
|
-
defineLazyGetter,
|
|
305
|
-
defineLazyGetters,
|
|
306
|
-
entryKeyComparator,
|
|
307
|
-
getKeys,
|
|
308
|
-
getOwn,
|
|
309
|
-
getOwnPropertyValues,
|
|
310
|
-
hasKeys,
|
|
311
|
-
hasOwn,
|
|
312
|
-
isObject,
|
|
313
|
-
isObjectObject,
|
|
314
|
-
merge,
|
|
315
|
-
objectAssign,
|
|
316
|
-
objectEntries,
|
|
317
|
-
objectFreeze,
|
|
318
|
-
toSortedObject,
|
|
319
|
-
toSortedObjectFromEntries
|
|
320
|
-
});
|
|
2
|
+
var j=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var n in t)j(e,n,{get:t[n],enumerable:!0})},U=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of A(t))!N.call(e,o)&&o!==n&&j(e,o,{get:()=>t[o],enumerable:!(r=R(t,o))||r.enumerable});return e};var F=e=>U(j({},"__esModule",{value:!0}),e);var ne={};C(ne,{createConstantsObject:()=>v,createLazyGetter:()=>G,defineGetter:()=>z,defineLazyGetter:()=>S,defineLazyGetters:()=>h,entryKeyComparator:()=>P,getKeys:()=>J,getOwn:()=>Q,getOwnPropertyValues:()=>W,hasKeys:()=>X,hasOwn:()=>Y,isObject:()=>f,isObjectObject:()=>Z,merge:()=>te,objectAssign:()=>$,objectEntries:()=>T,objectFreeze:()=>ee,toSortedObject:()=>l,toSortedObjectFromEntries:()=>K});module.exports=F(ne);var y=require("#constants/core"),p=require("./arrays"),m=require("./sorts");const g=Object.defineProperties,B=Object.defineProperty,i=Object.freeze,I=Object.fromEntries,x=Object.getOwnPropertyDescriptors,V=Object.getOwnPropertyNames,q=Object.getPrototypeOf,d=Object.hasOwn,H=Object.keys,M=Object.prototype,k=Object.setPrototypeOf;const w=Reflect.ownKeys;function G(e,t,n){let r=y.UNDEFINED_TOKEN;const{[e]:o}={[e](){return r===y.UNDEFINED_TOKEN&&(n?.initialized?.add(e),r=t()),r}};return o}function v(e,t){const n={__proto__:null,...t},r=i({__proto__:null,getters:n.getters?i(k(l(n.getters),null)):void 0,internals:n.internals?i(k(l(n.internals),null)):void 0,mixin:n.mixin?i(g({__proto__:null},x(n.mixin))):void 0,props:e?i(k(l(e),null)):void 0}),o=i({__proto__:null,initialized:new Set}),s=h({__proto__:null,[y.kInternalsSymbol]:i({__proto__:null,get attributes(){return r},get lazyGetterStats(){return o},...r.internals}),kInternalsSymbol:y.kInternalsSymbol,...r.props},r.getters,o);return r.mixin&&g(s,K(T(x(r.mixin)).filter(c=>!d(s,c[0])))),i(s)}function z(e,t,n){return B(e,t,{get:n,enumerable:!1,configurable:!0}),e}function S(e,t,n,r){return z(e,t,G(t,n,r))}function h(e,t,n){if(t!==null&&typeof t=="object"){const r=w(t);for(let o=0,{length:s}=r;o<s;o+=1){const c=r[o];S(e,c,t[c],n)}}return e}function P(e,t){const n=e[0],r=t[0],o=typeof n=="string"?n:String(n),s=typeof r=="string"?r:String(r);return(0,m.localeCompare)(o,s)}function J(e){return f(e)?H(e):[]}function Q(e,t){if(e!=null)return d(e,t)?e[t]:void 0}function W(e){if(e==null)return[];const t=V(e),{length:n}=t,r=Array(n);for(let o=0;o<n;o+=1)r[o]=e[t[o]];return r}function X(e){if(e==null)return!1;for(const t in e)if(d(e,t))return!0;return!1}function Y(e,t){return e==null?!1:d(e,t)}function f(e){return e!==null&&typeof e=="object"}function Z(e){if(e===null||typeof e!="object"||(0,p.isArray)(e))return!1;const t=q(e);return t===null||t===M}const $=Object.assign;function T(e){if(e==null)return[];const t=w(e),{length:n}=t,r=Array(n),o=e;for(let s=0;s<n;s+=1){const c=t[s];r[s]=[c,o[c]]}return r}const ee=Object.freeze;function te(e,t){if(!f(e)||!f(t))return e;const n=[[e,t]];let r=0,{length:o}=n;for(;r<o;){if(r===y.LOOP_SENTINEL)throw new Error("Detected infinite loop in object crawl of merge");const{0:s,1:c}=n[r++];if(!c||!s)continue;const E=(0,p.isArray)(c),L=(0,p.isArray)(s);if(E||L)continue;const _=w(c);for(let O=0,{length:D}=_;O<D;O+=1){const a=_[O],u=c[a],b=s[a];(0,p.isArray)(u)?s[a]=u:f(u)&&f(b)&&!(0,p.isArray)(b)?n[o++]=[b,u]:s[a]=u}}return e}function l(e){return K(T(e))}function K(e){const t=[],n=[];for(const r of e)typeof r[0]=="symbol"?n.push(r):t.push(r);return!t.length&&!n.length?{}:I([...n.sort(P),...t.sort(P)])}0&&(module.exports={createConstantsObject,createLazyGetter,defineGetter,defineLazyGetter,defineLazyGetters,entryKeyComparator,getKeys,getOwn,getOwnPropertyValues,hasKeys,hasOwn,isObject,isObjectObject,merge,objectAssign,objectEntries,objectFreeze,toSortedObject,toSortedObjectFromEntries});
|
|
321
3
|
//# sourceMappingURL=objects.js.map
|
package/dist/objects.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/objects.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Object manipulation and reflection utilities.\n * Provides type-safe object operations, property access, and structural helpers.\n */\n\nimport {\n kInternalsSymbol,\n LOOP_SENTINEL,\n UNDEFINED_TOKEN,\n} from '#constants/core'\n\nimport { isArray } from './arrays'\nimport { localeCompare } from './sorts'\n\n// Type definitions\n\n/**\n * Record of property keys mapped to getter functions.\n * Used for defining lazy getters on objects.\n */\ntype GetterDefObj = { [key: PropertyKey]: () => unknown }\n\n/**\n * Statistics tracking for lazy getter initialization.\n * Keeps track of which lazy getters have been accessed and initialized.\n */\ntype LazyGetterStats = { initialized?: Set<PropertyKey> | undefined }\n\n/**\n * Configuration options for creating constants objects.\n */\ntype ConstantsObjectOptions = {\n /**\n * Lazy getter definitions to attach to the object.\n * @default undefined\n */\n getters?: GetterDefObj | undefined\n /**\n * Internal properties to store under `kInternalsSymbol`.\n * @default undefined\n */\n internals?: object | undefined\n /**\n * Properties to mix into the object (lower priority than `props`).\n * @default undefined\n */\n mixin?: object | undefined\n}\n\n/**\n * Type helper that creates a remapped type with fresh property mapping.\n * Useful for flattening intersection types into a single object type.\n */\ntype Remap<T> = { [K in keyof T]: T[K] } extends infer O\n ? { [K in keyof O]: O[K] }\n : never\n\n/**\n * Type for dynamic lazy getter record.\n */\ntype LazyGetterRecord<T> = {\n [key: PropertyKey]: () => T\n}\n\n/**\n * Type for generic property bag.\n */\ntype PropertyBag = {\n [key: PropertyKey]: unknown\n}\n\n/**\n * Type for generic sorted object entries.\n */\ntype SortedObject<T> = {\n [key: PropertyKey]: T\n}\n\nexport type { GetterDefObj, LazyGetterStats, ConstantsObjectOptions, Remap }\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst ObjectDefineProperties = Object.defineProperties\nconst ObjectDefineProperty = Object.defineProperty\nconst ObjectFreeze = Object.freeze\nconst ObjectFromEntries = Object.fromEntries\nconst ObjectGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors\nconst ObjectGetOwnPropertyNames = Object.getOwnPropertyNames\nconst ObjectGetPrototypeOf = Object.getPrototypeOf\nconst ObjectHasOwn = Object.hasOwn\nconst ObjectKeys = Object.keys\nconst ObjectPrototype = Object.prototype\nconst ObjectSetPrototypeOf = Object.setPrototypeOf\n// @ts-expect-error - __defineGetter__ exists but not in type definitions.\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst __defineGetter__ = Object.prototype.__defineGetter__\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst ReflectOwnKeys = Reflect.ownKeys\n\n/**\n * Create a lazy getter function that memoizes its result.\n *\n * The returned function will only call the getter once, caching the result\n * for subsequent calls. This is useful for expensive computations or\n * operations that should only happen when needed.\n *\n * @param name - The property key name for the getter (used for debugging and stats)\n * @param getter - Function that computes the value on first access\n * @param stats - Optional stats object to track initialization\n * @returns A memoized getter function\n *\n * @example\n * ```ts\n * const stats = { initialized: new Set() }\n * const getLargeData = createLazyGetter('data', () => {\n * console.log('Computing expensive data...')\n * return { large: 'dataset' }\n * }, stats)\n *\n * getLargeData() // Logs \"Computing expensive data...\" and returns data\n * getLargeData() // Returns cached data without logging\n * console.log(stats.initialized.has('data')) // true\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function createLazyGetter<T>(\n name: PropertyKey,\n getter: () => T,\n stats?: LazyGetterStats | undefined,\n): () => T {\n let lazyValue: T | typeof UNDEFINED_TOKEN = UNDEFINED_TOKEN\n // Dynamically name the getter without using Object.defineProperty.\n const { [name]: lazyGetter } = {\n [name]() {\n if (lazyValue === UNDEFINED_TOKEN) {\n stats?.initialized?.add(name)\n lazyValue = getter()\n }\n return lazyValue as T\n },\n } as LazyGetterRecord<T>\n return lazyGetter as unknown as () => T\n}\n\n/**\n * Create a frozen constants object with lazy getters and internal properties.\n *\n * This function creates an immutable object with:\n * - Regular properties from `props`\n * - Lazy getters that compute values on first access\n * - Internal properties accessible via `kInternalsSymbol`\n * - Mixin properties (lower priority, won't override existing)\n * - Alphabetically sorted keys for consistency\n *\n * The resulting object is deeply frozen and cannot be modified.\n *\n * @param props - Regular properties to include on the object\n * @param options_ - Configuration options\n * @returns A frozen object with all specified properties\n *\n * @example\n * ```ts\n * const config = createConstantsObject(\n * { apiUrl: 'https://api.example.com' },\n * {\n * getters: {\n * client: () => new APIClient(),\n * timestamp: () => Date.now()\n * },\n * internals: {\n * version: '1.0.0'\n * }\n * }\n * )\n *\n * console.log(config.apiUrl) // 'https://api.example.com'\n * console.log(config.client) // APIClient instance (computed on first access)\n * console.log(config[kInternalsSymbol].version) // '1.0.0'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function createConstantsObject(\n props: object,\n options_?: ConstantsObjectOptions | undefined,\n): Readonly<object> {\n const options = { __proto__: null, ...options_ } as ConstantsObjectOptions\n const attributes = ObjectFreeze({\n __proto__: null,\n getters: options.getters\n ? ObjectFreeze(\n ObjectSetPrototypeOf(toSortedObject(options.getters), null),\n )\n : undefined,\n internals: options.internals\n ? ObjectFreeze(\n ObjectSetPrototypeOf(toSortedObject(options.internals), null),\n )\n : undefined,\n mixin: options.mixin\n ? ObjectFreeze(\n ObjectDefineProperties(\n { __proto__: null },\n ObjectGetOwnPropertyDescriptors(options.mixin),\n ),\n )\n : undefined,\n props: props\n ? ObjectFreeze(ObjectSetPrototypeOf(toSortedObject(props), null))\n : undefined,\n })\n const lazyGetterStats = ObjectFreeze({\n __proto__: null,\n initialized: new Set<PropertyKey>(),\n })\n const object = defineLazyGetters(\n {\n __proto__: null,\n [kInternalsSymbol]: ObjectFreeze({\n __proto__: null,\n get attributes() {\n return attributes\n },\n get lazyGetterStats() {\n return lazyGetterStats\n },\n ...attributes.internals,\n }),\n kInternalsSymbol,\n ...attributes.props,\n },\n attributes.getters,\n lazyGetterStats,\n )\n if (attributes.mixin) {\n ObjectDefineProperties(\n object,\n toSortedObjectFromEntries(\n objectEntries(ObjectGetOwnPropertyDescriptors(attributes.mixin)).filter(\n p => !ObjectHasOwn(object, p[0]),\n ),\n ) as PropertyDescriptorMap,\n )\n }\n return ObjectFreeze(object)\n}\n\n/**\n * Define a getter property on an object.\n *\n * The getter is non-enumerable and configurable, meaning it won't show up\n * in `for...in` loops or `Object.keys()`, but can be redefined later.\n *\n * @param object - The object to define the getter on\n * @param propKey - The property key for the getter\n * @param getter - Function that computes the property value\n * @returns The modified object (for chaining)\n *\n * @example\n * ```ts\n * const obj = {}\n * defineGetter(obj, 'timestamp', () => Date.now())\n * console.log(obj.timestamp) // Current timestamp\n * console.log(obj.timestamp) // Different timestamp (computed each time)\n * console.log(Object.keys(obj)) // [] (non-enumerable)\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function defineGetter<T>(\n object: object,\n propKey: PropertyKey,\n getter: () => T,\n): object {\n ObjectDefineProperty(object, propKey, {\n get: getter,\n enumerable: false,\n configurable: true,\n })\n return object\n}\n\n/**\n * Define a lazy getter property on an object.\n *\n * Unlike `defineGetter()`, this version memoizes the result so the getter\n * function is only called once. Subsequent accesses return the cached value.\n *\n * @param object - The object to define the lazy getter on\n * @param propKey - The property key for the lazy getter\n * @param getter - Function that computes the value on first access\n * @param stats - Optional stats object to track initialization\n * @returns The modified object (for chaining)\n *\n * @example\n * ```ts\n * const obj = {}\n * defineLazyGetter(obj, 'data', () => {\n * console.log('Loading data...')\n * return { expensive: 'computation' }\n * })\n * console.log(obj.data) // Logs \"Loading data...\" and returns data\n * console.log(obj.data) // Returns same data without logging\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function defineLazyGetter<T>(\n object: object,\n propKey: PropertyKey,\n getter: () => T,\n stats?: LazyGetterStats | undefined,\n): object {\n return defineGetter(object, propKey, createLazyGetter(propKey, getter, stats))\n}\n\n/**\n * Define multiple lazy getter properties on an object.\n *\n * Each getter in the provided object will be converted to a lazy getter\n * and attached to the target object. All getters share the same stats object\n * for tracking initialization.\n *\n * @param object - The object to define lazy getters on\n * @param getterDefObj - Object mapping property keys to getter functions\n * @param stats - Optional stats object to track initialization\n * @returns The modified object (for chaining)\n *\n * @example\n * ```ts\n * const obj = {}\n * const stats = { initialized: new Set() }\n * defineLazyGetters(obj, {\n * user: () => fetchUser(),\n * config: () => loadConfig(),\n * timestamp: () => Date.now()\n * }, stats)\n *\n * console.log(obj.user) // Fetches user on first access\n * console.log(obj.config) // Loads config on first access\n * console.log(stats.initialized) // Set(['user', 'config'])\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function defineLazyGetters(\n object: object,\n getterDefObj: GetterDefObj | undefined,\n stats?: LazyGetterStats | undefined,\n): object {\n if (getterDefObj !== null && typeof getterDefObj === 'object') {\n const keys = ReflectOwnKeys(getterDefObj)\n for (let i = 0, { length } = keys; i < length; i += 1) {\n const key = keys[i] as PropertyKey\n defineLazyGetter(\n object,\n key,\n createLazyGetter(key, getterDefObj[key] as () => unknown, stats),\n )\n }\n }\n return object\n}\n\n/**\n * Compare two entry arrays by their keys for sorting.\n *\n * Used internally for alphabetically sorting object entries.\n * String keys are compared directly, non-string keys are converted to strings first.\n *\n * @param a - First entry tuple [key, value]\n * @param b - Second entry tuple [key, value]\n * @returns Negative if a < b, positive if a > b, zero if equal\n *\n * @example\n * ```ts\n * const entries = [['zebra', 1], ['apple', 2], ['banana', 3]]\n * entries.sort(entryKeyComparator)\n * // [['apple', 2], ['banana', 3], ['zebra', 1]]\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function entryKeyComparator(\n a: [PropertyKey, unknown],\n b: [PropertyKey, unknown],\n): number {\n const keyA = a[0]\n const keyB = b[0]\n const strKeyA = typeof keyA === 'string' ? keyA : String(keyA)\n const strKeyB = typeof keyB === 'string' ? keyB : String(keyB)\n return localeCompare(strKeyA, strKeyB)\n}\n\n/**\n * Get the enumerable own property keys of an object.\n *\n * This is a safe wrapper around `Object.keys()` that returns an empty array\n * for non-object values instead of throwing an error.\n *\n * @param obj - The value to get keys from\n * @returns Array of enumerable string keys, or empty array for non-objects\n *\n * @example\n * ```ts\n * getKeys({ a: 1, b: 2 }) // ['a', 'b']\n * getKeys([10, 20, 30]) // ['0', '1', '2']\n * getKeys(null) // []\n * getKeys(undefined) // []\n * getKeys('hello') // []\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function getKeys(obj: unknown): string[] {\n return isObject(obj) ? ObjectKeys(obj) : []\n}\n\n/**\n * Get an own property value from an object safely.\n *\n * Returns `undefined` if the value is null/undefined or if the property\n * doesn't exist as an own property (not inherited). This avoids prototype\n * chain lookups and prevents errors on null/undefined values.\n *\n * @param obj - The object to get the property from\n * @param propKey - The property key to look up\n * @returns The property value, or `undefined` if not found or obj is null/undefined\n *\n * @example\n * ```ts\n * const obj = { name: 'Alice', age: 30 }\n * getOwn(obj, 'name') // 'Alice'\n * getOwn(obj, 'missing') // undefined\n * getOwn(obj, 'toString') // undefined (inherited, not own property)\n * getOwn(null, 'name') // undefined\n * getOwn(undefined, 'name') // undefined\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function getOwn(obj: unknown, propKey: PropertyKey): unknown {\n if (obj === null || obj === undefined) {\n return undefined\n }\n return ObjectHasOwn(obj as object, propKey)\n ? (obj as Record<PropertyKey, unknown>)[propKey]\n : undefined\n}\n\n/**\n * Get all own property values from an object.\n *\n * Returns values for all own properties (enumerable and non-enumerable),\n * but not inherited properties. Returns an empty array for null/undefined.\n *\n * @param obj - The object to get values from\n * @returns Array of all own property values, or empty array for null/undefined\n *\n * @example\n * ```ts\n * getOwnPropertyValues({ a: 1, b: 2, c: 3 }) // [1, 2, 3]\n * getOwnPropertyValues([10, 20, 30]) // [10, 20, 30]\n * getOwnPropertyValues(null) // []\n * getOwnPropertyValues(undefined) // []\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function getOwnPropertyValues<T>(\n obj: { [key: PropertyKey]: T } | null | undefined,\n): T[] {\n if (obj === null || obj === undefined) {\n return []\n }\n const keys = ObjectGetOwnPropertyNames(obj)\n const { length } = keys\n const values = Array(length)\n for (let i = 0; i < length; i += 1) {\n values[i] = obj[keys[i] as string]\n }\n return values\n}\n\n/**\n * Check if an object has any enumerable own properties.\n *\n * Returns `true` if the object has at least one enumerable own property,\n * `false` otherwise. Also returns `false` for null/undefined.\n *\n * @param obj - The value to check\n * @returns `true` if obj has enumerable own properties, `false` otherwise\n *\n * @example\n * ```ts\n * hasKeys({ a: 1 }) // true\n * hasKeys({}) // false\n * hasKeys([]) // false\n * hasKeys([1, 2]) // true\n * hasKeys(null) // false\n * hasKeys(undefined) // false\n * hasKeys(Object.create({ inherited: true })) // false (inherited, not own)\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function hasKeys(obj: unknown): obj is PropertyBag {\n if (obj === null || obj === undefined) {\n return false\n }\n for (const key in obj as object) {\n if (ObjectHasOwn(obj as object, key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * Check if an object has an own property.\n *\n * Type-safe wrapper around `Object.hasOwn()` that returns `false` for\n * null/undefined instead of throwing. Only checks own properties, not\n * inherited ones from the prototype chain.\n *\n * @param obj - The value to check\n * @param propKey - The property key to look for\n * @returns `true` if obj has the property as an own property, `false` otherwise\n *\n * @example\n * ```ts\n * const obj = { name: 'Alice' }\n * hasOwn(obj, 'name') // true\n * hasOwn(obj, 'age') // false\n * hasOwn(obj, 'toString') // false (inherited from Object.prototype)\n * hasOwn(null, 'name') // false\n * hasOwn(undefined, 'name') // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function hasOwn(\n obj: unknown,\n propKey: PropertyKey,\n): obj is object & PropertyBag {\n if (obj === null || obj === undefined) {\n return false\n }\n return ObjectHasOwn(obj as object, propKey)\n}\n\n/**\n * Check if a value is an object (including arrays).\n *\n * Returns `true` for any object type including arrays, functions, dates, etc.\n * Returns `false` for primitives and `null`.\n *\n * @param value - The value to check\n * @returns `true` if value is an object (including arrays), `false` otherwise\n *\n * @example\n * ```ts\n * isObject({}) // true\n * isObject([]) // true\n * isObject(new Date()) // true\n * isObject(() => {}) // false (functions are not objects for typeof)\n * isObject(null) // false\n * isObject(undefined) // false\n * isObject(42) // false\n * isObject('string') // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isObject(\n value: unknown,\n): value is { [key: PropertyKey]: unknown } {\n return value !== null && typeof value === 'object'\n}\n\n/**\n * Check if a value is a plain object (not an array, not a built-in).\n *\n * Returns `true` only for plain objects created with `{}` or `Object.create(null)`.\n * Returns `false` for arrays, built-in objects (Date, RegExp, etc.), and primitives.\n *\n * @param value - The value to check\n * @returns `true` if value is a plain object, `false` otherwise\n *\n * @example\n * ```ts\n * isObjectObject({}) // true\n * isObjectObject({ a: 1 }) // true\n * isObjectObject(Object.create(null)) // true\n * isObjectObject([]) // false\n * isObjectObject(new Date()) // false\n * isObjectObject(null) // false\n * isObjectObject(42) // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isObjectObject(\n value: unknown,\n): value is { [key: PropertyKey]: unknown } {\n if (value === null || typeof value !== 'object' || isArray(value)) {\n return false\n }\n const proto = ObjectGetPrototypeOf(value)\n return proto === null || proto === ObjectPrototype\n}\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\n\n/**\n * Alias for native `Object.assign`.\n *\n * Copies all enumerable own properties from one or more source objects\n * to a target object and returns the modified target object.\n *\n * @example\n * ```ts\n * const target = { a: 1 }\n * const source = { b: 2, c: 3 }\n * objectAssign(target, source) // { a: 1, b: 2, c: 3 }\n * ```\n */\nexport const objectAssign = Object.assign\n\n/**\n * Get all own property entries (key-value pairs) from an object.\n *\n * Unlike `Object.entries()`, this includes non-enumerable properties and\n * symbol keys. Returns an empty array for null/undefined.\n *\n * @param obj - The object to get entries from\n * @returns Array of [key, value] tuples, or empty array for null/undefined\n *\n * @example\n * ```ts\n * objectEntries({ a: 1, b: 2 }) // [['a', 1], ['b', 2]]\n * const sym = Symbol('key')\n * objectEntries({ [sym]: 'value', x: 10 }) // [[Symbol(key), 'value'], ['x', 10]]\n * objectEntries(null) // []\n * objectEntries(undefined) // []\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function objectEntries(obj: unknown): Array<[PropertyKey, unknown]> {\n if (obj === null || obj === undefined) {\n return []\n }\n const keys = ReflectOwnKeys(obj as object)\n const { length } = keys\n const entries = Array(length)\n const record = obj as Record<PropertyKey, unknown>\n for (let i = 0; i < length; i += 1) {\n const key = keys[i] as PropertyKey\n entries[i] = [key, record[key]]\n }\n return entries\n}\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\n\n/**\n * Alias for native `Object.freeze`.\n *\n * Freezes an object, preventing new properties from being added and existing\n * properties from being removed or modified. Makes the object immutable.\n *\n * @example\n * ```ts\n * const obj = { a: 1 }\n * objectFreeze(obj)\n * obj.a = 2 // Silently fails in non-strict mode, throws in strict mode\n * obj.b = 3 // Silently fails in non-strict mode, throws in strict mode\n * ```\n */\nexport const objectFreeze = Object.freeze\n\n/**\n * Deep merge source object into target object.\n *\n * Recursively merges properties from `source` into `target`. Arrays in source\n * completely replace arrays in target (no element-wise merging). Objects are\n * merged recursively. Includes infinite loop detection for safety.\n *\n * @param target - The object to merge into (will be modified)\n * @param source - The object to merge from\n * @returns The modified target object\n *\n * @example\n * ```ts\n * const target = { a: { x: 1 }, b: [1, 2] }\n * const source = { a: { y: 2 }, b: [3, 4, 5], c: 3 }\n * merge(target, source)\n * // { a: { x: 1, y: 2 }, b: [3, 4, 5], c: 3 }\n * ```\n *\n * @example\n * ```ts\n * // Arrays are replaced, not merged\n * merge({ arr: [1, 2] }, { arr: [3] }) // { arr: [3] }\n *\n * // Deep object merging\n * merge(\n * { config: { api: 'v1', timeout: 1000 } },\n * { config: { api: 'v2', retries: 3 } }\n * )\n * // { config: { api: 'v2', timeout: 1000, retries: 3 } }\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function merge<T extends object, U extends object>(\n target: T,\n source: U,\n): T & U {\n if (!isObject(target) || !isObject(source)) {\n return target as T & U\n }\n const queue: Array<[unknown, unknown]> = [[target, source]]\n let pos = 0\n let { length: queueLength } = queue\n while (pos < queueLength) {\n if (pos === LOOP_SENTINEL) {\n throw new Error('Detected infinite loop in object crawl of merge')\n }\n const { 0: currentTarget, 1: currentSource } = queue[pos++] as [\n Record<PropertyKey, unknown>,\n Record<PropertyKey, unknown>,\n ]\n\n if (!currentSource || !currentTarget) {\n continue\n }\n\n const isSourceArray = isArray(currentSource)\n const isTargetArray = isArray(currentTarget)\n\n // Skip array merging - arrays in source replace arrays in target\n if (isSourceArray || isTargetArray) {\n continue\n }\n\n const keys = ReflectOwnKeys(currentSource as object)\n for (let i = 0, { length } = keys; i < length; i += 1) {\n const key = keys[i] as PropertyKey\n const srcVal = currentSource[key]\n const targetVal = currentTarget[key]\n if (isArray(srcVal)) {\n // Replace arrays entirely\n currentTarget[key] = srcVal\n } else if (isObject(srcVal)) {\n if (isObject(targetVal) && !isArray(targetVal)) {\n queue[queueLength++] = [targetVal, srcVal]\n } else {\n currentTarget[key] = srcVal\n }\n } else {\n currentTarget[key] = srcVal\n }\n }\n }\n return target as T & U\n}\n\n/**\n * Convert an object to a new object with sorted keys.\n *\n * Creates a new object with the same properties as the input, but with keys\n * sorted alphabetically. Symbol keys are sorted separately and placed first.\n * This is useful for consistent key ordering in serialization or comparisons.\n *\n * @param obj - The object to sort\n * @returns A new object with sorted keys\n *\n * @example\n * ```ts\n * toSortedObject({ z: 1, a: 2, m: 3 })\n * // { a: 2, m: 3, z: 1 }\n *\n * const sym1 = Symbol('first')\n * const sym2 = Symbol('second')\n * toSortedObject({ z: 1, [sym2]: 2, a: 3, [sym1]: 4 })\n * // { [Symbol(first)]: 4, [Symbol(second)]: 2, a: 3, z: 1 }\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function toSortedObject<T extends object>(obj: T): T {\n return toSortedObjectFromEntries(objectEntries(obj)) as T\n}\n\n/**\n * Create an object from entries with sorted keys.\n *\n * Takes an iterable of [key, value] entries and creates a new object with\n * keys sorted alphabetically. Symbol keys are sorted separately and placed\n * first in the resulting object.\n *\n * @param entries - Iterable of [key, value] tuples\n * @returns A new object with sorted keys\n *\n * @example\n * ```ts\n * toSortedObjectFromEntries([['z', 1], ['a', 2], ['m', 3]])\n * // { a: 2, m: 3, z: 1 }\n *\n * const entries = new Map([['beta', 2], ['alpha', 1], ['gamma', 3]])\n * toSortedObjectFromEntries(entries)\n * // { alpha: 1, beta: 2, gamma: 3 }\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function toSortedObjectFromEntries<T = unknown>(\n entries: Iterable<[PropertyKey, T]>,\n): SortedObject<T> {\n const otherEntries = []\n const symbolEntries = []\n // Use for-of to work with entries iterators.\n for (const entry of entries) {\n if (typeof entry[0] === 'symbol') {\n symbolEntries.push(entry)\n } else {\n otherEntries.push(entry)\n }\n }\n if (!otherEntries.length && !symbolEntries.length) {\n return {}\n }\n return ObjectFromEntries([\n // The String constructor is safe to use with symbols.\n ...symbolEntries.sort(entryKeyComparator),\n ...otherEntries.sort(entryKeyComparator),\n ])\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Object manipulation and reflection utilities.\n * Provides type-safe object operations, property access, and structural helpers.\n */\n\nimport {\n kInternalsSymbol,\n LOOP_SENTINEL,\n UNDEFINED_TOKEN,\n} from '#constants/core'\n\nimport { isArray } from './arrays'\nimport { localeCompare } from './sorts'\n\n// Type definitions\n\n/**\n * Record of property keys mapped to getter functions.\n * Used for defining lazy getters on objects.\n */\ntype GetterDefObj = { [key: PropertyKey]: () => unknown }\n\n/**\n * Statistics tracking for lazy getter initialization.\n * Keeps track of which lazy getters have been accessed and initialized.\n */\ntype LazyGetterStats = { initialized?: Set<PropertyKey> | undefined }\n\n/**\n * Configuration options for creating constants objects.\n */\ntype ConstantsObjectOptions = {\n /**\n * Lazy getter definitions to attach to the object.\n * @default undefined\n */\n getters?: GetterDefObj | undefined\n /**\n * Internal properties to store under `kInternalsSymbol`.\n * @default undefined\n */\n internals?: object | undefined\n /**\n * Properties to mix into the object (lower priority than `props`).\n * @default undefined\n */\n mixin?: object | undefined\n}\n\n/**\n * Type helper that creates a remapped type with fresh property mapping.\n * Useful for flattening intersection types into a single object type.\n */\ntype Remap<T> = { [K in keyof T]: T[K] } extends infer O\n ? { [K in keyof O]: O[K] }\n : never\n\n/**\n * Type for dynamic lazy getter record.\n */\ntype LazyGetterRecord<T> = {\n [key: PropertyKey]: () => T\n}\n\n/**\n * Type for generic property bag.\n */\ntype PropertyBag = {\n [key: PropertyKey]: unknown\n}\n\n/**\n * Type for generic sorted object entries.\n */\ntype SortedObject<T> = {\n [key: PropertyKey]: T\n}\n\nexport type { GetterDefObj, LazyGetterStats, ConstantsObjectOptions, Remap }\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst ObjectDefineProperties = Object.defineProperties\nconst ObjectDefineProperty = Object.defineProperty\nconst ObjectFreeze = Object.freeze\nconst ObjectFromEntries = Object.fromEntries\nconst ObjectGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors\nconst ObjectGetOwnPropertyNames = Object.getOwnPropertyNames\nconst ObjectGetPrototypeOf = Object.getPrototypeOf\nconst ObjectHasOwn = Object.hasOwn\nconst ObjectKeys = Object.keys\nconst ObjectPrototype = Object.prototype\nconst ObjectSetPrototypeOf = Object.setPrototypeOf\n// @ts-expect-error - __defineGetter__ exists but not in type definitions.\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst __defineGetter__ = Object.prototype.__defineGetter__\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\nconst ReflectOwnKeys = Reflect.ownKeys\n\n/**\n * Create a lazy getter function that memoizes its result.\n *\n * The returned function will only call the getter once, caching the result\n * for subsequent calls. This is useful for expensive computations or\n * operations that should only happen when needed.\n *\n * @param name - The property key name for the getter (used for debugging and stats)\n * @param getter - Function that computes the value on first access\n * @param stats - Optional stats object to track initialization\n * @returns A memoized getter function\n *\n * @example\n * ```ts\n * const stats = { initialized: new Set() }\n * const getLargeData = createLazyGetter('data', () => {\n * console.log('Computing expensive data...')\n * return { large: 'dataset' }\n * }, stats)\n *\n * getLargeData() // Logs \"Computing expensive data...\" and returns data\n * getLargeData() // Returns cached data without logging\n * console.log(stats.initialized.has('data')) // true\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function createLazyGetter<T>(\n name: PropertyKey,\n getter: () => T,\n stats?: LazyGetterStats | undefined,\n): () => T {\n let lazyValue: T | typeof UNDEFINED_TOKEN = UNDEFINED_TOKEN\n // Dynamically name the getter without using Object.defineProperty.\n const { [name]: lazyGetter } = {\n [name]() {\n if (lazyValue === UNDEFINED_TOKEN) {\n stats?.initialized?.add(name)\n lazyValue = getter()\n }\n return lazyValue as T\n },\n } as LazyGetterRecord<T>\n return lazyGetter as unknown as () => T\n}\n\n/**\n * Create a frozen constants object with lazy getters and internal properties.\n *\n * This function creates an immutable object with:\n * - Regular properties from `props`\n * - Lazy getters that compute values on first access\n * - Internal properties accessible via `kInternalsSymbol`\n * - Mixin properties (lower priority, won't override existing)\n * - Alphabetically sorted keys for consistency\n *\n * The resulting object is deeply frozen and cannot be modified.\n *\n * @param props - Regular properties to include on the object\n * @param options_ - Configuration options\n * @returns A frozen object with all specified properties\n *\n * @example\n * ```ts\n * const config = createConstantsObject(\n * { apiUrl: 'https://api.example.com' },\n * {\n * getters: {\n * client: () => new APIClient(),\n * timestamp: () => Date.now()\n * },\n * internals: {\n * version: '1.0.0'\n * }\n * }\n * )\n *\n * console.log(config.apiUrl) // 'https://api.example.com'\n * console.log(config.client) // APIClient instance (computed on first access)\n * console.log(config[kInternalsSymbol].version) // '1.0.0'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function createConstantsObject(\n props: object,\n options_?: ConstantsObjectOptions | undefined,\n): Readonly<object> {\n const options = { __proto__: null, ...options_ } as ConstantsObjectOptions\n const attributes = ObjectFreeze({\n __proto__: null,\n getters: options.getters\n ? ObjectFreeze(\n ObjectSetPrototypeOf(toSortedObject(options.getters), null),\n )\n : undefined,\n internals: options.internals\n ? ObjectFreeze(\n ObjectSetPrototypeOf(toSortedObject(options.internals), null),\n )\n : undefined,\n mixin: options.mixin\n ? ObjectFreeze(\n ObjectDefineProperties(\n { __proto__: null },\n ObjectGetOwnPropertyDescriptors(options.mixin),\n ),\n )\n : undefined,\n props: props\n ? ObjectFreeze(ObjectSetPrototypeOf(toSortedObject(props), null))\n : undefined,\n })\n const lazyGetterStats = ObjectFreeze({\n __proto__: null,\n initialized: new Set<PropertyKey>(),\n })\n const object = defineLazyGetters(\n {\n __proto__: null,\n [kInternalsSymbol]: ObjectFreeze({\n __proto__: null,\n get attributes() {\n return attributes\n },\n get lazyGetterStats() {\n return lazyGetterStats\n },\n ...attributes.internals,\n }),\n kInternalsSymbol,\n ...attributes.props,\n },\n attributes.getters,\n lazyGetterStats,\n )\n if (attributes.mixin) {\n ObjectDefineProperties(\n object,\n toSortedObjectFromEntries(\n objectEntries(ObjectGetOwnPropertyDescriptors(attributes.mixin)).filter(\n p => !ObjectHasOwn(object, p[0]),\n ),\n ) as PropertyDescriptorMap,\n )\n }\n return ObjectFreeze(object)\n}\n\n/**\n * Define a getter property on an object.\n *\n * The getter is non-enumerable and configurable, meaning it won't show up\n * in `for...in` loops or `Object.keys()`, but can be redefined later.\n *\n * @param object - The object to define the getter on\n * @param propKey - The property key for the getter\n * @param getter - Function that computes the property value\n * @returns The modified object (for chaining)\n *\n * @example\n * ```ts\n * const obj = {}\n * defineGetter(obj, 'timestamp', () => Date.now())\n * console.log(obj.timestamp) // Current timestamp\n * console.log(obj.timestamp) // Different timestamp (computed each time)\n * console.log(Object.keys(obj)) // [] (non-enumerable)\n * ```\n */\nexport function defineGetter<T>(\n object: object,\n propKey: PropertyKey,\n getter: () => T,\n): object {\n ObjectDefineProperty(object, propKey, {\n get: getter,\n enumerable: false,\n configurable: true,\n })\n return object\n}\n\n/**\n * Define a lazy getter property on an object.\n *\n * Unlike `defineGetter()`, this version memoizes the result so the getter\n * function is only called once. Subsequent accesses return the cached value.\n *\n * @param object - The object to define the lazy getter on\n * @param propKey - The property key for the lazy getter\n * @param getter - Function that computes the value on first access\n * @param stats - Optional stats object to track initialization\n * @returns The modified object (for chaining)\n *\n * @example\n * ```ts\n * const obj = {}\n * defineLazyGetter(obj, 'data', () => {\n * console.log('Loading data...')\n * return { expensive: 'computation' }\n * })\n * console.log(obj.data) // Logs \"Loading data...\" and returns data\n * console.log(obj.data) // Returns same data without logging\n * ```\n */\nexport function defineLazyGetter<T>(\n object: object,\n propKey: PropertyKey,\n getter: () => T,\n stats?: LazyGetterStats | undefined,\n): object {\n return defineGetter(object, propKey, createLazyGetter(propKey, getter, stats))\n}\n\n/**\n * Define multiple lazy getter properties on an object.\n *\n * Each getter in the provided object will be converted to a lazy getter\n * and attached to the target object. All getters share the same stats object\n * for tracking initialization.\n *\n * @param object - The object to define lazy getters on\n * @param getterDefObj - Object mapping property keys to getter functions\n * @param stats - Optional stats object to track initialization\n * @returns The modified object (for chaining)\n *\n * @example\n * ```ts\n * const obj = {}\n * const stats = { initialized: new Set() }\n * defineLazyGetters(obj, {\n * user: () => fetchUser(),\n * config: () => loadConfig(),\n * timestamp: () => Date.now()\n * }, stats)\n *\n * console.log(obj.user) // Fetches user on first access\n * console.log(obj.config) // Loads config on first access\n * console.log(stats.initialized) // Set(['user', 'config'])\n * ```\n */\nexport function defineLazyGetters(\n object: object,\n getterDefObj: GetterDefObj | undefined,\n stats?: LazyGetterStats | undefined,\n): object {\n if (getterDefObj !== null && typeof getterDefObj === 'object') {\n const keys = ReflectOwnKeys(getterDefObj)\n for (let i = 0, { length } = keys; i < length; i += 1) {\n const key = keys[i] as PropertyKey\n defineLazyGetter(object, key, getterDefObj[key] as () => unknown, stats)\n }\n }\n return object\n}\n\n/**\n * Compare two entry arrays by their keys for sorting.\n *\n * Used internally for alphabetically sorting object entries.\n * String keys are compared directly, non-string keys are converted to strings first.\n *\n * @param a - First entry tuple [key, value]\n * @param b - Second entry tuple [key, value]\n * @returns Negative if a < b, positive if a > b, zero if equal\n *\n * @example\n * ```ts\n * const entries = [['zebra', 1], ['apple', 2], ['banana', 3]]\n * entries.sort(entryKeyComparator)\n * // [['apple', 2], ['banana', 3], ['zebra', 1]]\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function entryKeyComparator(\n a: [PropertyKey, unknown],\n b: [PropertyKey, unknown],\n): number {\n const keyA = a[0]\n const keyB = b[0]\n const strKeyA = typeof keyA === 'string' ? keyA : String(keyA)\n const strKeyB = typeof keyB === 'string' ? keyB : String(keyB)\n return localeCompare(strKeyA, strKeyB)\n}\n\n/**\n * Get the enumerable own property keys of an object.\n *\n * This is a safe wrapper around `Object.keys()` that returns an empty array\n * for non-object values instead of throwing an error.\n *\n * @param obj - The value to get keys from\n * @returns Array of enumerable string keys, or empty array for non-objects\n *\n * @example\n * ```ts\n * getKeys({ a: 1, b: 2 }) // ['a', 'b']\n * getKeys([10, 20, 30]) // ['0', '1', '2']\n * getKeys(null) // []\n * getKeys(undefined) // []\n * getKeys('hello') // []\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function getKeys(obj: unknown): string[] {\n return isObject(obj) ? ObjectKeys(obj) : []\n}\n\n/**\n * Get an own property value from an object safely.\n *\n * Returns `undefined` if the value is null/undefined or if the property\n * doesn't exist as an own property (not inherited). This avoids prototype\n * chain lookups and prevents errors on null/undefined values.\n *\n * @param obj - The object to get the property from\n * @param propKey - The property key to look up\n * @returns The property value, or `undefined` if not found or obj is null/undefined\n *\n * @example\n * ```ts\n * const obj = { name: 'Alice', age: 30 }\n * getOwn(obj, 'name') // 'Alice'\n * getOwn(obj, 'missing') // undefined\n * getOwn(obj, 'toString') // undefined (inherited, not own property)\n * getOwn(null, 'name') // undefined\n * getOwn(undefined, 'name') // undefined\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function getOwn(obj: unknown, propKey: PropertyKey): unknown {\n if (obj === null || obj === undefined) {\n return undefined\n }\n return ObjectHasOwn(obj as object, propKey)\n ? (obj as Record<PropertyKey, unknown>)[propKey]\n : undefined\n}\n\n/**\n * Get all own property values from an object.\n *\n * Returns values for all own properties (enumerable and non-enumerable),\n * but not inherited properties. Returns an empty array for null/undefined.\n *\n * @param obj - The object to get values from\n * @returns Array of all own property values, or empty array for null/undefined\n *\n * @example\n * ```ts\n * getOwnPropertyValues({ a: 1, b: 2, c: 3 }) // [1, 2, 3]\n * getOwnPropertyValues([10, 20, 30]) // [10, 20, 30]\n * getOwnPropertyValues(null) // []\n * getOwnPropertyValues(undefined) // []\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function getOwnPropertyValues<T>(\n obj: { [key: PropertyKey]: T } | null | undefined,\n): T[] {\n if (obj === null || obj === undefined) {\n return []\n }\n const keys = ObjectGetOwnPropertyNames(obj)\n const { length } = keys\n const values = Array(length)\n for (let i = 0; i < length; i += 1) {\n values[i] = obj[keys[i] as string]\n }\n return values\n}\n\n/**\n * Check if an object has any enumerable own properties.\n *\n * Returns `true` if the object has at least one enumerable own property,\n * `false` otherwise. Also returns `false` for null/undefined.\n *\n * @param obj - The value to check\n * @returns `true` if obj has enumerable own properties, `false` otherwise\n *\n * @example\n * ```ts\n * hasKeys({ a: 1 }) // true\n * hasKeys({}) // false\n * hasKeys([]) // false\n * hasKeys([1, 2]) // true\n * hasKeys(null) // false\n * hasKeys(undefined) // false\n * hasKeys(Object.create({ inherited: true })) // false (inherited, not own)\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function hasKeys(obj: unknown): obj is PropertyBag {\n if (obj === null || obj === undefined) {\n return false\n }\n for (const key in obj as object) {\n if (ObjectHasOwn(obj as object, key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * Check if an object has an own property.\n *\n * Type-safe wrapper around `Object.hasOwn()` that returns `false` for\n * null/undefined instead of throwing. Only checks own properties, not\n * inherited ones from the prototype chain.\n *\n * @param obj - The value to check\n * @param propKey - The property key to look for\n * @returns `true` if obj has the property as an own property, `false` otherwise\n *\n * @example\n * ```ts\n * const obj = { name: 'Alice' }\n * hasOwn(obj, 'name') // true\n * hasOwn(obj, 'age') // false\n * hasOwn(obj, 'toString') // false (inherited from Object.prototype)\n * hasOwn(null, 'name') // false\n * hasOwn(undefined, 'name') // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function hasOwn(\n obj: unknown,\n propKey: PropertyKey,\n): obj is object & PropertyBag {\n if (obj === null || obj === undefined) {\n return false\n }\n return ObjectHasOwn(obj as object, propKey)\n}\n\n/**\n * Check if a value is an object (including arrays).\n *\n * Returns `true` for any object type including arrays, functions, dates, etc.\n * Returns `false` for primitives and `null`.\n *\n * @param value - The value to check\n * @returns `true` if value is an object (including arrays), `false` otherwise\n *\n * @example\n * ```ts\n * isObject({}) // true\n * isObject([]) // true\n * isObject(new Date()) // true\n * isObject(() => {}) // false (functions are not objects for typeof)\n * isObject(null) // false\n * isObject(undefined) // false\n * isObject(42) // false\n * isObject('string') // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isObject(\n value: unknown,\n): value is { [key: PropertyKey]: unknown } {\n return value !== null && typeof value === 'object'\n}\n\n/**\n * Check if a value is a plain object (not an array, not a built-in).\n *\n * Returns `true` only for plain objects created with `{}` or `Object.create(null)`.\n * Returns `false` for arrays, built-in objects (Date, RegExp, etc.), and primitives.\n *\n * @param value - The value to check\n * @returns `true` if value is a plain object, `false` otherwise\n *\n * @example\n * ```ts\n * isObjectObject({}) // true\n * isObjectObject({ a: 1 }) // true\n * isObjectObject(Object.create(null)) // true\n * isObjectObject([]) // false\n * isObjectObject(new Date()) // false\n * isObjectObject(null) // false\n * isObjectObject(42) // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isObjectObject(\n value: unknown,\n): value is { [key: PropertyKey]: unknown } {\n if (value === null || typeof value !== 'object' || isArray(value)) {\n return false\n }\n const proto = ObjectGetPrototypeOf(value)\n return proto === null || proto === ObjectPrototype\n}\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\n\n/**\n * Alias for native `Object.assign`.\n *\n * Copies all enumerable own properties from one or more source objects\n * to a target object and returns the modified target object.\n *\n * @example\n * ```ts\n * const target = { a: 1 }\n * const source = { b: 2, c: 3 }\n * objectAssign(target, source) // { a: 1, b: 2, c: 3 }\n * ```\n */\nexport const objectAssign = Object.assign\n\n/**\n * Get all own property entries (key-value pairs) from an object.\n *\n * Unlike `Object.entries()`, this includes non-enumerable properties and\n * symbol keys. Returns an empty array for null/undefined.\n *\n * @param obj - The object to get entries from\n * @returns Array of [key, value] tuples, or empty array for null/undefined\n *\n * @example\n * ```ts\n * objectEntries({ a: 1, b: 2 }) // [['a', 1], ['b', 2]]\n * const sym = Symbol('key')\n * objectEntries({ [sym]: 'value', x: 10 }) // [[Symbol(key), 'value'], ['x', 10]]\n * objectEntries(null) // []\n * objectEntries(undefined) // []\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function objectEntries(obj: unknown): Array<[PropertyKey, unknown]> {\n if (obj === null || obj === undefined) {\n return []\n }\n const keys = ReflectOwnKeys(obj as object)\n const { length } = keys\n const entries = Array(length)\n const record = obj as Record<PropertyKey, unknown>\n for (let i = 0; i < length; i += 1) {\n const key = keys[i] as PropertyKey\n entries[i] = [key, record[key]]\n }\n return entries\n}\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\n\n/**\n * Alias for native `Object.freeze`.\n *\n * Freezes an object, preventing new properties from being added and existing\n * properties from being removed or modified. Makes the object immutable.\n *\n * @example\n * ```ts\n * const obj = { a: 1 }\n * objectFreeze(obj)\n * obj.a = 2 // Silently fails in non-strict mode, throws in strict mode\n * obj.b = 3 // Silently fails in non-strict mode, throws in strict mode\n * ```\n */\nexport const objectFreeze = Object.freeze\n\n/**\n * Deep merge source object into target object.\n *\n * Recursively merges properties from `source` into `target`. Arrays in source\n * completely replace arrays in target (no element-wise merging). Objects are\n * merged recursively. Includes infinite loop detection for safety.\n *\n * @param target - The object to merge into (will be modified)\n * @param source - The object to merge from\n * @returns The modified target object\n *\n * @example\n * ```ts\n * const target = { a: { x: 1 }, b: [1, 2] }\n * const source = { a: { y: 2 }, b: [3, 4, 5], c: 3 }\n * merge(target, source)\n * // { a: { x: 1, y: 2 }, b: [3, 4, 5], c: 3 }\n * ```\n *\n * @example\n * ```ts\n * // Arrays are replaced, not merged\n * merge({ arr: [1, 2] }, { arr: [3] }) // { arr: [3] }\n *\n * // Deep object merging\n * merge(\n * { config: { api: 'v1', timeout: 1000 } },\n * { config: { api: 'v2', retries: 3 } }\n * )\n * // { config: { api: 'v2', timeout: 1000, retries: 3 } }\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function merge<T extends object, U extends object>(\n target: T,\n source: U,\n): T & U {\n if (!isObject(target) || !isObject(source)) {\n return target as T & U\n }\n const queue: Array<[unknown, unknown]> = [[target, source]]\n let pos = 0\n let { length: queueLength } = queue\n while (pos < queueLength) {\n if (pos === LOOP_SENTINEL) {\n throw new Error('Detected infinite loop in object crawl of merge')\n }\n const { 0: currentTarget, 1: currentSource } = queue[pos++] as [\n Record<PropertyKey, unknown>,\n Record<PropertyKey, unknown>,\n ]\n\n if (!currentSource || !currentTarget) {\n continue\n }\n\n const isSourceArray = isArray(currentSource)\n const isTargetArray = isArray(currentTarget)\n\n // Skip array merging - arrays in source replace arrays in target\n if (isSourceArray || isTargetArray) {\n continue\n }\n\n const keys = ReflectOwnKeys(currentSource as object)\n for (let i = 0, { length } = keys; i < length; i += 1) {\n const key = keys[i] as PropertyKey\n const srcVal = currentSource[key]\n const targetVal = currentTarget[key]\n if (isArray(srcVal)) {\n // Replace arrays entirely\n currentTarget[key] = srcVal\n } else if (isObject(srcVal)) {\n if (isObject(targetVal) && !isArray(targetVal)) {\n queue[queueLength++] = [targetVal, srcVal]\n } else {\n currentTarget[key] = srcVal\n }\n } else {\n currentTarget[key] = srcVal\n }\n }\n }\n return target as T & U\n}\n\n/**\n * Convert an object to a new object with sorted keys.\n *\n * Creates a new object with the same properties as the input, but with keys\n * sorted alphabetically. Symbol keys are sorted separately and placed first.\n * This is useful for consistent key ordering in serialization or comparisons.\n *\n * @param obj - The object to sort\n * @returns A new object with sorted keys\n *\n * @example\n * ```ts\n * toSortedObject({ z: 1, a: 2, m: 3 })\n * // { a: 2, m: 3, z: 1 }\n *\n * const sym1 = Symbol('first')\n * const sym2 = Symbol('second')\n * toSortedObject({ z: 1, [sym2]: 2, a: 3, [sym1]: 4 })\n * // { [Symbol(first)]: 4, [Symbol(second)]: 2, a: 3, z: 1 }\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function toSortedObject<T extends object>(obj: T): T {\n return toSortedObjectFromEntries(objectEntries(obj)) as T\n}\n\n/**\n * Create an object from entries with sorted keys.\n *\n * Takes an iterable of [key, value] entries and creates a new object with\n * keys sorted alphabetically. Symbol keys are sorted separately and placed\n * first in the resulting object.\n *\n * @param entries - Iterable of [key, value] tuples\n * @returns A new object with sorted keys\n *\n * @example\n * ```ts\n * toSortedObjectFromEntries([['z', 1], ['a', 2], ['m', 3]])\n * // { a: 2, m: 3, z: 1 }\n *\n * const entries = new Map([['beta', 2], ['alpha', 1], ['gamma', 3]])\n * toSortedObjectFromEntries(entries)\n * // { alpha: 1, beta: 2, gamma: 3 }\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function toSortedObjectFromEntries<T = unknown>(\n entries: Iterable<[PropertyKey, T]>,\n): SortedObject<T> {\n const otherEntries = []\n const symbolEntries = []\n // Use for-of to work with entries iterators.\n for (const entry of entries) {\n if (typeof entry[0] === 'symbol') {\n symbolEntries.push(entry)\n } else {\n otherEntries.push(entry)\n }\n }\n if (!otherEntries.length && !symbolEntries.length) {\n return {}\n }\n return ObjectFromEntries([\n // The String constructor is safe to use with symbols.\n ...symbolEntries.sort(entryKeyComparator),\n ...otherEntries.sort(entryKeyComparator),\n ])\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["objects_exports", "__export", "createConstantsObject", "createLazyGetter", "defineGetter", "defineLazyGetter", "defineLazyGetters", "entryKeyComparator", "getKeys", "getOwn", "getOwnPropertyValues", "hasKeys", "hasOwn", "isObject", "isObjectObject", "merge", "objectAssign", "objectEntries", "objectFreeze", "toSortedObject", "toSortedObjectFromEntries", "__toCommonJS", "import_core", "import_arrays", "import_sorts", "ObjectDefineProperties", "ObjectDefineProperty", "ObjectFreeze", "ObjectFromEntries", "ObjectGetOwnPropertyDescriptors", "ObjectGetOwnPropertyNames", "ObjectGetPrototypeOf", "ObjectHasOwn", "ObjectKeys", "ObjectPrototype", "ObjectSetPrototypeOf", "ReflectOwnKeys", "createLazyGetter", "name", "getter", "stats", "lazyValue", "lazyGetter", "createConstantsObject", "props", "options_", "options", "attributes", "ObjectFreeze", "ObjectSetPrototypeOf", "toSortedObject", "ObjectDefineProperties", "ObjectGetOwnPropertyDescriptors", "lazyGetterStats", "object", "defineLazyGetters", "toSortedObjectFromEntries", "objectEntries", "p", "ObjectHasOwn", "defineGetter", "propKey", "ObjectDefineProperty", "defineLazyGetter", "getterDefObj", "keys", "i", "length", "key", "entryKeyComparator", "a", "b", "keyA", "keyB", "strKeyA", "strKeyB", "getKeys", "obj", "isObject", "ObjectKeys", "getOwn", "getOwnPropertyValues", "ObjectGetOwnPropertyNames", "values", "hasKeys", "hasOwn", "value", "isObjectObject", "proto", "ObjectGetPrototypeOf", "ObjectPrototype", "objectAssign", "entries", "record", "objectFreeze", "merge", "target", "source", "queue", "pos", "queueLength", "currentTarget", "currentSource", "isSourceArray", "isTargetArray", "srcVal", "targetVal", "otherEntries", "symbolEntries", "entry", "ObjectFromEntries"]
|
|
7
7
|
}
|