Skip to content

Commit

Permalink
fix: to pojo false check (#489)
Browse files Browse the repository at this point in the history
Signed-off-by: hxtree <[email protected]>
  • Loading branch information
hxtree authored Nov 2, 2023
1 parent 8e2ee7a commit 7cdf976
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 19 deletions.
12 changes: 12 additions & 0 deletions libraries/faker-factory/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/faker-factory",
"entries": [
{
"version": "1.2.2",
"tag": "@cats-cradle/faker-factory_v1.2.2",
"date": "Thu, 02 Nov 2023 22:51:17 GMT",
"comments": {
"patch": [
{
"comment": "fix to pojo false check"
}
]
}
},
{
"version": "1.2.1",
"tag": "@cats-cradle/faker-factory_v1.2.1",
Expand Down
9 changes: 8 additions & 1 deletion libraries/faker-factory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @cats-cradle/faker-factory

This log was last generated on Thu, 02 Nov 2023 12:35:11 GMT and should not be manually modified.
This log was last generated on Thu, 02 Nov 2023 22:51:17 GMT and should not be manually modified.

## 1.2.2
Thu, 02 Nov 2023 22:51:17 GMT

### Patches

- fix to pojo false check

## 1.2.1
Thu, 02 Nov 2023 12:35:11 GMT
Expand Down
2 changes: 1 addition & 1 deletion libraries/faker-factory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cats-cradle/faker-factory",
"version": "1.2.1",
"version": "1.2.2",
"main": "./dist/index.js",
"repository": {
"type": "git",
Expand Down
8 changes: 3 additions & 5 deletions libraries/faker-factory/src/pojo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ describe('isPojo', () => {
const sut = new TestClass();
sut.a = 'Test';

expect(isPojo(sut)).toBeFalsy();
expect(isPojo(sut)).toBe(false);
});

it('should return true for pojo', () => {
const sut = new TestClass();
sut.a = 'Test';
const pojo = sut;
const sut = { a: 'Test' };

expect(isPojo(pojo)).toBeFalsy();
expect(isPojo(sut)).toBe(true);
});
});
5 changes: 1 addition & 4 deletions libraries/faker-factory/src/pojo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,5 @@ export function isPojo(obj: any): boolean {
return false;
}

const prototype = Object.getPrototypeOf(obj);

// If the prototype is null, it's a plain object
return prototype === null;
return Object.getPrototypeOf(obj) === Object.prototype;
}
12 changes: 12 additions & 0 deletions libraries/nestjs-modules/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/nestjs-modules",
"entries": [
{
"version": "0.2.8",
"tag": "@cats-cradle/nestjs-modules_v0.2.8",
"date": "Thu, 02 Nov 2023 22:51:17 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.2`"
}
]
}
},
{
"version": "0.2.7",
"tag": "@cats-cradle/nestjs-modules_v0.2.7",
Expand Down
7 changes: 6 additions & 1 deletion libraries/nestjs-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/nestjs-modules

This log was last generated on Thu, 02 Nov 2023 12:35:11 GMT and should not be manually modified.
This log was last generated on Thu, 02 Nov 2023 22:51:17 GMT and should not be manually modified.

## 0.2.8
Thu, 02 Nov 2023 22:51:17 GMT

_Version update only_

## 0.2.7
Thu, 02 Nov 2023 12:35:11 GMT
Expand Down
2 changes: 1 addition & 1 deletion libraries/nestjs-modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cats-cradle/nestjs-modules",
"version": "0.2.7",
"version": "0.2.8",
"main": "./dist/index.js",
"repository": {
"type": "git",
Expand Down
15 changes: 15 additions & 0 deletions services/authentication-service/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@cats-cradle/authentication-service",
"entries": [
{
"version": "1.0.9",
"tag": "@cats-cradle/authentication-service_v1.0.9",
"date": "Thu, 02 Nov 2023 22:51:17 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/nestjs-modules\" to `0.2.8`"
},
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.2`"
}
]
}
},
{
"version": "1.0.8",
"tag": "@cats-cradle/authentication-service_v1.0.8",
Expand Down
7 changes: 6 additions & 1 deletion services/authentication-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/authentication-service

This log was last generated on Thu, 02 Nov 2023 12:35:11 GMT and should not be manually modified.
This log was last generated on Thu, 02 Nov 2023 22:51:17 GMT and should not be manually modified.

## 1.0.9
Thu, 02 Nov 2023 22:51:17 GMT

_Version update only_

## 1.0.8
Thu, 02 Nov 2023 12:35:11 GMT
Expand Down
2 changes: 1 addition & 1 deletion services/authentication-service/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cats-cradle/authentication-service",
"module": "commonjs",
"version": "1.0.8",
"version": "1.0.9",
"scripts": {
"dev": "nest start --debug --watch",
"build": "tsc",
Expand Down
12 changes: 12 additions & 0 deletions services/email-service/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/email-service",
"entries": [
{
"version": "0.0.16",
"tag": "@cats-cradle/email-service_v0.0.16",
"date": "Thu, 02 Nov 2023 22:51:17 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.2`"
}
]
}
},
{
"version": "0.0.15",
"tag": "@cats-cradle/email-service_v0.0.15",
Expand Down
7 changes: 6 additions & 1 deletion services/email-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/email-service

This log was last generated on Thu, 02 Nov 2023 12:35:11 GMT and should not be manually modified.
This log was last generated on Thu, 02 Nov 2023 22:51:17 GMT and should not be manually modified.

## 0.0.16
Thu, 02 Nov 2023 22:51:17 GMT

_Version update only_

## 0.0.15
Thu, 02 Nov 2023 12:35:11 GMT
Expand Down
2 changes: 1 addition & 1 deletion services/email-service/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cats-cradle/email-service",
"module": "commonjs",
"version": "0.0.15",
"version": "0.0.16",
"scripts": {
"dev": "nest start --debug --watch",
"build": "tsc",
Expand Down
12 changes: 12 additions & 0 deletions services/html-to-pdf/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/html-to-pdf",
"entries": [
{
"version": "1.0.10",
"tag": "@cats-cradle/html-to-pdf_v1.0.10",
"date": "Thu, 02 Nov 2023 22:51:17 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.2`"
}
]
}
},
{
"version": "1.0.9",
"tag": "@cats-cradle/html-to-pdf_v1.0.9",
Expand Down
7 changes: 6 additions & 1 deletion services/html-to-pdf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/html-to-pdf

This log was last generated on Thu, 02 Nov 2023 12:35:11 GMT and should not be manually modified.
This log was last generated on Thu, 02 Nov 2023 22:51:17 GMT and should not be manually modified.

## 1.0.10
Thu, 02 Nov 2023 22:51:17 GMT

_Version update only_

## 1.0.9
Thu, 02 Nov 2023 12:35:11 GMT
Expand Down
2 changes: 1 addition & 1 deletion services/html-to-pdf/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cats-cradle/html-to-pdf",
"module": "commonjs",
"version": "1.0.9",
"version": "1.0.10",
"license": "MIT",
"description": "Your Go-To Solution for PDF Generation from HTML.",
"bugs": {
Expand Down

0 comments on commit 7cdf976

Please sign in to comment.