json-schema-to-typescript
Advanced tools
Comparing version 15.0.0 to 15.0.1
#!/usr/bin/env node | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -48,3 +25,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
const fs_1 = require("fs"); | ||
const mkdirp = __importStar(require("mkdirp")); | ||
const glob_1 = require("glob"); | ||
@@ -150,3 +126,3 @@ const is_glob_1 = __importDefault(require("is-glob")); | ||
if (!isDir((0, path_1.dirname)(outputPath))) { | ||
mkdirp.sync((0, path_1.dirname)(outputPath)); | ||
(0, fs_1.mkdirSync)((0, path_1.dirname)(outputPath), { recursive: true }); | ||
} | ||
@@ -153,0 +129,0 @@ return (0, fs_1.writeFileSync)(outputPath, result); |
@@ -214,3 +214,3 @@ "use strict"; | ||
function log(style, title, ...messages) { | ||
var _a; | ||
var _a, _b; | ||
if (!process.env.VERBOSE) { | ||
@@ -223,3 +223,3 @@ return; | ||
} | ||
console.info(require('cli-color').whiteBright.bgCyan('debug'), (_a = getStyledTextForLogging(style)) === null || _a === void 0 ? void 0 : _a(title), ...messages); | ||
console.info((_a = color()) === null || _a === void 0 ? void 0 : _a.whiteBright.bgCyan('debug'), (_b = getStyledTextForLogging(style)) === null || _b === void 0 ? void 0 : _b(title), ...messages); | ||
if (lastMessage) { | ||
@@ -231,2 +231,3 @@ console.dir(lastMessage, { depth: 6, maxArrayLength: 6 }); | ||
function getStyledTextForLogging(style) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
if (!process.env.VERBOSE) { | ||
@@ -237,15 +238,15 @@ return; | ||
case 'blue': | ||
return require('cli-color').whiteBright.bgBlue; | ||
return (_a = color()) === null || _a === void 0 ? void 0 : _a.whiteBright.bgBlue; | ||
case 'cyan': | ||
return require('cli-color').whiteBright.bgCyan; | ||
return (_b = color()) === null || _b === void 0 ? void 0 : _b.whiteBright.bgCyan; | ||
case 'green': | ||
return require('cli-color').whiteBright.bgGreen; | ||
return (_c = color()) === null || _c === void 0 ? void 0 : _c.whiteBright.bgGreen; | ||
case 'magenta': | ||
return require('cli-color').whiteBright.bgMagenta; | ||
return (_d = color()) === null || _d === void 0 ? void 0 : _d.whiteBright.bgMagenta; | ||
case 'red': | ||
return require('cli-color').whiteBright.bgRedBright; | ||
return (_e = color()) === null || _e === void 0 ? void 0 : _e.whiteBright.bgRedBright; | ||
case 'white': | ||
return require('cli-color').black.bgWhite; | ||
return (_f = color()) === null || _f === void 0 ? void 0 : _f.black.bgWhite; | ||
case 'yellow': | ||
return require('cli-color').whiteBright.bgYellow; | ||
return (_g = color()) === null || _g === void 0 ? void 0 : _g.whiteBright.bgYellow; | ||
} | ||
@@ -382,2 +383,10 @@ } | ||
} | ||
function color() { | ||
let cliColor; | ||
try { | ||
cliColor = require('cli-color'); | ||
} | ||
catch (_a) { } | ||
return cliColor; | ||
} | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "json-schema-to-typescript", | ||
"version": "15.0.0", | ||
"version": "15.0.1", | ||
"description": "compile json schema to typescript typings", | ||
@@ -53,4 +53,2 @@ "main": "dist/src/index.js", | ||
"@types/json-schema": "^7.0.15", | ||
"@types/lodash": "^4.17.0", | ||
"cli-color": "^2.0.4", | ||
"glob": "^10.3.12", | ||
@@ -61,4 +59,2 @@ "is-glob": "^4.0.3", | ||
"minimist": "^1.2.8", | ||
"mkdirp": "^3.0.1", | ||
"node-fetch": "^3.3.2", | ||
"prettier": "^3.2.5" | ||
@@ -70,6 +66,5 @@ }, | ||
"@types/js-yaml": "^4.0.9", | ||
"@types/lodash": "^4.17.0", | ||
"@types/minimist": "^1.2.5", | ||
"@types/mkdirp": "^2.0.0", | ||
"@types/node": "^20.12.7", | ||
"@types/rimraf": "^4.0.5", | ||
"@typescript-eslint/eslint-plugin": "^7.7.0", | ||
@@ -80,2 +75,3 @@ "@typescript-eslint/parser": "^7.7.0", | ||
"browserify-shim": "^3.8.16", | ||
"cli-color": "^2.0.4", | ||
"concurrently": "^8.2.2", | ||
@@ -82,0 +78,0 @@ "eslint": "^8.56.0", |
#!/usr/bin/env node | ||
import minimist from 'minimist' | ||
import {readFileSync, writeFileSync, existsSync, lstatSync, readdirSync} from 'fs' | ||
import * as mkdirp from 'mkdirp' | ||
import {readFileSync, writeFileSync, existsSync, lstatSync, readdirSync, mkdirSync} from 'fs' | ||
import {glob} from 'glob' | ||
@@ -122,3 +121,3 @@ import isGlob from 'is-glob' | ||
if (!isDir(dirname(outputPath))) { | ||
mkdirp.sync(dirname(outputPath)) | ||
mkdirSync(dirname(outputPath), {recursive: true}) | ||
} | ||
@@ -125,0 +124,0 @@ return writeFileSync(outputPath, result) |
@@ -6,2 +6,3 @@ import {deburr, isPlainObject, trim, upperFirst} from 'lodash' | ||
import yaml from 'js-yaml' | ||
import type {Format} from 'cli-color' | ||
@@ -246,3 +247,3 @@ // TODO: pull out into a separate package | ||
} | ||
console.info(require('cli-color').whiteBright.bgCyan('debug'), getStyledTextForLogging(style)?.(title), ...messages) | ||
console.info(color()?.whiteBright.bgCyan('debug'), getStyledTextForLogging(style)?.(title), ...messages) | ||
if (lastMessage) { | ||
@@ -259,15 +260,15 @@ console.dir(lastMessage, {depth: 6, maxArrayLength: 6}) | ||
case 'blue': | ||
return require('cli-color').whiteBright.bgBlue | ||
return color()?.whiteBright.bgBlue | ||
case 'cyan': | ||
return require('cli-color').whiteBright.bgCyan | ||
return color()?.whiteBright.bgCyan | ||
case 'green': | ||
return require('cli-color').whiteBright.bgGreen | ||
return color()?.whiteBright.bgGreen | ||
case 'magenta': | ||
return require('cli-color').whiteBright.bgMagenta | ||
return color()?.whiteBright.bgMagenta | ||
case 'red': | ||
return require('cli-color').whiteBright.bgRedBright | ||
return color()?.whiteBright.bgRedBright | ||
case 'white': | ||
return require('cli-color').black.bgWhite | ||
return color()?.black.bgWhite | ||
case 'yellow': | ||
return require('cli-color').whiteBright.bgYellow | ||
return color()?.whiteBright.bgYellow | ||
} | ||
@@ -417,1 +418,9 @@ } | ||
} | ||
function color(): Format { | ||
let cliColor | ||
try { | ||
cliColor = require('cli-color') | ||
} catch {} | ||
return cliColor | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
200717
4966
- Removed@types/lodash@^4.17.0
- Removedcli-color@^2.0.4
- Removedmkdirp@^3.0.1
- Removednode-fetch@^3.3.2
- Removed@types/lodash@4.17.10(transitive)
- Removedcli-color@2.0.4(transitive)
- Removedd@1.0.2(transitive)
- Removeddata-uri-to-buffer@4.0.1(transitive)
- Removedes5-ext@0.10.64(transitive)
- Removedes6-iterator@2.0.3(transitive)
- Removedes6-symbol@3.1.4(transitive)
- Removedes6-weak-map@2.0.3(transitive)
- Removedesniff@2.0.1(transitive)
- Removedevent-emitter@0.3.5(transitive)
- Removedext@1.7.0(transitive)
- Removedfetch-blob@3.2.0(transitive)
- Removedformdata-polyfill@4.0.10(transitive)
- Removedis-promise@2.2.2(transitive)
- Removedlru-queue@0.1.0(transitive)
- Removedmemoizee@0.4.17(transitive)
- Removedmkdirp@3.0.1(transitive)
- Removednext-tick@1.1.0(transitive)
- Removednode-domexception@1.0.0(transitive)
- Removednode-fetch@3.3.2(transitive)
- Removedtimers-ext@0.1.8(transitive)
- Removedtype@2.7.3(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)