Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Validate/schema#9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 3 commits intomasterfromvalidate/schema
May 31, 2020
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
cleanup merge conflicts
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
@ShMcK
ShMcK committedMay 31, 2020
commitb2af5f966fd13ff8f5831e9f92e7a3780115ad0f
1 change: 1 addition & 0 deletionssrc/build.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import * as yamlParser from "js-yaml";
import * as path from "path";
import * as _ from "lodash";
import * as fs from "fs";
Expand Down
2 changes: 1 addition & 1 deletionsrc/create.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import* asncp from "ncp";
import ncp from "ncp";
import * as path from "path";
import { promisify } from "util";

Expand Down
5 changes: 3 additions & 2 deletionssrc/utils/validate.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,14 @@ import schema from "./schema";
//@ts-ignore ajv typings not working
importJsonSchemafrom"ajv";

exportfunctionvalidateSchema(json:T.Tutorial){
exportfunctionvalidateSchema(json:any){
// validate using https://json-schema.org/
constjsonSchema=newJsonSchema({allErrors:true,verbose:true});
// support draft-07 of json schema
jsonSchema.addMetaSchema(require("ajv/lib/refs/json-schema-draft-07.json"));

constvalid=jsonSchema.compile(schema,json);
constvalidator=jsonSchema.compile(schema);
constvalid=validator(json);

if(!valid){
// log errors
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp