Skip to content

Commit

Permalink
fix(farrow-schema): fix typo in formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucifier129 committed Apr 26, 2024
1 parent 0f4b249 commit 157865e
Show file tree
Hide file tree
Showing 10 changed files with 3,889 additions and 3,750 deletions.
6 changes: 6 additions & 0 deletions packages/farrow-next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# farrow-next

## 2.3.1

### Patch Changes

- fix: typo in farrow-schema

## 2.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/farrow-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "farrow-next",
"version": "2.3.0",
"version": "2.3.1",
"description": "A framework runs on Next.js",
"main": "dist/index.js",
"homepage": "https://www.farrowjs.com/",
Expand Down
5 changes: 3 additions & 2 deletions packages/farrow-next/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ const createReduxDevtoolsEnhancer = (devtools = true, name?: string, enableLogge
// tslint:disable-next-line: strict-type-predicates
devtools && typeof window === 'object' && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
name,
})
name,
})
: compose

// @ts-ignore createLogger is not exported
const enhancer = enableLogger ? composeEnhancers(applyMiddleware(createLogger())) : composeEnhancers()

return enhancer
Expand Down
6 changes: 6 additions & 0 deletions packages/farrow-schema/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# farrow-schema

## 2.3.2

### Patch Changes

- fix: typo in farrow-schema

## 2.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/farrow-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "farrow-schema",
"version": "2.3.1",
"version": "2.3.2",
"description": "A powerful and extensible schema builder",
"main": "dist/index.js",
"homepage": "https://www.farrowjs.com/",
Expand Down
13 changes: 13 additions & 0 deletions packages/farrow-schema/src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,4 +626,17 @@ Formatter.impl(S.ReadOnlyDeepType, (schema) => {
})
},
}
})

Formatter.impl(PartialType, schema => {
const Constructor = schema.constructor as typeof S.Schema
const ItemConstructor = schema.Item as unknown as typeof S.Schema

ItemConstructor.displayName = Constructor.displayName

return {
format(ctx) {
return Formatter.formatSchema(schema.Item, ctx)
}
}
})
2 changes: 1 addition & 1 deletion packages/farrow-schema/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const omit = ((Ctor: any, keys: any) => {
}

throw new Error(`Unknown Schema Constructor: ${Ctor}`)
}) as PickSchema
}) as OmitSchema

export const keyofStruct = <T extends StructType>(Ctor: new () => T): (keyof T['descriptors'])[] => {
return Object.keys(getInstance(Ctor).descriptors)
Expand Down
Loading

0 comments on commit 157865e

Please sign in to comment.