Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
Korimsoft committed Aug 23, 2024
1 parent ed1512f commit ea31a29
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "korimsoft-tyfun",
"version": "0.2.12",
"description": "Korimsoft's TyFun - A library of TypeScript functions, types, helpers, and utilities",
"main": "/dist/index.js",
"types": "/dist/type-decl/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/type-decl/index.d.ts",
"scripts": {
"compile": "webpack ",
"build": "npm run compile",
Expand All @@ -17,7 +17,7 @@
"url": "git+ssh://[email protected]/Korimsoft/tyfun.git"
},
"files": [
"/dist/**"
"./dist/**"
],
"keywords": [
"Typescript",
Expand Down
6 changes: 3 additions & 3 deletions src/builders/builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _ from 'lodash';
import {cloneDeep} from 'lodash';

export type Builder<T> = {
init: (prototype?: Partial<T>) => InitializedBuilder<T>;
Expand All @@ -12,7 +12,7 @@ type InitializedBuilder<T> = {
type PropertyAssignment<T> = <TValue extends T[keyof T]>(propertyKey: keyof T, value: TValue) => InitializedBuilder<T>;

export function aBuilder<T>(prototype: T = null as T): InitializedBuilder<T> {
const builtObject = _.cloneDeep(prototype) ?? ({} as T);
const builtObject = cloneDeep(prototype) ?? ({} as T);

return {
setProperty: assignAProperty<T>(builtObject),
Expand All @@ -23,6 +23,6 @@ export function aBuilder<T>(prototype: T = null as T): InitializedBuilder<T> {
function assignAProperty<T>(builtObject: T): PropertyAssignment<T> {
return <TValue extends T[keyof T]>(propertyKey: keyof T, value: TValue) => {
builtObject[propertyKey] = value;
return aBuilder(builtObject);
return aBuilder<T>(builtObject);
};
}
2 changes: 1 addition & 1 deletion src/mappers/extractAProperty.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ObjectWithId} from '../custom-types/objectWithId';
import {ObjectWithId} from '../custom-types';
import {Mapper} from './mapper';

export function extractId(item: ObjectWithId) {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"declaration": true,
"declarationDir": "dist/type-decl/",
"declarationDir": "./dist/type-decl/",
"declarationMap": true,
"moduleDetection": "force",
"moduleResolution": "NodeNext",
"noUncheckedIndexedAccess": true
},
"exclude": [ "./test/*", "./node_modules/" ]
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
target: 'web',
devtool: 'inline-source-map',
output: {
path: path.resolve(__dirname + '/dist'),
path: path.resolve(__dirname + '/dist/'),
filename: 'index.js',
library: {
name: 'tyfun-[version]',
Expand Down

0 comments on commit ea31a29

Please sign in to comment.