@visulima/object 1.0.8 → 1.0.10
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 +23 -0
- package/README.md +2 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +430 -430
- package/dist/index.d.mts +430 -430
- package/dist/index.d.ts +430 -430
- package/dist/index.mjs +9 -9
- package/dist/packem_shared/{getProperty-BuSUBWTY.cjs → getProperty-W4y1P_8H.cjs} +4 -4
- package/dist/packem_shared/{getProperty-CqSBQFGO.mjs → getProperty-uiEqCe4m.mjs} +4 -4
- package/package.json +3 -69
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as omit } from './packem_shared/omit-Bz46-jv-.mjs';
|
|
2
2
|
export { default as pick } from './packem_shared/pick-C9-E3eDJ.mjs';
|
|
3
|
-
export { deleteProperty, escapePath, getProperty, hasProperty, setProperty } from './packem_shared/getProperty-
|
|
3
|
+
export { deleteProperty, escapePath, getProperty, hasProperty, setProperty } from './packem_shared/getProperty-uiEqCe4m.mjs';
|
|
4
4
|
export { default as isPlainObject } from './packem_shared/isPlainObject-BEp1xndO.mjs';
|
|
5
5
|
|
|
6
6
|
var deeks = {};
|
|
@@ -15,7 +15,7 @@ function requireUtils () {
|
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
16
16
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
17
17
|
Object.defineProperty(utils, "__esModule", { value: true });
|
|
18
|
-
utils.isDocumentToRecurOn = utils.flatten = utils.unique =
|
|
18
|
+
utils.isDocumentToRecurOn = utils.flatten = utils.unique = void 0;
|
|
19
19
|
function unique(array) {
|
|
20
20
|
return [...new Set(array)];
|
|
21
21
|
}
|
|
@@ -53,8 +53,8 @@ function requireDeeks () {
|
|
|
53
53
|
(function (exports) {
|
|
54
54
|
var __defProp = Object.defineProperty;
|
|
55
55
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
56
|
-
var __createBinding = deeks.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
57
|
-
if (k2 ===
|
|
56
|
+
var __createBinding = deeks && deeks.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
57
|
+
if (k2 === void 0) k2 = k;
|
|
58
58
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
59
59
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
60
60
|
desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
@@ -63,15 +63,15 @@ function requireDeeks () {
|
|
|
63
63
|
}
|
|
64
64
|
Object.defineProperty(o, k2, desc);
|
|
65
65
|
} : function(o, m, k, k2) {
|
|
66
|
-
if (k2 ===
|
|
66
|
+
if (k2 === void 0) k2 = k;
|
|
67
67
|
o[k2] = m[k];
|
|
68
68
|
});
|
|
69
|
-
var __setModuleDefault = deeks.__setModuleDefault || (Object.create ? function(o, v) {
|
|
69
|
+
var __setModuleDefault = deeks && deeks.__setModuleDefault || (Object.create ? function(o, v) {
|
|
70
70
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
71
71
|
} : function(o, v) {
|
|
72
72
|
o["default"] = v;
|
|
73
73
|
});
|
|
74
|
-
var __importStar = deeks.__importStar || function(mod) {
|
|
74
|
+
var __importStar = deeks && deeks.__importStar || function(mod) {
|
|
75
75
|
if (mod && mod.__esModule) return mod;
|
|
76
76
|
var result = {};
|
|
77
77
|
if (mod != null) {
|
|
@@ -80,11 +80,11 @@ function requireDeeks () {
|
|
|
80
80
|
__setModuleDefault(result, mod);
|
|
81
81
|
return result;
|
|
82
82
|
};
|
|
83
|
-
var __exportStar = deeks.__exportStar || function(m, exports2) {
|
|
83
|
+
var __exportStar = deeks && deeks.__exportStar || function(m, exports2) {
|
|
84
84
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
85
85
|
};
|
|
86
86
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87
|
-
exports.deepKeysFromList = exports.deepKeys =
|
|
87
|
+
exports.deepKeysFromList = exports.deepKeys = void 0;
|
|
88
88
|
const utils = __importStar(requireUtils());
|
|
89
89
|
__exportStar(requireTypes(), exports);
|
|
90
90
|
function deepKeys(object, options) {
|
|
@@ -147,7 +147,7 @@ function assertNotStringIndex(object, key) {
|
|
|
147
147
|
__name(assertNotStringIndex, "assertNotStringIndex");
|
|
148
148
|
function getProperty(object, path, value) {
|
|
149
149
|
if (!isObject(object) || typeof path !== "string") {
|
|
150
|
-
return value ===
|
|
150
|
+
return value === void 0 ? object : value;
|
|
151
151
|
}
|
|
152
152
|
const pathArray = getPathSegments(path);
|
|
153
153
|
if (pathArray.length === 0) {
|
|
@@ -156,18 +156,18 @@ function getProperty(object, path, value) {
|
|
|
156
156
|
for (let index = 0; index < pathArray.length; index++) {
|
|
157
157
|
const key = pathArray[index];
|
|
158
158
|
if (isStringIndex(object, key)) {
|
|
159
|
-
object = index === pathArray.length - 1 ?
|
|
159
|
+
object = index === pathArray.length - 1 ? void 0 : null;
|
|
160
160
|
} else {
|
|
161
161
|
object = object[key];
|
|
162
162
|
}
|
|
163
|
-
if (object ===
|
|
163
|
+
if (object === void 0 || object === null) {
|
|
164
164
|
if (index !== pathArray.length - 1) {
|
|
165
165
|
return value;
|
|
166
166
|
}
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
return object ===
|
|
170
|
+
return object === void 0 ? value : object;
|
|
171
171
|
}
|
|
172
172
|
__name(getProperty, "getProperty");
|
|
173
173
|
function setProperty(object, path, value) {
|
|
@@ -143,7 +143,7 @@ function assertNotStringIndex(object, key) {
|
|
|
143
143
|
__name(assertNotStringIndex, "assertNotStringIndex");
|
|
144
144
|
function getProperty(object, path, value) {
|
|
145
145
|
if (!isObject(object) || typeof path !== "string") {
|
|
146
|
-
return value ===
|
|
146
|
+
return value === void 0 ? object : value;
|
|
147
147
|
}
|
|
148
148
|
const pathArray = getPathSegments(path);
|
|
149
149
|
if (pathArray.length === 0) {
|
|
@@ -152,18 +152,18 @@ function getProperty(object, path, value) {
|
|
|
152
152
|
for (let index = 0; index < pathArray.length; index++) {
|
|
153
153
|
const key = pathArray[index];
|
|
154
154
|
if (isStringIndex(object, key)) {
|
|
155
|
-
object = index === pathArray.length - 1 ?
|
|
155
|
+
object = index === pathArray.length - 1 ? void 0 : null;
|
|
156
156
|
} else {
|
|
157
157
|
object = object[key];
|
|
158
158
|
}
|
|
159
|
-
if (object ===
|
|
159
|
+
if (object === void 0 || object === null) {
|
|
160
160
|
if (index !== pathArray.length - 1) {
|
|
161
161
|
return value;
|
|
162
162
|
}
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
return object ===
|
|
166
|
+
return object === void 0 ? value : object;
|
|
167
167
|
}
|
|
168
168
|
__name(getProperty, "getProperty");
|
|
169
169
|
function setProperty(object, path, value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/object",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Helper functions for working with objects and arrays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"main": "dist/index.cjs",
|
|
64
64
|
"module": "dist/index.mjs",
|
|
65
|
-
"browser": "
|
|
65
|
+
"browser": "dist/index.mjs",
|
|
66
66
|
"types": "dist/index.d.ts",
|
|
67
67
|
"typesVersions": {
|
|
68
68
|
">=5.0": {
|
|
@@ -76,77 +76,11 @@
|
|
|
76
76
|
"README.md",
|
|
77
77
|
"CHANGELOG.md"
|
|
78
78
|
],
|
|
79
|
-
"devDependencies": {
|
|
80
|
-
"@anolilab/eslint-config": "^15.0.3",
|
|
81
|
-
"@anolilab/prettier-config": "^5.0.14",
|
|
82
|
-
"@anolilab/semantic-release-pnpm": "1.1.6",
|
|
83
|
-
"@anolilab/semantic-release-preset": "^9.0.3",
|
|
84
|
-
"@arethetypeswrong/cli": "^0.17.2",
|
|
85
|
-
"@babel/core": "^7.26.0",
|
|
86
|
-
"@rushstack/eslint-plugin-security": "^0.8.3",
|
|
87
|
-
"@secretlint/secretlint-rule-preset-recommend": "^9.0.0",
|
|
88
|
-
"@total-typescript/ts-reset": "^0.6.1",
|
|
89
|
-
"@types/node": "18.19.39",
|
|
90
|
-
"@visulima/packem": "^1.10.7",
|
|
91
|
-
"@vitest/coverage-v8": "^2.1.8",
|
|
92
|
-
"@vitest/ui": "^2.1.8",
|
|
93
|
-
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
94
|
-
"cross-env": "^7.0.3",
|
|
95
|
-
"deeks": "^3.1.1",
|
|
96
|
-
"dot-prop": "^9.0.0",
|
|
97
|
-
"esbuild": "0.24.2",
|
|
98
|
-
"eslint": "8.57.0",
|
|
99
|
-
"eslint-plugin-deprecation": "^3.0.0",
|
|
100
|
-
"eslint-plugin-etc": "^2.0.3",
|
|
101
|
-
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
|
|
102
|
-
"eslint-plugin-mdx": "^3.1.5",
|
|
103
|
-
"eslint-plugin-vitest": "0.4.1",
|
|
104
|
-
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
105
|
-
"filter-obj": "^6.1.0",
|
|
106
|
-
"is-plain-obj": "^4.1.0",
|
|
107
|
-
"prettier": "^3.4.2",
|
|
108
|
-
"rimraf": "6.0.1",
|
|
109
|
-
"secretlint": "9.0.0",
|
|
110
|
-
"semantic-release": "^24.2.1",
|
|
111
|
-
"type-fest": "^4.32.0",
|
|
112
|
-
"typescript": "5.7.3",
|
|
113
|
-
"vitest": "^2.1.8"
|
|
114
|
-
},
|
|
115
79
|
"engines": {
|
|
116
|
-
"node": ">=18
|
|
80
|
+
"node": ">=18.0.0 <=23.x"
|
|
117
81
|
},
|
|
118
82
|
"publishConfig": {
|
|
119
83
|
"access": "public",
|
|
120
84
|
"provenance": true
|
|
121
|
-
},
|
|
122
|
-
"anolilab": {
|
|
123
|
-
"eslint-config": {
|
|
124
|
-
"plugin": {
|
|
125
|
-
"tsdoc": false,
|
|
126
|
-
"etc": false
|
|
127
|
-
},
|
|
128
|
-
"warn_on_unsupported_typescript_version": false,
|
|
129
|
-
"info_on_disabling_jsx_react_rule": false,
|
|
130
|
-
"info_on_disabling_prettier_conflict_rule": false,
|
|
131
|
-
"info_on_disabling_jsonc_sort_keys_rule": false,
|
|
132
|
-
"info_on_disabling_etc_no_deprecated": false
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"scripts": {
|
|
136
|
-
"build": "cross-env NODE_ENV=development packem build",
|
|
137
|
-
"build:prod": "cross-env NODE_ENV=production packem build",
|
|
138
|
-
"clean": "rimraf node_modules dist .eslintcache",
|
|
139
|
-
"dev": "pnpm run build --watch",
|
|
140
|
-
"lint:attw": "attw --pack",
|
|
141
|
-
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
142
|
-
"lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
|
|
143
|
-
"lint:package-json": "publint --strict",
|
|
144
|
-
"lint:prettier": "prettier --config=.prettierrc.cjs --check .",
|
|
145
|
-
"lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
|
|
146
|
-
"lint:types": "tsc --noEmit",
|
|
147
|
-
"test": "vitest run",
|
|
148
|
-
"test:coverage": "vitest run --coverage",
|
|
149
|
-
"test:ui": "vitest --ui --coverage.enabled=true",
|
|
150
|
-
"test:watch": "vitest"
|
|
151
85
|
}
|
|
152
86
|
}
|