@cobol-ts/records 0.0.0-stage → 0.0.1
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/README.md +15 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +21 -0
- package/package.json +54 -3
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cobol-ts/records
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Helpers for generic JavaScript record/object data, distinct from the **physical byte records** managed by [`@cobol-ts/cursor-record`](../../cursor-loader/cursor-record/README.md). This package includes property-path traversal, mapping, key/value types, object inversion and deep-combination utilities.
|
|
6
|
+
|
|
7
|
+
## Public API and responsibilities
|
|
8
|
+
|
|
9
|
+
- `NameAnd<T>` and `Env` describe string-keyed maps. `invertObject` reverses name/value associations, with input values permitted to be strings or arrays of strings.
|
|
10
|
+
- `mapRecord` maps entries of a record; see [`src/map.record.ts`](src/map.record.ts) for the callback contract and return type.
|
|
11
|
+
- `pathToValue` follows a dotted path through an existing object, while `getAllConfigPaths` enumerates nested configuration paths. They are general object utilities, not COBOL field-position compilers.
|
|
12
|
+
- `deepCombineObjects` and `deepCombineTwoObject` merge object structures. The latter accepts `DeepCombineOptions`; consult [`src/combine.ts`](src/combine.ts) before depending on array replacement or conflict behaviour.
|
|
13
|
+
|
|
14
|
+
## Usage and boundaries
|
|
15
|
+
|
|
16
|
+
Use these helpers when transforming configuration or ordinary object graphs. They neither acquire physical records nor establish borrowed projection lifetimes. The public entry points are re-exported from [`index.ts`](index.ts), which points to `combine`, `path`, `record.utils` and `map.record`.
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/combine"), exports);
|
|
18
|
+
__exportStar(require("./src/path"), exports);
|
|
19
|
+
__exportStar(require("./src/record.utils"), exports);
|
|
20
|
+
__exportStar(require("./src/map.record"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobol-ts/records",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "record utilties for the @cobol-ts project",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "dist/index",
|
|
6
|
+
"types": "dist/index",
|
|
7
|
+
"browserslist": {
|
|
8
|
+
"development": [
|
|
9
|
+
"last 1 chrome version",
|
|
10
|
+
"last 1 firefox version",
|
|
11
|
+
"last 1 safari version"
|
|
12
|
+
],
|
|
13
|
+
"production": [
|
|
14
|
+
">0.2%",
|
|
15
|
+
"not dead",
|
|
16
|
+
"not op_mini all"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
21
|
+
"@types/jest": "^29.0.0",
|
|
22
|
+
"@types/node": "^14.0.0",
|
|
23
|
+
"jest": "^29.0.0",
|
|
24
|
+
"ts-jest": "^29.0.0",
|
|
25
|
+
"typescript": "^5.2.2"
|
|
26
|
+
},
|
|
27
|
+
"eslintConfig": {
|
|
28
|
+
"extends": [
|
|
29
|
+
"react-app",
|
|
30
|
+
"react-app/jest"
|
|
31
|
+
],
|
|
32
|
+
"overrides": [
|
|
33
|
+
{
|
|
34
|
+
"files": [
|
|
35
|
+
"**/*.stories.*"
|
|
36
|
+
],
|
|
37
|
+
"rules": {
|
|
38
|
+
"import/no-anonymous-default-export": "off"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist/index.js",
|
|
45
|
+
"dist/index.d.ts",
|
|
46
|
+
"dist/src/"
|
|
47
|
+
],
|
|
48
|
+
"keywords": [
|
|
49
|
+
"indexing"
|
|
50
|
+
],
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"repository": "git@github.com:intellimaintain/intellimaintain.git",
|
|
53
|
+
"scripts": {
|
|
54
|
+
"test": "jest --config jest.config.json --env node",
|
|
55
|
+
"test:watch": "npm run test -- --watch"
|
|
56
|
+
}
|
|
6
57
|
}
|