Skip to content
Snippets Groups Projects
Verified Commit 58d076af authored by Jan Loewe's avatar Jan Loewe :speech_balloon:
Browse files

Refactor Project

parent b47ecbcf
No related branches found
No related tags found
No related merge requests found
Showing
with 715 additions and 48 deletions
...@@ -604,5 +604,3 @@ $RECYCLE.BIN/ ...@@ -604,5 +604,3 @@ $RECYCLE.BIN/
### TortoiseGit template ### TortoiseGit template
# Project-level settings # Project-level settings
/.tgitconfig /.tgitconfig
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="120" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="120" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dcc-js.iml" filepath="$PROJECT_DIR$/.idea/dcc-js.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
{
"printWidth": 120,
"trailingComma": "all",
"singleQuote": false
}
\ No newline at end of file
import DigitalCalibrationCertificate from "./dcc/DigitalCalibrationCertificate";
console.log(new DigitalCalibrationCertificate(`
<dcc:digitalCalibrationCertificate xmlns:dcc="https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/DCC" xmlns:si="https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/SI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/DCC DCC_v1.8.1.xsd">
<dcc:administrativeData>
<!--00100-->
<dcc:usedSoftware>
<dcc:software id="soft1">
<!--1100M-->
<dcc:name>Altova XMLSpy</dcc:name>
<!--11010-->
<dcc:release>2018 SP 1 (x64) Enterprise Edition</dcc:release>
<!--11020-->
<dcc:langCodeISO639_1>de</dcc:langCodeISO639_1>
<!--12040-->
<dcc:source>Altova GmbH, Rudolfsplatz 13a/9, A-1010 Wien, Österreich
https://www.altova.com/de/</dcc:source>
<!--11050-->
</dcc:software>
</dcc:usedSoftware>
</dcc:administrativeData>
</dcc:digitalCalibrationCertificate>
`).administrativeData.usedSoftware[0].release);
\ No newline at end of file
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -2,10 +2,37 @@ ...@@ -2,10 +2,37 @@
"name": "dcc-js", "name": "dcc-js",
"version": "0.0.1", "version": "0.0.1",
"author": "Jan Henry Loewe <kontakt@jloewe.net>", "author": "Jan Henry Loewe <kontakt@jloewe.net>",
"main": "index.ts", "main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*"
],
"scripts": {
"test": "mocha -r ts-node/register tests/**/*.test.ts",
"testWithCoverage": "nyc -r lcov -e .ts -x \"*.test.ts\" mocha -r ts-node/register tests/**/*.test.ts && nyc report",
"build": "tsc",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\" \"tests/**/*.ts\" \"tests/**/*.js\"",
"lint": "tslint -p tsconfig.json",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
},
"dependencies": { "dependencies": {
"@types/cheerio": "^0.22.11", "@types/cheerio": "^0.22.11",
"cheerio": "^1.0.0-rc.2", "cheerio": "^1.0.0-rc.2"
},
"devDependencies": {
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.6",
"chai": "^4.2.0",
"mocha": "^6.0.2",
"nyc": "^13.3.0",
"prettier": "^1.16.4",
"ts-node": "^8.0.3",
"tslint": "^5.14.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.3.3333" "typescript": "^3.3.3333"
} }
} }
...@@ -9,9 +9,7 @@ export class AdministrativeData extends DCCElement { ...@@ -9,9 +9,7 @@ export class AdministrativeData extends DCCElement {
this.usedSoftware = []; this.usedSoftware = [];
this.$el.find("dcc\\:software").each((index, software) => { this.$el.find("dcc\\:software").each((index, software) => {
this.usedSoftware.push( this.usedSoftware.push(new Software(this.$, this.$(software)));
new Software(this.$, this.$(software))
)
}); });
} }
} }
File moved
File moved
File moved
File moved
import { expect } from 'chai';
import DigitalCalibrationCertificate from "../src/DigitalCalibrationCertificate";
import { xml } from "./dcc.xml";
describe("DigitalCalibrationCertificate", () => {
it("should be an object", () => {
let dcc = new DigitalCalibrationCertificate(xml);
expect(dcc).to.be.an("object");
});
});
\ No newline at end of file
This diff is collapsed.
{ {
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "./dist",
"target": "es5", "target": "es5",
"moduleResolution": "node", "module": "commonjs",
"sourceMap": true, "declaration": true,
"emitDecoratorMetadata": true, "sourceMap": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"removeComments": false, "strict": true,
"noImplicitAny": false "lib": [ "dom", "es6", "es5" ]
}, },
"exclude": [ "include": ["./src/**/*", "./tests/**/*"],
"node_modules", "exclude": ["node_modules", "./src/**/*.spec.ts"]
".npm" }
] \ No newline at end of file
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment