Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniopresto committed Dec 2, 2024
1 parent 876ccc6 commit 3e7812b
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powership",
"version": "5.6.1",
"version": "5.7.7",
"private": true,
"scripts": {
"patch": "run-s patch:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/accounts",
"version": "5.6.1",
"version": "5.7.7",
"description": "Powership accounts",
"type": "module",
"main": "./out/index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/babel-plugins",
"version": "5.6.1",
"version": "5.7.7",
"main": "./out/index.js",
"sideEffects": false,
"typings": "./out/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/boilerplate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/boilerplate",
"version": "5.6.1",
"version": "5.7.7",
"author": "antoniopresto <[email protected]>",
"sideEffects": false,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/entity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/entity",
"version": "5.6.1",
"version": "5.7.7",
"type": "module",
"main": "./out/index.cjs",
"module": "./out/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/logstorm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "logstorm",
"version": "5.6.1",
"version": "5.7.7",
"typings": "out",
"author": "antoniopresto <[email protected]>",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/mongo",
"version": "5.6.1",
"version": "5.7.7",
"type": "module",
"main": "./out/index.cjs",
"module": "./out/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plugin-engine",
"version": "5.6.1",
"version": "5.7.7",
"type": "module",
"main": "./out/index.cjs",
"module": "./out/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/powership/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powership",
"version": "5.6.1",
"version": "5.7.7",
"author": "antoniopresto <[email protected]>",
"type": "module",
"main": "./out/index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/runmate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "runmate",
"version": "5.6.1",
"version": "5.7.7",
"typings": "out",
"author": "antoniopresto <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/schema",
"version": "5.6.1",
"version": "5.7.7",
"type": "module",
"main": "./out/index.cjs",
"module": "./out/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/server",
"version": "5.6.1",
"version": "5.7.7",
"type": "module",
"main": "./out/index.cjs",
"module": "./out/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/transporter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/transporter",
"version": "5.6.1",
"version": "5.7.7",
"type": "module",
"main": "./out/index.cjs",
"module": "./out/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@powership/utils",
"version": "5.6.1",
"version": "5.7.7",
"typings": "out",
"author": "antoniopresto <[email protected]>",
"license": "MIT",
Expand Down
11 changes: 1 addition & 10 deletions packages/utils/src/getTypeName.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isPlainObject } from 'lodash';

import { BJSON } from './BJSON';
import { proxyRealValue } from './createProxy';
import { hashObject } from './hashObject';
import { tupleEnum } from './typings';
Expand All @@ -11,14 +10,6 @@ export function getTypeName(input: any): string {
return describeConstructor(input).constructorName;
}

export const messageTypes = {
expectedValueOfTypeFound(expected: string, foundValue: unknown) {
return `Expected value to be of type '${expected}', but found a '${getTypeName(
foundValue
)}' instead.`;
},
};

export const KNOWN_CONSTRUCTOR_NAMES = tupleEnum(
'undefined',
'null',
Expand Down Expand Up @@ -165,7 +156,7 @@ export function describeType(value) {

let _string: string;
function toString() {
return (_string = _string ?? BJSON.stringify(value));
return (_string = _string ?? hashObject(value));
}

let _hash: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/utils/src/hashObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export function hashObject(obj: any) {
respectType: false,
});
}

export { objectHash };
12 changes: 4 additions & 8 deletions packages/utils/src/simpleObjectHash.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { BJSON } from './BJSON';
import { proxyRealValue } from './createProxy';
import { describeConstructor, getNativeConstructorType } from './getTypeName';
import { hashName, hashString, stringHash } from './hashString';
import { sortObject } from './sortObject';
import { objectHash } from './hashObject';
import { hashName, hashString } from './hashString';

export function simpleObjectHash(value: any): string {
return hashName(_simpleObjectHash(value));
Expand All @@ -15,8 +14,7 @@ export function _simpleObjectHash(value: any): string {
value = proxyRealValue(value);

if (typeof value === 'function' && value.name) {
const json = BJSON.stringify(value);
const hash = stringHash(json);
const hash = objectHash(value);
return `;function(${value.name}_${hash});`;
}

Expand All @@ -35,9 +33,7 @@ export function _simpleObjectHash(value: any): string {
}
}

const sorted = sortObject(value);

const bJSON = BJSON.stringify(sorted);
const bJSON = objectHash(value);

return `;${constructorName}(${hashString(bJSON)})`;
}

0 comments on commit 3e7812b

Please sign in to comment.