Skip to content

Commit f9775b9

Browse files
Merge pull request #15 from mtowers/update-docs
Update Documentation
2 parents 79daf94 + 5fd93a5 commit f9775b9

File tree

8 files changed

+206
-4592
lines changed

8 files changed

+206
-4592
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,6 @@ node_modules
149149

150150
# Generared sources
151151
dev
152-
dist
152+
dist
153+
154+
yarn.lock

README.md

Lines changed: 193 additions & 63 deletions
Large diffs are not rendered by default.

lib/json/json-decorators.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/marshallers/date-marshaller.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"reflect-metadata": "*"
3939
},
4040
"scripts": {
41-
"test": "nyc mocha -r ts-node/register -r test/prepare test/**/*.spec.ts"
41+
"build": "rm -rf ./lib; rm -rf ./dts; npx tsc --project ./tsconfig.json",
42+
"test": "nyc mocha -r ts-node/register test/**/*.spec.ts"
4243
},
4344
"nyc": {
4445
"extension": [

src/json/json-decorators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function jsonDecodable(options?: JsonDecodableOptions) {
5757
}
5858

5959
/**
60-
* Json schema as used by a JSON decodeable object
60+
* Json schema as used by a JSON decodable object
6161
* TODO: Use an interface describing the supported schema version (not available in ajv)
6262
*/
6363
export interface JsonDecodableSchema extends Record<string, any> {
@@ -219,7 +219,7 @@ export function jsonType(
219219
//
220220

221221
/**
222-
* Declares a function as being the decoder class factory, returning the class to instatiate with the JSON decoder
222+
* Declares a function as being the decoder class factory, returning the class to instantiate with the JSON decoder
223223
*
224224
* @example
225225
* @jsonDecoderFactory

src/marshallers/date-marshaller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function toDate(value: any, strict: boolean = false): Date | undefined {
4444
if (typeof value === 'number') {
4545
if (Number.isNaN(value) || value < 0) {
4646
if (strict) {
47-
throw new TypeError(`'${value}' is not a valid URL`)
47+
throw new TypeError(`'${value}' is not a valid date`)
4848
}
4949

5050
return undefined
@@ -54,7 +54,7 @@ export function toDate(value: any, strict: boolean = false): Date | undefined {
5454
}
5555

5656
if (strict) {
57-
throw new TypeError(`'${value}' is not a valid URL`)
57+
throw new TypeError(`'${value}' is not a valid date`)
5858
}
5959

6060
return undefined

0 commit comments

Comments
 (0)