@form8ion/core
Advanced tools
Comparing version 3.0.0 to 3.1.0
'use strict'; | ||
var fs = require('fs'); | ||
var hoek = require('@hapi/hoek'); | ||
var path = require('path'); | ||
@@ -10,2 +11,21 @@ var spdxLicenseList = require('spdx-license-list/simple.js'); | ||
function _interopNamespaceDefault(e) { | ||
var n = Object.create(null); | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
if (k !== 'default') { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { return e[k]; } | ||
}); | ||
} | ||
}); | ||
} | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
var hoek__namespace = /*#__PURE__*/_interopNamespaceDefault(hoek); | ||
async function exists (path) { | ||
@@ -36,2 +56,11 @@ try { | ||
function optionsValidator (schema, options) { | ||
const { | ||
error, | ||
value | ||
} = schema.validate(options); | ||
hoek__namespace.assert(!error, error); | ||
return value; | ||
} | ||
const questionNames = { | ||
@@ -226,3 +255,4 @@ PROJECT_NAME: 'projectName', | ||
exports.questionsForBaseDetails = questionsForBaseDetails; | ||
exports.validateOptions = optionsValidator; | ||
exports.writeConfigFile = write; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"engines": { | ||
@@ -59,2 +59,3 @@ "node": "^16.14 || >=18" | ||
"dependencies": { | ||
"@hapi/hoek": "^11.0.2", | ||
"@travi/cli-messages": "^1.0.5", | ||
@@ -61,0 +62,0 @@ "deepmerge": "^4.2.2", |
@@ -20,2 +20,3 @@ # core | ||
* [`directoryExists`](#directoryexists) | ||
* [`validateOptions`](#validateoptions) | ||
* [`applyEnhancers`](#applyenhancers) | ||
@@ -76,2 +77,6 @@ * [`results` __object__ (_required_)](#results-object-required) | ||
#### `validateOptions` | ||
Validates provided options against a [joi](https://joi.dev/) schema. | ||
#### `applyEnhancers` | ||
@@ -78,0 +83,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51330
459
205
5
+ Added@hapi/hoek@^11.0.2
+ Added@hapi/hoek@11.0.4(transitive)