Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Tests](https://github.com/OMICRONEnergyOSS/oscd-api/actions/workflows/test.yml/badge.svg)](https://github.com/OMICRONEnergyOSS/oscd-api/actions/workflows/test.yml) ![NPM Version](https://img.shields.io/npm/v/@omicronenergy/oscd-api)
[![Tests](https://github.com/openscd/oscd-api/actions/workflows/test.yml/badge.svg)](https://github.com/openscd/oscd-api/actions/workflows/test.yml) ![NPM Version](https://img.shields.io/npm/v/@opensc/oscd-api)

# OpenSCD API

Expand Down
658 changes: 318 additions & 340 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@omicronenergy/oscd-api",
"name": "@opensc/oscd-api",
"version": "0.1.3",
"description": "OpenSCD API for IEC 61850 SCL files",
"type": "module",
Expand All @@ -24,10 +24,10 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/OMICRONEnergyOSS/oscd-api.git"
"url": "git+https://github.com/openscd/oscd-api.git"
},
"bugs": {
"url": "https://github.com/OMICRONEnergyOSS/oscd-api/issues"
"url": "https://github.com/openscd/oscd-api/issues"
},
"homepage": "https://openscd.org",
"keywords": [
Expand All @@ -52,29 +52,27 @@
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.29.0",
"@eslint/js": "^9.35.0",
"@open-wc/eslint-config": "^13.0.0",
"@open-wc/testing": "4.0.0",
"@types/mocha": "^10.0.10",
"@typescript-eslint/eslint-plugin": "^8.34.1",
"@typescript-eslint/parser": "^8.34.1",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"@web/test-runner": "0.20.2",
"concurrently": "^9.2.0",
"eslint": "^9.29.0",
"eslint-config-prettier": "^10.1.5",
"concurrently": "^9.2.1",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-html": "^8.1.3",
"eslint-plugin-lit": "^2.1.1",
"eslint-plugin-lit-a11y": "^5.0.1",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^5.5.0",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-tsdoc": "^0.4.0",
"eslint-plugin-wc": "^3.0.1",
"husky": "^9.1.7",
"lint-staged": "^16.1.2",
"prettier": "^3.6.0",
"lint-staged": "^16.1.6",
"prettier": "^3.6.2",
"rimraf": "^6.0.1",
"typedoc": "^0.28.5",
"typescript": "^5.8.3"
"typedoc": "^0.28.12",
"typescript": "^5.9.2"
},
"prettier": {
"singleQuote": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 20 additions & 2 deletions editv2.spec.ts → src/editv2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const insert: Insert = { parent: element, node: element, reference: null };
const remove: Remove = { node: element };
const setAttributes: SetAttributes = {
element,
attributes: { name: 'value' },
attributesNS: { namespaceURI: { name: 'value' } },
attributes: { attrName: 'attrValue' },
attributesNS: { myNamespaceURI: { attrName: 'attrValue' } },
};
const setTextContent: SetTextContent = { element, textContent: '' };

Expand All @@ -42,6 +42,24 @@ describe('isEditV2', () => {
it('returns true for SetAttributes', () =>
expect(setAttributes).to.satisfy(isEditV2));

it('SetAttributes returns false where Attributes are invalid', () =>
expect({
element,
attributes: 'invalid attr object',
}).to.not.satisfy(isEditV2));

it('SetAttributes returns false where NSAttributes are missing', () =>
expect({
element,
attributesNS: null,
}).to.not.satisfy(isEditV2));

it('SetAttributes returns false if attr namespaced attr is not an object', () =>
expect({
element,
attributesNS: { [1]: 'unacceptable' },
}).to.not.satisfy(isEditV2));

it('returns true for SetTextContent', () =>
expect(setTextContent).to.satisfy(isEditV2));

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"outDir": "dist",
"sourceMap": true,
"inlineSources": true,
"rootDir": "./",
"rootDir": "./src/",
"declaration": true
},
"include": ["**/*.ts"]
Expand Down