Skip to content

Commit

Permalink
Added pull request of GitHub user @gempain
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-aeschlimann committed Jul 15, 2017
1 parent a236de7 commit 08ea88a
Show file tree
Hide file tree
Showing 16 changed files with 855 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/.idea
/coverage
/node_modules
/dist
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# v0.9.7 (2017-07-15)

## Bug Fixes

* Fixed issue with `ValueCheckingMode` by using an enum instead of a nested class, closes [#10](https://github.com/dhlab-basel/json2typescript/issues/10) and [#11](https://github.com/dhlab-basel/json2typescript/issues/11)
* Added missing js references, closes [#11](https://github.com/dhlab-basel/json2typescript/issues/11) and [#16](https://github.com/dhlab-basel/json2typescript/issues/16)

## Features

* Allow serialization the same way as deserialization, closes [#4](https://github.com/dhlab-basel/json2typescript/issues/4)
* Added custom converters, closes [#6](https://github.com/dhlab-basel/json2typescript/issues/6)
* Use class methods instead of static methods, closes [#14](https://github.com/dhlab-basel/json2typescript/issues/14)

## Breaking Changes

* Use an instance of `JsonConvert` its class methods instead of the static methods.

* The property `valueCheckingMode` of the `JsonConvert` class needs to be set using the exported enum `ValueCheckingMode` instead of the inner class `JsonConvert.ValueCheckingMode`. If you would like to set the `valueCheckingMode`, please make the additional import of `ValueCheckingMode` and use this.

# 0.9.6 (2017-01-18)
Fixed errors in ReadMe and small bug on JsonConvert.

# 0.9.5 (2017-12-11):
New method for deserializing array of objects.

# 0.9.4 (2017-11-22):
Class properties are now not overridden to `undefined` if there is no decorator and no matching json value.

# 0.9.3 (2017-11-16):
It is now possible to map an JSON object to an TypeScript array, then the object keys become the array keys. Also, class properties can be set to optional. See below in the chapter "decorators" for more information.

# 0.9.2 (2017-10-10):
Added method `serializeString()`, changed property names and behaviour.

# 0.9.1 (2017-10-06):
First version released to the public.
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ console.log(user); // prints User{ ... } in JavaScript runtime, not Object{ ...

# Changelog

* v0.9.7, v0.9.6: Fixed errors in ReadMe and small bug on JsonConvert.
* v0.9.5: New method for deserializing array of objects.
* v0.9.4: Class properties are now not overridden to `undefined` if there is no decorator and no matching json value.
* v0.9.3: It is now possible to map an JSON object to an TypeScript array, then the object keys become the array keys. Also, class properties can be set to optional. See below in the chapter "decorators" for more information.
* v0.9.2: Added method `serializeString()`, changed `property` names and behaviour
* v0.9.1: First version released to the public
See the changelog in the seperate file for bug fixes, new features and breaking changes: [Changelog](CHANGELOG.md)

---

Expand Down Expand Up @@ -407,11 +402,9 @@ export class User {
---
# Imprint
# Authors
This package was created by the **Digital Humanities Lab** of **University of Basel** in 2016.
We make use of it in our new website of
http://www.salsah.org.
This NPM package was originally created by the **Digital Humanities Lab** of **University of Basel** in 2016.
We make use of it in our new website of http://www.salsah.org.
More information on
http://dhlab.unibas.ch
More information on http://dhlab.unibas.ch
1 change: 1 addition & 0 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
export { JsonConvert, JsonObject, JsonProperty } from "./src/json2typescript/json-convert";
32 changes: 32 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = function (config) {
config.set({
plugins: [
'karma-jasmine',
'karma-mocha-reporter',
'karma-phantomjs-launcher',
'karma-typescript'
],
frameworks: ['jasmine', 'karma-typescript'],
files: [
'test/**/*.ts',
'src/**/*.ts'
],
preprocessors: {
'src/**/*.ts': ['karma-typescript'],
'test/**/*.ts': ['karma-typescript']
},
reporters: ['mocha', 'karma-typescript'],
browsers: ['PhantomJS'],
singleRun: true,
colors: true,
karmaTypescriptConfig: {
coverageOptions: {
exclude: /test\/.*/
},
reports: {
'text': '',
'html': 'coverage'
}
}
})
};
23 changes: 19 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,33 @@
"author": "[email protected]",
"license": "MIT",
"homepage": "http://dhlab.unibas.ch",
"typings": "src/index",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "karma start karma.conf.js",
"build": "npm run test && tsc",
"dist": "npm run build && npm pack"
},
"typescript": {
"definition": "index.d.ts"
"definition": "dist/index.d.ts"
},
"dependencies": {
},
"devDependencies": {
"@types/jasmine": "^2.5.52",
"jasmine": "2.6.0",
"karma": "^1.7.0",
"karma-jasmine": "1.1.0",
"karma-mocha-reporter": "^2.2.3",
"karma-phantomjs-launcher": "1.0.4",
"karma-typescript": "^3.0.3",
"phantomjs-prebuilt": "2.1.14",
"typescript": "2.3.4"
},
"main": "index.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"src"
],
"repository": {
"type": "git",
"url": "https://github.com/dhlab-basel/json2typescript"
Expand Down
Loading

0 comments on commit 08ea88a

Please sign in to comment.