@kubb/parser
Advanced tools
Comparing version 2.12.5 to 2.12.6
@@ -1,56 +0,3 @@ | ||
import { | ||
__commonJS, | ||
__toESM, | ||
init_esm_shims | ||
} from "./chunk-MOTWTBDS.js"; | ||
// ../../node_modules/.pnpm/lodash.tonumber@4.0.3/node_modules/lodash.tonumber/index.js | ||
var require_lodash = __commonJS({ | ||
"../../node_modules/.pnpm/lodash.tonumber@4.0.3/node_modules/lodash.tonumber/index.js"(exports, module) { | ||
"use strict"; | ||
init_esm_shims(); | ||
var NAN = 0 / 0; | ||
var symbolTag = "[object Symbol]"; | ||
var reTrim = /^\s+|\s+$/g; | ||
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; | ||
var reIsBinary = /^0b[01]+$/i; | ||
var reIsOctal = /^0o[0-7]+$/i; | ||
var freeParseInt = parseInt; | ||
var objectProto = Object.prototype; | ||
var objectToString = objectProto.toString; | ||
function isObject(value) { | ||
var type = typeof value; | ||
return !!value && (type == "object" || type == "function"); | ||
} | ||
function isObjectLike(value) { | ||
return !!value && typeof value == "object"; | ||
} | ||
function isSymbol(value) { | ||
return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; | ||
} | ||
function toNumber2(value) { | ||
if (typeof value == "number") { | ||
return value; | ||
} | ||
if (isSymbol(value)) { | ||
return NAN; | ||
} | ||
if (isObject(value)) { | ||
var other = typeof value.valueOf == "function" ? value.valueOf() : value; | ||
value = isObject(other) ? other + "" : other; | ||
} | ||
if (typeof value != "string") { | ||
return value === 0 ? value : +value; | ||
} | ||
value = value.replace(reTrim, ""); | ||
var isBinary = reIsBinary.test(value); | ||
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; | ||
} | ||
module.exports = toNumber2; | ||
} | ||
}); | ||
// src/factory.ts | ||
init_esm_shims(); | ||
var import_lodash = __toESM(require_lodash(), 1); | ||
import { isNumber } from "remeda"; | ||
import ts from "typescript"; | ||
@@ -77,8 +24,2 @@ var { factory } = ts; | ||
} | ||
function isNumber(value) { | ||
if (typeof value === "string") { | ||
return !Number.isNaN((0, import_lodash.default)(value)); | ||
} | ||
return typeof value === "number"; | ||
} | ||
var questionToken = factory.createToken(ts.SyntaxKind.QuestionToken); | ||
@@ -342,4 +283,4 @@ function createQuestionToken(token) { | ||
let initializer = factory.createStringLiteral(value?.toString()); | ||
if (isNumber(value)) { | ||
initializer = factory.createNumericLiteral((0, import_lodash.default)(value)); | ||
if (isNumber(Number.parseInt(value.toString()))) { | ||
initializer = factory.createNumericLiteral(value); | ||
} | ||
@@ -349,3 +290,3 @@ if (typeof value === "boolean") { | ||
} | ||
if (isNumber(key)) { | ||
if (isNumber(Number.parseInt(key.toString()))) { | ||
return factory.createEnumMember(factory.createStringLiteral(`${typeName}_${key}`), initializer); | ||
@@ -352,0 +293,0 @@ } |
@@ -1,10 +0,2 @@ | ||
import { | ||
init_esm_shims | ||
} from "./chunk-MOTWTBDS.js"; | ||
// src/index.ts | ||
init_esm_shims(); | ||
// src/api.ts | ||
init_esm_shims(); | ||
import path from "path"; | ||
@@ -41,7 +33,3 @@ import ts from "typescript"; | ||
// src/parse.ts | ||
init_esm_shims(); | ||
// src/print.ts | ||
init_esm_shims(); | ||
import ts2 from "typescript"; | ||
@@ -48,0 +36,0 @@ var { factory } = ts2; |
{ | ||
"name": "@kubb/parser", | ||
"version": "2.12.5", | ||
"version": "2.12.6", | ||
"description": "Generator parser", | ||
@@ -51,18 +51,16 @@ "keywords": [ | ||
"dependencies": { | ||
"typescript": "^5.4.4" | ||
"remeda": "^1.58.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash.tonumber": "^4.0.9", | ||
"eslint": "^8.57.0", | ||
"lodash.tonumber": "^4.0.3", | ||
"prettier": "^3.2.5", | ||
"tsup": "^8.0.2", | ||
"@kubb/eslint-config": "1.1.8", | ||
"@kubb/biome-config": "0.1.0", | ||
"@kubb/ts-config": "0.1.0", | ||
"@kubb/tsup-config": "1.1.8" | ||
}, | ||
"packageManager": "pnpm@8.3.0", | ||
"packageManager": "pnpm@8.15.0", | ||
"engines": { | ||
"node": ">=18", | ||
"pnpm": ">=8.3.0" | ||
"pnpm": ">=8.15.0" | ||
}, | ||
@@ -76,4 +74,4 @@ "publishConfig": { | ||
"clean": "npx rimraf ./dist", | ||
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint --format pretty .", | ||
"lint-fix": "bun run lint --quiet --fix", | ||
"lint": "bun biome lint .", | ||
"lint:fix": "bun biome lint --apply-unsafe .", | ||
"release": "pnpm publish --no-git-check", | ||
@@ -80,0 +78,0 @@ "release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check", |
@@ -1,4 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/unbound-method */ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import toNumber from 'lodash.tonumber' | ||
import { isNumber } from 'remeda' | ||
import ts from 'typescript' | ||
@@ -33,9 +31,2 @@ | ||
function isNumber(value: unknown): value is number { | ||
if (typeof value === 'string') { | ||
return !Number.isNaN(toNumber(value)) | ||
} | ||
return typeof value === 'number' | ||
} | ||
const questionToken = factory.createToken(ts.SyntaxKind.QuestionToken) | ||
@@ -430,4 +421,4 @@ | ||
if (isNumber(value)) { | ||
initializer = factory.createNumericLiteral(toNumber(value)) | ||
if (isNumber(Number.parseInt(value.toString()))) { | ||
initializer = factory.createNumericLiteral(value as number) | ||
} | ||
@@ -438,3 +429,3 @@ if (typeof value === 'boolean') { | ||
if (isNumber(key)) { | ||
if (isNumber(Number.parseInt(key.toString()))) { | ||
return factory.createEnumMember(factory.createStringLiteral(`${typeName}_${key}`), initializer) | ||
@@ -441,0 +432,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
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
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
5
130138
2
20
1661
+ Addedremeda@^1.58.2
+ Addedremeda@1.61.0(transitive)
Updatedtypescript@^5.4.5