Skip to content

Commit b1e5c51

Browse files
ca-dstee-re
authored andcommitted
refactor(package)!: move utils to separate module
Resolves #32 .
1 parent 477f11c commit b1e5c51

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

oscd-api.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,30 @@
1-
export {
1+
export type {
22
Attributes,
33
AttributesNS,
44
EditV2,
55
Insert,
6-
isAttributes,
7-
isAttributesNS,
8-
isComplexEditV2,
9-
isEditV2,
10-
isInsert,
11-
isRemove,
12-
isSetAttributes,
13-
isSetTextContent,
146
Remove,
157
SetAttributes,
168
SetTextContent,
179
} from './editv2.js';
1810

19-
export {
11+
export type {
2012
AttributesV1,
2113
AttributeValue,
2214
Edit,
23-
isAttributesV1,
24-
isComplexEdit,
25-
isEdit,
26-
isNamespaced,
27-
isUpdate,
2815
NamespacedAttributeValue,
2916
Update,
3017
} from './editv1.js';
3118

32-
export { convertEdit } from './convertEdit.js';
33-
3419
export type {
3520
Commit,
3621
CommitOptions,
3722
Transactor,
3823
TransactedCallback,
3924
} from './Transactor.js';
4025

41-
export {
26+
export type {
4227
EditDetailV2,
4328
EditEventOptions,
4429
EditEventV2,
45-
newEditEventV2,
4630
} from './edit-event.js';

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
"version": "0.0.14",
44
"description": "OpenSCD API for IEC 61850 SCL files",
55
"type": "module",
6-
"main": "./dist/oscd-api.js",
7-
"types": "./dist/oscd-api.d.ts",
6+
"exports": {
7+
".": {
8+
"default": "./dist/oscd-api.js",
9+
"types": "./dist/oscd-api.d.ts"
10+
},
11+
"./utils.js": {
12+
"default": "./dist/utils.js",
13+
"types": "./dist/utils.d.ts"
14+
}
15+
},
816
"scripts": {
917
"lint": "eslint . && prettier \"**/*.ts\" --check --ignore-path .gitignore",
1018
"format": "eslint ./*.ts --fix",

utils.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export {
2+
isAttributes,
3+
isAttributesNS,
4+
isComplexEditV2,
5+
isEditV2,
6+
isInsert,
7+
isRemove,
8+
isSetAttributes,
9+
isSetTextContent,
10+
} from './editv2.js';
11+
12+
export {
13+
isAttributesV1,
14+
isComplexEdit,
15+
isEdit,
16+
isNamespaced,
17+
isUpdate,
18+
} from './editv1.js';
19+
20+
export { convertEdit } from './convertEdit.js';
21+
22+
export { newEditEventV2 } from './edit-event.js';

0 commit comments

Comments
 (0)