Skip to content

Commit

Permalink
Merge pull request #521 from shimataro/develop
Browse files Browse the repository at this point in the history
version 3.0.0-rc.15
  • Loading branch information
shimataro authored Nov 8, 2020
2 parents 3505181 + 43adf56 commit db98272
Show file tree
Hide file tree
Showing 49 changed files with 2,352 additions and 1,562 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ rules: # https://eslint.org/docs/rules/
no-script-url: error
no-self-compare: error
no-sequences: error
no-shadow: error
no-shadow: 'off'
no-shadow-restricted-names: error
no-spaced-func: error
no-sync: error
Expand Down
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github:
- shimataro
custom:
- "https://www.paypal.me/shimataro"
3 changes: 3 additions & 0 deletions .github/workflows/verify-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ jobs:
- "1.0.0"
- "1.1.0"
- "1.2.0"
- "1.3.0"
- "1.4.0"
- "1.5.0"
fail-fast: false
steps:
- name: Checkout source codes
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-on-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "4.0"
fail-fast: false
steps:
- name: Checkout source codes
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-on-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "4.0"
fail-fast: false
steps:
- name: Checkout source codes
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-on-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "4.0"
fail-fast: false
steps:
- name: Turn off auto-crlf
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [3.0.0-rc.15] - 2020-11-08

### Others

* support TypeScript 4.0
* support Deno 1.3, 1.4, 1.5

## [3.0.0-rc.14] - 2020-07-26

### Added
Expand Down Expand Up @@ -530,7 +537,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.14...HEAD
[Unreleased]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.15...HEAD
[3.0.0-rc.15]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.14...v3.0.0-rc.15
[3.0.0-rc.14]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.13...v3.0.0-rc.14
[3.0.0-rc.13]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.12...v3.0.0-rc.13
[3.0.0-rc.12]: https://github.com/shimataro/value-schema/compare/v3.0.0-rc.11...v3.0.0-rc.12
Expand Down
1 change: 1 addition & 0 deletions dist-deno/exporter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./libs/applySchemaObject.ts";
export * from "./libs/publicTypes.ts";
export * from "./libs/ValueSchemaError.ts";
export * from "./schemas/array.ts";
export * from "./schemas/boolean.ts";
Expand Down
4 changes: 2 additions & 2 deletions dist-deno/libs/applySchemaObject.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applySchemaObjectCore } from "./applySchemaObjectCore.ts";
import { ErrorHandler, FinishHandler } from "./publicTypes.ts";
import { ObjectTypeOf, SchemaObject } from "./types.ts";
import { ErrorHandler, FinishHandler, onErrorDefault, onFinishedDefault } from "../schemaClasses/BaseSchema.ts";
export { ErrorHandler } from "../schemaClasses/BaseSchema.ts";
import { onErrorDefault, onFinishedDefault } from "../schemaClasses/BaseSchema.ts";
/**
* apply schema object to data
* @param schemaObject schema object
Expand Down
2 changes: 1 addition & 1 deletion dist-deno/libs/applySchemaObjectCore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorHandler, FinishHandler } from "./publicTypes.ts";
import { AnyObject, Key, ObjectTypeOf, SchemaObject, isObject } from "./types.ts";
import { CAUSE, ValueSchemaError } from "./ValueSchemaError.ts";
import { ErrorHandler, FinishHandler } from "../schemaClasses/BaseSchema.ts";
/**
* apply schema object to data
* @param schemaObject schema object
Expand Down
10 changes: 10 additions & 0 deletions dist-deno/libs/publicTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ValueSchemaError } from "./ValueSchemaError.ts";
export type NullableOptions = {
ifNull: null;
} | {
ifUndefined: null;
} | {
ifEmptyString: null;
};
export type ErrorHandler<T = unknown> = (err: ValueSchemaError) => T | never;
export type FinishHandler = () => void;
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/ArraySchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as maxLength from "../appliers/array/maxLength.ts";
import * as minLength from "../appliers/array/minLength.ts";
import * as type from "../appliers/array/type.ts";
import { BaseSchema } from "./BaseSchema.ts";
export { NullableOptions } from "./BaseSchema.ts";
export type OptionsForArray<T> = converter.Options<T[]> | ifUndefined.Options<T[]> | ifEmptyString.Options<T[]> | ifNull.Options<T[]> | each.Options<T> | minLength.Options | maxLength.Options | type.Options;
export class ArraySchema<T, Tx = never> extends BaseSchema<T[] | Tx> {
constructor(options: OptionsForArray<T>) {
Expand Down
10 changes: 1 addition & 9 deletions dist-deno/schemaClasses/BaseSchema.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { Key, Values, makeValues } from "../libs/types.ts";
import { ErrorHandler } from "../libs/publicTypes.ts";
import { ValueSchemaError } from "../libs/ValueSchemaError.ts";
export type ErrorHandler<T = unknown> = (err: ValueSchemaError) => T | never;
export type FinishHandler = () => void;
interface Options {
}
type ApplyTo<T> = (values: Values, options: Options, keyStack: Key[]) => values is Values<T>;
export type NullableOptions = {
ifNull: null;
} | {
ifUndefined: null;
} | {
ifEmptyString: null;
};
/**
* Base Schema Class
*/
Expand Down
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/BooleanSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as ifNull from "../appliers/ifNull.ts";
import * as ifUndefined from "../appliers/ifUndefined.ts";
import * as type from "../appliers/boolean/type.ts";
import { BaseSchema } from "./BaseSchema.ts";
export { NullableOptions } from "./BaseSchema.ts";
export type OptionsForBoolean = ifUndefined.Options<boolean> | ifEmptyString.Options<boolean> | ifNull.Options<boolean> | type.Options;
export class BooleanSchema<Tx = never> extends BaseSchema<boolean | Tx> {
constructor(options: OptionsForBoolean) {
Expand Down
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/EmailSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as pattern from "../appliers/email/pattern.ts";
import * as trims from "../appliers/string/trims.ts";
import * as type from "../appliers/string/type.ts";
import { BaseSchema } from "./BaseSchema.ts";
export { NullableOptions } from "./BaseSchema.ts";
export type OptionsForEmail = ifEmptyString.Options<string> | ifNull.Options<string> | ifUndefined.Options<string> | pattern.Options | maxLength.Options | trims.Options | type.Options;
export class EmailSchema<Tx = never> extends BaseSchema<string | Tx> {
constructor(options: OptionsForEmail) {
Expand Down
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/NumberSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as maxValue from "../appliers/number/maxValue.ts";
import * as minValue from "../appliers/number/minValue.ts";
import * as type from "../appliers/number/type.ts";
import { BaseSchema } from "./BaseSchema.ts";
export { NullableOptions } from "./BaseSchema.ts";
export const NUMBER = {
INTEGER: type.INTEGER
};
Expand Down
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/NumericStringSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import * as maxLength from "../appliers/string/maxLength.ts";
import * as minLength from "../appliers/string/minLength.ts";
import * as type from "../appliers/string/type.ts";
import { BaseSchema } from "../schemaClasses/BaseSchema.ts";
export { NullableOptions } from "../schemaClasses/BaseSchema.ts";
export const NUMERIC_STRING = {
CHECKSUM_ALGORITHM: checksum.CHECKSUM_ALGORITHM
};
Expand Down
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/ObjectSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as schema from "../appliers/object/schema.ts";
import * as type from "../appliers/object/type.ts";
import { AnyObject, ObjectTypeOf, SchemaObject } from "../libs/types.ts";
import { BaseSchema } from "./BaseSchema.ts";
export { NullableOptions } from "./BaseSchema.ts";
export type OptionsForObject<S> = converter.Options<AnyObject> | ifUndefined.Options<AnyObject> | ifEmptyString.Options<AnyObject> | ifNull.Options<AnyObject> | schema.Options<S> | type.Options;
export class ObjectSchema<S extends SchemaObject, Tx = never> extends BaseSchema<ObjectTypeOf<S> | Tx> {
constructor(options: OptionsForObject<S>) {
Expand Down
1 change: 0 additions & 1 deletion dist-deno/schemaClasses/StringSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import * as pattern from "../appliers/string/pattern.ts";
import * as trims from "../appliers/string/trims.ts";
import * as type from "../appliers/string/type.ts";
import { BaseSchema } from "./BaseSchema.ts";
export { NullableOptions } from "./BaseSchema.ts";
export const STRING = {
PATTERN: pattern.PATTERN
};
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/array.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ArraySchema, NullableOptions, OptionsForArray } from "../schemaClasses/ArraySchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { ArraySchema, OptionsForArray } from "../schemaClasses/ArraySchema.ts";
export function array<T>(options: OptionsForArray<T> & NullableOptions): ArraySchema<T, null>;
export function array<T>(options: OptionsForArray<T>): ArraySchema<T>;
export function array<T>(): ArraySchema<T>;
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/boolean.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BooleanSchema, NullableOptions, OptionsForBoolean } from "../schemaClasses/BooleanSchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { BooleanSchema, OptionsForBoolean } from "../schemaClasses/BooleanSchema.ts";
export function boolean(options: OptionsForBoolean & NullableOptions): BooleanSchema<null>;
export function boolean(options: OptionsForBoolean): BooleanSchema;
export function boolean(): BooleanSchema;
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/email.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EmailSchema, NullableOptions, OptionsForEmail } from "../schemaClasses/EmailSchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { EmailSchema, OptionsForEmail } from "../schemaClasses/EmailSchema.ts";
export function email(options: OptionsForEmail & NullableOptions): EmailSchema<null>;
export function email(options: OptionsForEmail): EmailSchema;
export function email(): EmailSchema;
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/number.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NullableOptions, NumberSchema, OptionsForNumber } from "../schemaClasses/NumberSchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { NumberSchema, OptionsForNumber } from "../schemaClasses/NumberSchema.ts";
export { NUMBER } from "../schemaClasses/NumberSchema.ts";
export function number(options: OptionsForNumber & NullableOptions): NumberSchema<null>;
export function number(options: OptionsForNumber): NumberSchema;
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/numericString.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NullableOptions, NumericStringSchema, OptionsForNumericString } from "../schemaClasses/NumericStringSchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { NumericStringSchema, OptionsForNumericString } from "../schemaClasses/NumericStringSchema.ts";
export { NUMERIC_STRING } from "../schemaClasses/NumericStringSchema.ts";
export function numericString(options: OptionsForNumericString & NullableOptions): NumericStringSchema<null>;
export function numericString(options: OptionsForNumericString): NumericStringSchema;
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/object.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NullableOptions, ObjectSchema, OptionsForObject } from "../schemaClasses/ObjectSchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { SchemaObject } from "../libs/types.ts";
import { ObjectSchema, OptionsForObject } from "../schemaClasses/ObjectSchema.ts";
export function object<S extends SchemaObject>(options: OptionsForObject<S> & NullableOptions): ObjectSchema<S, null>;
export function object<S extends SchemaObject>(options: OptionsForObject<S>): ObjectSchema<S>;
export function object(): ObjectSchema<SchemaObject>;
Expand Down
3 changes: 2 additions & 1 deletion dist-deno/schemas/string.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NullableOptions, OptionsForString, StringSchema } from "../schemaClasses/StringSchema.ts";
import { NullableOptions } from "../libs/publicTypes.ts";
import { OptionsForString, StringSchema } from "../schemaClasses/StringSchema.ts";
export { STRING } from "../schemaClasses/StringSchema.ts";
export function string(options: OptionsForString & NullableOptions): StringSchema<null>;
export function string(options: OptionsForString): StringSchema;
Expand Down
Loading

0 comments on commit db98272

Please sign in to comment.