Skip to content

Commit

Permalink
Merge pull request #1767 from hapijs/v14-temp
Browse files Browse the repository at this point in the history
V14 temp
  • Loading branch information
hueniverse committed Mar 29, 2019
2 parents bc09c65 + 4dd853f commit dd740de
Show file tree
Hide file tree
Showing 34 changed files with 63 additions and 142 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -8,8 +8,8 @@ coverage.*

**/*.pem

**/.idea
**/.vscode
**/.vs
**/.vscode
**/.idea

sandbox.js
13 changes: 8 additions & 5 deletions .travis.yml
@@ -1,14 +1,17 @@
language: node_js

os:
- linux
- osx
- windows

node_js:
- "8"
- "10"
- "11"
- "node"

sudo: false

install:
- "npm install"

os:
- "linux"
- "osx"
- "windows"
2 changes: 0 additions & 2 deletions API.md
Expand Up @@ -2,8 +2,6 @@
# 14.3.1 API Reference
<!-- versionstop -->

<img src="https://raw.github.com/hapijs/joi/master/images/validation.png" align="right" />

<!-- toc -->

- [Joi](#joi)
Expand Down
25 changes: 0 additions & 25 deletions LICENSE

This file was deleted.

10 changes: 10 additions & 0 deletions LICENSE.md
@@ -0,0 +1,10 @@
Copyright (c) 2012-2019, Sideway Inc, and project contributors
Copyright (c) 2012-2014, Walmart.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7 changes: 2 additions & 5 deletions README.md
@@ -1,11 +1,8 @@
![joi Logo](https://raw.github.com/hapijs/joi/master/images/joi.png)
# joi

Object schema description language and validator for JavaScript objects.

[![npm version](https://badge.fury.io/js/joi.svg)](http://badge.fury.io/js/joi)
[![Build Status](https://travis-ci.org/hapijs/joi.svg?branch=master)](https://travis-ci.org/hapijs/joi)
[![NSP Status](https://nodesecurity.io/orgs/hapijs/projects/0394bf83-b5bc-410b-878c-e8cf1b92033e/badge)](https://nodesecurity.io/orgs/hapijs/projects/0394bf83-b5bc-410b-878c-e8cf1b92033e)
[![Known Vulnerabilities](https://snyk.io/test/github/hapijs/joi/badge.svg)](https://snyk.io/test/github/hapijs/joi)

Lead Maintainer: [Nicolas Morel](https://github.com/marsup)

Expand All @@ -16,7 +13,7 @@ Imagine you run facebook and you want visitors to sign up on the website with re
This is joi, joi allows you to create *blueprints* or *schemas* for JavaScript objects (an object that stores information) to ensure *validation* of key information.

# API
See the detailed [API Reference](https://github.com/hapijs/joi/blob/v14.3.1/API.md).
See the detailed [API Reference](/blob/v14.4.0/API.md).

# Example

Expand Down
Binary file removed images/joi.png
Binary file not shown.
Binary file removed images/validation.png
Binary file not shown.
7 changes: 1 addition & 6 deletions lib/cast.js 100644 → 100755
@@ -1,14 +1,9 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');
const Ref = require('./ref');

// Type modules are delay-loaded to prevent circular dependencies


// Declare internals

const internals = {};

Expand Down
9 changes: 5 additions & 4 deletions lib/errors.js
@@ -1,17 +1,15 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');
const Language = require('./language');


// Declare internals

const internals = {
annotations: Symbol('joi-annotations')
};


internals.stringify = function (value, wrapArrays) {

const type = typeof value;
Expand Down Expand Up @@ -45,6 +43,7 @@ internals.stringify = function (value, wrapArrays) {
return JSON.stringify(value);
};


exports.Err = class {

constructor(type, context, state, options, flags, message, template) {
Expand Down Expand Up @@ -211,11 +210,13 @@ exports.process = function (errors, object) {


// Inspired by json-stringify-safe

internals.safeStringify = function (obj, spaces) {

return JSON.stringify(obj, internals.serializer(), spaces);
};


internals.serializer = function () {

const keys = [];
Expand Down
7 changes: 3 additions & 4 deletions lib/index.js 100644 → 100755
@@ -1,8 +1,7 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');
const Any = require('./types/any');
const Cast = require('./cast');
const Errors = require('./errors');
Expand All @@ -11,8 +10,6 @@ const Ref = require('./ref');
const Settings = require('./types/any/settings');


// Declare internals

const internals = {
alternatives: require('./types/alternatives'),
array: require('./types/array'),
Expand All @@ -26,6 +23,7 @@ const internals = {
symbol: require('./types/symbol')
};


internals.callWithDefaults = function (schema, args) {

Hoek.assert(this, 'Must be invoked on a Joi instance.');
Expand All @@ -39,6 +37,7 @@ internals.callWithDefaults = function (schema, args) {
return schema._init(...args);
};


internals.root = function () {

const any = new Any();
Expand Down
5 changes: 0 additions & 5 deletions lib/language.js
@@ -1,10 +1,5 @@
'use strict';

// Load modules


// Declare internals

const internals = {};


Expand Down
6 changes: 1 addition & 5 deletions lib/ref.js 100644 → 100755
@@ -1,11 +1,7 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');


// Declare internals

const internals = {};

Expand Down
5 changes: 1 addition & 4 deletions lib/schemas.js 100644 → 100755
@@ -1,14 +1,11 @@
'use strict';

// Load modules

const Joi = require('./index');


// Declare internals

const internals = {};


exports.options = Joi.object({
abortEarly: Joi.boolean(),
convert: Joi.boolean(),
Expand Down
5 changes: 1 addition & 4 deletions lib/types/alternatives/index.js 100644 → 100755
@@ -1,15 +1,12 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');
const Any = require('../any');
const Cast = require('../../cast');
const Ref = require('../../ref');


// Declare internals

const internals = {};


Expand Down
8 changes: 2 additions & 6 deletions lib/types/any/index.js 100644 → 100755
@@ -1,22 +1,18 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');
const Settings = require('./settings');
const Ref = require('../../ref');
const Errors = require('../../errors');
const State = require('../state');
const Symbols = require('../symbols');

// Delay-loaded to prevent circular dependencies
let Alternatives = null;
let Alternatives = null; // Delay-loaded to prevent circular dependencies
let Cast = null;
let Schemas = null;


// Declare internals

const internals = {
Set: require('../../set')
};
Expand Down
6 changes: 1 addition & 5 deletions lib/types/any/settings.js 100644 → 100755
@@ -1,14 +1,10 @@
'use strict';

// Load modules

const Hoek = require('hoek');
const Hoek = require('@hapi/hoek');

const Symbols = require('../symbols');


// Declare internals

const internals = {};


Expand Down
6 changes: 1 addition & 5 deletions lib/types/array/index.js 100644 → 100755
@@ -1,17 +1,13 @@
'use strict';

// Load modules

const Hoek = require('hoek');
const Hoek = require('@hapi/hoek');

const Any = require('../any');
const Cast = require('../../cast');
const Ref = require('../../ref');
const State = require('../state');


// Declare internals

const internals = {};


Expand Down
5 changes: 1 addition & 4 deletions lib/types/binary/index.js 100644 → 100755
@@ -1,13 +1,10 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Any = require('../any');
const Hoek = require('hoek');


// Declare internals

const internals = {};


Expand Down
5 changes: 1 addition & 4 deletions lib/types/boolean/index.js 100644 → 100755
@@ -1,13 +1,10 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Any = require('../any');
const Hoek = require('hoek');


// Declare internals

const internals = {
Set: require('../../set')
};
Expand Down
5 changes: 1 addition & 4 deletions lib/types/date/index.js 100644 → 100755
@@ -1,14 +1,11 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Any = require('../any');
const Ref = require('../../ref');
const Hoek = require('hoek');


// Declare internals

const internals = {};

internals.isoDate = /^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/;
Expand Down
5 changes: 1 addition & 4 deletions lib/types/func/index.js 100644 → 100755
@@ -1,14 +1,11 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Hoek = require('hoek');
const ObjectType = require('../object');
const Ref = require('../../ref');


// Declare internals

const internals = {};


Expand Down
5 changes: 1 addition & 4 deletions lib/types/lazy/index.js 100644 → 100755
@@ -1,13 +1,10 @@
'use strict';

// Load modules
const Hoek = require('@hapi/hoek');

const Any = require('../any');
const Hoek = require('hoek');


// Declare internals

const internals = {};


Expand Down

0 comments on commit dd740de

Please sign in to comment.