Skip to content
Closed
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

var Ajv = require( 'ajv' );
var schema = require( './../lib' );
var pkg = require( './../package.json' );

var ajv = new Ajv();

var bool = ajv.validate( schema(), pkg );
console.log( bool );

var errs = ajv.errors;
console.log( errs );
// existing code
// more existing code
// added line to fix lint error
Comment on lines +1 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the runnable schema example

This replaces the package's only example with placeholder comments, so anyone running lib/node_modules/@stdlib/_tools/package-json/schema/examples/index.js now gets a silent no-op instead of the documented AJV validation of package.json. Since package.json still advertises ./examples as the example directory and the README shows this API usage, the example should keep importing the schema and validating a package rather than being emptied.

Useful? React with 👍 / 👎.

Loading