Skip to content

Commit

Permalink
Merge pull request #492 from shimataro/develop
Browse files Browse the repository at this point in the history
version 3.0.0-rc.11
  • Loading branch information
shimataro committed Jul 9, 2020
2 parents d9c6b90 + 7329e25 commit bb9338f
Show file tree
Hide file tree
Showing 27 changed files with 81 additions and 37 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/verify-on-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ jobs:
matrix:
nodejs:
- 12
typescript:
- "3.4.1"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
fail-fast: false
steps:
- name: Checkout source codes
Expand All @@ -24,5 +31,9 @@ jobs:
npm -v
- name: Install dependencies
run: npm ci
- name: Reinstall typescript
run: npm i -D typescript@${{ matrix.typescript }}
- name: Build
run: npm run build
- name: Verify
run: npm run verify
11 changes: 11 additions & 0 deletions .github/workflows/verify-on-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ jobs:
matrix:
nodejs:
- 12
typescript:
- "3.4.1"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
fail-fast: false
steps:
- name: Checkout source codes
Expand All @@ -24,5 +31,9 @@ jobs:
npm -v
- name: Install dependencies
run: npm ci
- name: Reinstall typescript
run: npm i -D typescript@${{ matrix.typescript }}
- name: Build
run: npm run build
- name: Verify
run: npm run verify
11 changes: 11 additions & 0 deletions .github/workflows/verify-on-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ jobs:
matrix:
nodejs:
- 12
typescript:
- "3.4.1"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
fail-fast: false
steps:
- name: Turn off auto-crlf
Expand All @@ -26,5 +33,9 @@ jobs:
npm -v
- name: Install dependencies
run: npm ci
- name: Reinstall typescript
run: npm i -D typescript@${{ matrix.typescript }}
- name: Build
run: npm run build
- name: Verify
run: npm run verify
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [3.0.0-rc.11] - 2020-07-09

### Fixed

* type error of `ifUndefined`, such as `email({ifUndefined: "", ifNull: ""})`

### Others

* support TypeScript>=3.4.1

## [3.0.0-rc.10] - 2020-07-08

### Fixed

* fix type errors in TypeScript
* type errors in TypeScript

## [3.0.0-rc.9] - 2020-06-18

Expand Down Expand Up @@ -502,7 +512,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

* First release.

[Unreleased]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.10...HEAD
[Unreleased]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.11...HEAD
[3.0.0-rc.11]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.10...v3.0.0-rc.11
[3.0.0-rc.10]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.9...v3.0.0-rc.10
[3.0.0-rc.9]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.8...v3.0.0-rc.9
[3.0.0-rc.8]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.7...v3.0.0-rc.8
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
[![Code Coverage][image-code-coverage]][link-code-coverage]
[![Release][image-release]][link-release]
[![Node.js version][image-engine]][link-engine]
[![Types][image-types]][link-types]
[![TypeScript version][image-typescript]][link-typescript]
[![Deno version][image-deno]][link-deno]
[![License][image-license]][link-license]

simple, easy-to-use, and declarative schema validator

supports [Node.js](https://nodejs.org/) and [Deno](https://deno.land/)
supports [Node.js](https://nodejs.org/), [TypeScript](https://www.typescriptlang.org/), and [Deno](https://deno.land/)

## Table of Contents

Expand Down Expand Up @@ -2226,7 +2227,9 @@ See [CHANGELOG.md](CHANGELOG.md).
[link-release]: https://github.com/shimataro/value-schema/releases
[image-engine]: https://img.shields.io/node/v/value-schema.svg
[link-engine]: https://nodejs.org/
[image-types]: https://img.shields.io/npm/types/value-schema.svg
[link-types]: https://github.com/shimataro/value-schema
[image-typescript]: https://img.shields.io/badge/TypeScript-%3E%3D3.4.1-brightgreen.svg
[link-typescript]: https://www.typescriptlang.org/
[image-deno]: https://img.shields.io/badge/%F0%9F%A6%95%20Deno-%3E%3D1.0.0-brightgreen.svg
[link-deno]: https://deno.land/
[image-license]: https://img.shields.io/github/license/shimataro/value-schema.svg
[link-license]: ./LICENSE
14 changes: 7 additions & 7 deletions npm-shrinkwrap.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "value-schema",
"description": "simple, easy-to-use, and declarative schema validator",
"version": "3.0.0-rc.10",
"version": "3.0.0-rc.11",
"author": "shimataro",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -56,7 +56,7 @@
"@babel/cli": "7.10.4",
"@babel/core": "7.10.4",
"@types/jest": "26.0.4",
"@types/node": "14.0.19",
"@types/node": "14.0.20",
"@typescript-eslint/eslint-plugin": "3.6.0",
"@typescript-eslint/parser": "3.6.0",
"babel-plugin-add-module-exports": "1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/array/each.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function applyTo<T>(values: Values, options: Options<T>, keyStack: Key[])
throw Error("!IGNORE!");
}

ValueSchemaError.raise(err.cause, values, err.keyStack);
return ValueSchemaError.raise(err.cause, values, err.keyStack);
}, [...keyStack, idx]);
adjustedValues.push(adjustedValue);
}
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/array/maxLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function applyTo<T>(values: Values, options: Options, keyStack: Key[]): v
return false;
}

ValueSchemaError.raise(CAUSE.MAX_LENGTH, values, keyStack);
return ValueSchemaError.raise(CAUSE.MAX_LENGTH, values, keyStack);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/array/minLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export function applyTo<T>(values: Values, options: Options, keyStack: Key[]): v
return false;
}

ValueSchemaError.raise(CAUSE.MIN_LENGTH, values, keyStack);
return ValueSchemaError.raise(CAUSE.MIN_LENGTH, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/array/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ export function applyTo<T>(values: Values, options: Options, keyStack: Key[]): v
return false;
}

ValueSchemaError.raise(CAUSE.TYPE, values, keyStack);
return ValueSchemaError.raise(CAUSE.TYPE, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/boolean/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
}
}

ValueSchemaError.raise(CAUSE.TYPE, values, keyStack);
return ValueSchemaError.raise(CAUSE.TYPE, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function applyTo<T>(values: Values, options: Options<T>, keyStack: Key[])

values.output = options.converter(values.output as T, () =>
{
ValueSchemaError.raise(CAUSE.CONVERTER, values, keyStack);
return ValueSchemaError.raise(CAUSE.CONVERTER, values, keyStack);
});
return true;
}
1 change: 0 additions & 1 deletion src/appliers/email/maxLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const MAX_LENGTH = MAX_LENGTH_LOCAL + 1 + MAX_LENGTH_DOMAIN; // local-part + "@"

export interface Options
{
ifUndefined?: null; // instead of empty object...
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/ifEmptyString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export function applyTo<T>(values: Values, options: Options<T>, keyStack: Key[])
return true;
}

ValueSchemaError.raise(CAUSE.EMPTY_STRING, values, keyStack);
return ValueSchemaError.raise(CAUSE.EMPTY_STRING, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/ifNull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export function applyTo<T>(values: Values, options: Options<T>, keyStack: Key[])
return true;
}

ValueSchemaError.raise(CAUSE.NULL, values, keyStack);
return ValueSchemaError.raise(CAUSE.NULL, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/ifUndefined.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export function applyTo<T>(values: Values, options: Options<T>, keyStack: Key[])
return true;
}

ValueSchemaError.raise(CAUSE.UNDEFINED, values, keyStack);
return ValueSchemaError.raise(CAUSE.UNDEFINED, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/number/maxValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.MAX_VALUE, values, keyStack);
return ValueSchemaError.raise(CAUSE.MAX_VALUE, values, keyStack);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/number/minValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.MIN_VALUE, values, keyStack);
return ValueSchemaError.raise(CAUSE.MIN_VALUE, values, keyStack);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/numericString/checksum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.CHECKSUM, values, keyStack);
return ValueSchemaError.raise(CAUSE.CHECKSUM, values, keyStack);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/appliers/numericString/pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const REGEXP = /^\d+$/;

export interface Options
{
ifUndefined?: null; // instead of empty object...
}

/**
Expand All @@ -28,5 +27,5 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.PATTERN, values, keyStack);
return ValueSchemaError.raise(CAUSE.PATTERN, values, keyStack);
}
3 changes: 1 addition & 2 deletions src/appliers/object/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {CAUSE, ValueSchemaError} from "../../libs/ValueSchemaError";

export interface Options
{
ifUndefined?: null; // instead of empty object...
}

/**
Expand All @@ -21,5 +20,5 @@ export function applyTo<T>(values: Values, options: Options, keyStack: Key[]): v
return false;
}

ValueSchemaError.raise(CAUSE.TYPE, values, keyStack);
return ValueSchemaError.raise(CAUSE.TYPE, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ export function applyTo<T>(values: Values, options: Options<T>, keyStack: Key[])
}
}

ValueSchemaError.raise(CAUSE.ONLY, values, keyStack);
return ValueSchemaError.raise(CAUSE.ONLY, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/string/maxLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.MAX_LENGTH, values, keyStack);
return ValueSchemaError.raise(CAUSE.MAX_LENGTH, values, keyStack);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/appliers/string/minLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.MIN_LENGTH, values, keyStack);
return ValueSchemaError.raise(CAUSE.MIN_LENGTH, values, keyStack);
}
2 changes: 1 addition & 1 deletion src/appliers/string/pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ export function applyTo(values: Values, options: Options, keyStack: Key[]): valu
return false;
}

ValueSchemaError.raise(CAUSE.PATTERN, values, keyStack);
return ValueSchemaError.raise(CAUSE.PATTERN, values, keyStack);
}
2 changes: 1 addition & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.cjs.json",
"compilerOptions": {
"target": "ES2020",
"target": "ESNext",
"module": "ESNext",

"declaration": true
Expand Down

0 comments on commit bb9338f

Please sign in to comment.