Skip to content

Commit

Permalink
1.0.2 - treat bigint as primitive too
Browse files Browse the repository at this point in the history
  • Loading branch information
elisherer committed Jul 27, 2024
1 parent d861895 commit 5a0fb71
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nlighten/json-schema-utils",
"description": "Various utilities for handling JSON Schemas (parse, join, generate, samples)",
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/json-schema-utils.js",
"umd:main": "dist/json-schema-utils.umd.js",
"module": "dist/json-schema-utils.module.js",
Expand Down
2 changes: 1 addition & 1 deletion src/parse/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const _internalParseSchema = (
if (context.options?.outputSample) {
sampleValue = getSampleValue(context, schema);
if (key != null) {
if (!Object.hasOwn(context.sample, key)) {
if (!Object.prototype.hasOwnProperty.call(context.sample, key)) {
context.sample[key] = sampleValue;
}
} else {
Expand Down
1 change: 1 addition & 0 deletions src/utils/areSimilar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function isPrimitive(object: any) {
case "undefined":
case "boolean":
case "number":
case "bigint":
case "string":
case "symbol":
return true;
Expand Down

0 comments on commit 5a0fb71

Please sign in to comment.