Skip to content

Commit

Permalink
#80 format
Browse files Browse the repository at this point in the history
  • Loading branch information
bennobuilder committed Nov 28, 2024
1 parent 72282ca commit 1a2f44a
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 27 deletions.
1 change: 0 additions & 1 deletion packages/elevenlabs-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { type FetchError, type TResult } from 'feature-fetch';
import { type TGenerateTextToSpeechConfig, type TVoiceResponse } from './types';

Expand Down
1 change: 0 additions & 1 deletion packages/eprel-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { type FetchError, type TResult } from 'feature-fetch';
import type { components } from './gen/v1';
import {
Expand Down
1 change: 0 additions & 1 deletion packages/feature-fetch/src/create-fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export function createFetchClient<GPaths extends object = object>(
// Process before request middlewares
try {
for (const middleware of this._config.beforeRequestMiddlewares) {

await middleware({
path,
props: middlewareProps,
Expand Down
2 changes: 0 additions & 2 deletions packages/feature-fetch/src/features/with-graphql/gql.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


// https://github.com/apollographql/graphql-tag/blob/main/src/index.ts
export function gql(literals: TemplateStringsArray, ...args: unknown[]): string {
// If a single string is passed, return it as is
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-fetch/src/types/features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type TFeatures<GPaths extends object = object> = {
} & TThirdPartyFeatures<GPaths>;

// Global registry for third party features

export interface TThirdPartyFeatures<GPaths> {}

export type TFeatureKeys<GPaths extends object = object> = keyof TFeatures<GPaths>;
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-form/src/types/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type TFeatures<GFormData extends TFormData = TFormData> = {
} & TThirdPartyFeatures<GFormData>;

// Global registry for third party features

export interface TThirdPartyFeatures<GFormData> {}

export type TFeatureKeys<GFormData extends TFormData = TFormData> = keyof TFeatures<GFormData>;
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-logger/src/types/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type TFeatures = {
} & TThirdPartyFeatures;

// Global registry for third party features

export interface TThirdPartyFeatures {}

export type TFeatureKeys = keyof TFeatures;
Expand Down
1 change: 0 additions & 1 deletion packages/feature-react/src/state/hooks/use-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function useSelector<GValue, GPath extends TNestedPath<GValue>>(
const [, forceRender] = React.useReducer((s: number) => s + 1, 0);

React.useEffect(() => {

const unbind = state.listenToSelected(
[selectedProperty],
({ background }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-state/src/types/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type TFeatures<GValue = unknown> = {
} & TThirdPartyFeatures<GValue>;

// Global registry for third party features

export interface TThirdPartyFeatures<GValue> {}

export type TFeatureKeys<GValue = unknown> = keyof TFeatures<GValue>;
Expand Down
1 change: 0 additions & 1 deletion packages/google-webfonts-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import type { FetchError, TFetchClient, TResult } from 'feature-fetch';
import type { components } from './gen/v1';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ function validationMiddleware<GPathOperation>(
): express.RequestHandler {
const { bodyValidator, pathValidator, queryValidator } = validators;


return async (req, _res, next) => {
try {
const validationErrors: TValidationError[] = [];
Expand Down Expand Up @@ -149,10 +148,8 @@ function validationMiddleware<GPathOperation>(
}

function requestHandler(handler: express.RequestHandler): express.RequestHandler {

return async (req, res, next) => {
try {

await handler(req, res, next);
} catch (error) {
next(error);
Expand Down
1 change: 0 additions & 1 deletion packages/openapi-router/src/types/features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export type TFeatures<GPaths extends object = object> = {
} & TThirdPartyFeatures<GPaths>;

// Global registry for third party features

export interface TThirdPartyFeatures<GPaths> {}

export type TFeatureKeys<GPaths extends object = object> = keyof TFeatures<GPaths>;
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/src/hex-to-rgb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export function hexToRgb(hex: THexColor): TRgbColor | null {
const hexValue = hex.slice(1);
if (hexValue.length === 3) {
// @ts-expect-error -- Covered by above regex check

r = parseInt(hexValue[0] + hexValue[0], 16);
// @ts-expect-error -- Covered by above regex check

g = parseInt(hexValue[1] + hexValue[1], 16);
// @ts-expect-error -- Covered by above regex check

b = parseInt(hexValue[2] + hexValue[2], 16);
} else {
r = parseInt(hexValue.slice(0, 2), 16);
Expand Down
3 changes: 1 addition & 2 deletions packages/utils/src/is-object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ describe('isObject function', () => {
});

it('should return false for functions', () => {

expect(isObject(function () {})).toBeFalsy();

expect(isObject(() => {})).toBeFalsy();
});
});
1 change: 0 additions & 1 deletion packages/utils/src/json-function.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export function toFunction(jsonFunction: TJsonFunction): Function {

return new Function(...jsonFunction.args, jsonFunction.body);
}

Expand Down
5 changes: 1 addition & 4 deletions packages/utils/src/to-hex.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@


// Pre-Init (constants are precomputed for performance reasons)
const LUT_HEX_4b = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
const LUT_HEX_8b = new Array(0x100).fill('');

// Populate the lookup table for hex values
for (let n = 0; n < 0x100; n++) {

LUT_HEX_8b[n] = `${LUT_HEX_4b[(n >>> 4) & 0xf]}${LUT_HEX_4b[n & 0xf]}`;
}

Expand All @@ -26,7 +23,7 @@ export function toHex(buffer: Uint8Array | Buffer): string {
let out = '';
for (let idx = 0, len = buffer.length; idx < len; idx++) {
// @ts-expect-error - buffer can't be undefined because we check length in for loop

out += LUT_HEX_8b[buffer[idx]];
}

Expand Down
2 changes: 1 addition & 1 deletion packages/validation-adapter/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type TValidateCallback<

export interface TBaseValidationContext<GValue> {
config: TValidationContextConfig;

value: Readonly<GValue | unknown>;
hasError: () => boolean;
isValue: (value: unknown) => value is GValue; // NOTE: We have to define a property using explicitly GValue to enforce generic. See: https://stackoverflow.com/questions/78716973/enforcing-same-generic-types-in-typescript/78717389
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ void describe('xml to object', () => {
});

bench('[xml-tokenizer (dist)]', () => {

const result = xtDist.xmlToObject(xml);
expect(result).not.toBeNull();
});
Expand Down

0 comments on commit 1a2f44a

Please sign in to comment.