source: trip-planner-front/node_modules/webpack/lib/util/create-schema-validation.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 477 bytes
RevLine 
[6a3a178]1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const memoize = require("./memoize");
9
10const getValidate = memoize(() => require("schema-utils").validate);
11
12const createSchemaValidation = (check = v => false, getSchema, options) => {
13 getSchema = memoize(getSchema);
14 return value => {
15 if (!check(value)) {
16 getValidate()(getSchema(), value, options);
17 }
18 };
19};
20
21module.exports = createSchemaValidation;
Note: See TracBrowser for help on using the repository browser.