@oviirup/utils 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Converts a given value to represent itself in an array
3
+ * @param value The value to convert to an array
4
+ * @category Array
5
+ */
6
+ declare function toArray<T>(array: T | T[]): T[];
7
+ type Matcher<T> = (left: T, right: T) => boolean;
8
+ /**
9
+ * Create an array with all unique items
10
+ * @param value The array to make unique
11
+ * @param equals The matcher function to use to determine if two items are the same
12
+ * @category Array
13
+ */
14
+ declare function unique<T>(value: T[]): T[];
15
+ declare function unique<T>(value: T[], equals: Matcher<T>): T[];
16
+ /**
17
+ * Get nth item of Array. Negative for backward
18
+ * @param array The array to get the item from
19
+ * @param index The index of the item to get.
20
+ * @category Array
21
+ */
22
+ declare function at(array: readonly [], index: number): undefined;
23
+ declare function at<T>(array: readonly T[], index: number): T;
24
+ /**
25
+ * Get last item
26
+ * @category Array
27
+ */
28
+ declare function last(array: readonly []): undefined;
29
+ declare function last<T>(array: readonly T[]): T;
30
+ /**
31
+ * Get first item
32
+ * @category Array
33
+ */
34
+ declare function first(array: readonly []): undefined;
35
+ declare function first<T>(array: readonly T[]): T;
36
+ /**
37
+ * Generate a range array of numbers.
38
+ * @category Array
39
+ */
40
+ declare function range(stop: number): number[];
41
+ declare function range(start: number, stop: number, step?: number): number[];
42
+ type Predicate<T> = (item: T, index: number, array: T[]) => boolean;
43
+ /**
44
+ * Filter an array in place (faster than Array.filter)
45
+ * @param array The array to filter
46
+ * @param predicate The predicate function to use to filter the array
47
+ * @category Array
48
+ */
49
+ declare function toFiltered<T>(array: T[], predicate: Predicate<T>): T[];
50
+ /**
51
+ * Move an item in an array to a new position
52
+ * @param array The array to move the item in
53
+ * @param from The index of the item to move
54
+ * @param to The index to move the item to
55
+ * @category Array
56
+ */
57
+ declare function move<T>(array: T[], from: number, to: number): T[];
58
+
59
+ export { at, first, last, move, range, toArray, toFiltered, unique };
package/dist/array.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./assertions.js");function r(e,r){let t=e.length;if(t)return r<0&&(r+=t),e[r]}exports.at=r,exports.first=function(e){return r(e,0)},exports.last=function(e){return r(e,-1)},exports.move=function(r,t,n){if(e.isEmptyArray(r)||t===n)return r;let o=r[t];return r.splice(t,1),r.splice(n,0,o),r},exports.range=function(...e){let r,t=0,n=1;1===e.length?[r]=e:[t,r,n=1]=e;let o=[],u=t;for(;u<r;)o.push(u),u+=n;return o},exports.toArray=function(e){return Array.isArray(e=e??[])?e:[e]},exports.toFiltered=function(e,r){for(let t=e.length-1;t>=0;t--)r(e[t],t,e)||e.splice(t,1);return e},exports.unique=function(e,r){return"function"!=typeof r?Array.from(new Set(e)):e.reduce((e,t)=>(-1===e.findIndex(e=>r(e,t))&&e.push(t),e),[])};
package/dist/array.mjs ADDED
@@ -0,0 +1 @@
1
+ import{isEmptyArray as r}from"./assertions.mjs";function t(r){return Array.isArray(r=r??[])?r:[r]}function n(r,t){return"function"!=typeof t?Array.from(new Set(r)):r.reduce((r,n)=>(-1===r.findIndex(r=>t(r,n))&&r.push(n),r),[])}function e(r,t){let n=r.length;if(n)return t<0&&(t+=n),r[t]}function u(r){return e(r,-1)}function i(r){return e(r,0)}function o(...r){let t,n=0,e=1;1===r.length?[t]=r:[n,t,e=1]=r;let u=[],i=n;for(;i<t;)u.push(i),i+=e;return u}function f(r,t){for(let n=r.length-1;n>=0;n--)t(r[n],n,r)||r.splice(n,1);return r}function c(t,n,e){if(r(t)||n===e)return t;let u=t[n];return t.splice(n,1),t.splice(e,0,u),t}export{e as at,i as first,u as last,c as move,o as range,t as toArray,f as toFiltered,n as unique};
@@ -0,0 +1,31 @@
1
+ import { Dictionary, AnyFunction, Predicate, NegatePredicate } from './types.js';
2
+
3
+ /** Check if given value is a string */
4
+ declare function isString(val: unknown): val is string;
5
+ /** Check if the given value is a number */
6
+ declare function isNumber(val: unknown): val is number;
7
+ /** Check if the given value is an integer */
8
+ declare function isInteger(val: unknown): val is number;
9
+ /** Check if the given value is a float */
10
+ declare function isFloat(val: unknown): val is number;
11
+ /** Check if given value is an array */
12
+ declare function isArray<T = any>(val: unknown): val is T[];
13
+ /** Check if given array is empty */
14
+ declare function isEmptyArray<T = unknown>(val: T[]): boolean;
15
+ /** Check if given value is an object */
16
+ declare function isObject<T extends object = Dictionary>(val: any): val is T;
17
+ /** Check if given object is empty */
18
+ declare function isEmptyObject<T extends object = Dictionary>(val: T): boolean;
19
+ /** Check if the given value is empty, null, undefined, or a string with no content */
20
+ declare function isEmpty(val: unknown): boolean;
21
+ /** Check if the given object is a function */
22
+ declare function isFunction<T = unknown>(val: unknown): val is AnyFunction<T>;
23
+ /** Check if the given value is a regex */
24
+ declare function isRegex(val: unknown): val is RegExp;
25
+ /** Check if the given value is truthy */
26
+ declare function isTruthy(val: unknown): boolean;
27
+ declare function isBrowser(): boolean;
28
+ /** Negate an assertion function, returning a new function with the opposite boolean result */
29
+ declare function not<T extends Predicate>(fn: T): NegatePredicate<T>;
30
+
31
+ export { isArray, isBrowser, isEmpty, isEmptyArray, isEmptyObject, isFloat, isFunction, isInteger, isNumber, isObject, isRegex, isString, isTruthy, not };
@@ -0,0 +1 @@
1
+ function t(t){return"number"==typeof t&&!Number.isNaN(t)}function r(t){return Array.isArray(t)}function e(t){return r(t)&&0===t.length}function n(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function o(t){return 0===Object.keys(t).length}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isArray=r,exports.isBrowser=function(){return"u">typeof window},exports.isEmpty=function(t){return null==t||"string"==typeof t&&""===t.trim()||(r(t)?e(t):!!n(t)&&o(t))},exports.isEmptyArray=e,exports.isEmptyObject=o,exports.isFloat=function(r){return t(r)&&!Number.isInteger(r)},exports.isFunction=function(t){return"function"==typeof t},exports.isInteger=function(r){return t(r)&&Number.isInteger(r)},exports.isNumber=t,exports.isObject=n,exports.isRegex=function(t){return t instanceof RegExp},exports.isString=function(t){return"string"==typeof t},exports.isTruthy=function(t){return!!t},exports.not=function(t){return r=>!t(r)};
@@ -0,0 +1 @@
1
+ function n(n){return"string"==typeof n}function t(n){return"number"==typeof n&&!Number.isNaN(n)}function r(n){return t(n)&&Number.isInteger(n)}function e(n){return t(n)&&!Number.isInteger(n)}function i(n){return Array.isArray(n)}function u(n){return i(n)&&0===n.length}function o(n){return null!==n&&"object"==typeof n&&!Array.isArray(n)}function s(n){return 0===Object.keys(n).length}function f(n){return null==n||"string"==typeof n&&""===n.trim()||(i(n)?u(n):!!o(n)&&s(n))}function c(n){return"function"==typeof n}function y(n){return n instanceof RegExp}function p(n){return!!n}function g(){return"u">typeof window}function a(n){return t=>!n(t)}export{i as isArray,g as isBrowser,f as isEmpty,u as isEmptyArray,s as isEmptyObject,e as isFloat,c as isFunction,r as isInteger,t as isNumber,o as isObject,y as isRegex,n as isString,p as isTruthy,a as not};
package/dist/clsx.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { ClassNameValue } from './types.js';
2
+ export { ClassNameValue } from './types.js';
3
+
4
+ /**
5
+ * Utility function to construct class names conditionally
6
+ * @category ClassNames
7
+ */
8
+ declare function clsx(...inputs: ClassNameValue[]): string;
9
+
10
+ export { clsx };
package/dist/clsx.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./assertions.js");exports.clsx=function(...r){let t,i="";for(let s of r)s&&(t=function r(t){let i,s="";if(e.isString(t)||e.isNumber(t))t&&(s+=t.toString().trim());else if(e.isArray(t))for(let e of t)(i=r(e))&&(s&&(s+=" "),s+=i);else if(e.isObject(t))for(let e in t)t[e]&&(s&&(s+=" "),s+=e);return s}(s))&&(i&&(i+=" "),i+=t);return i};
package/dist/clsx.mjs ADDED
@@ -0,0 +1 @@
1
+ import{isString as t,isNumber as e,isArray as r,isObject as o}from"./assertions.mjs";function f(...i){let n,l="";for(let f of i)f&&(n=function f(i){let n,l="";if(t(i)||e(i))i&&(l+=i.toString().trim());else if(r(i))for(let t of i)(n=f(t))&&(l&&(l+=" "),l+=n);else if(o(i))for(let t in i)i[t]&&(l&&(l+=" "),l+=t);return l}(f))&&(l&&(l+=" "),l+=n);return l}export{f as clsx};
@@ -0,0 +1,13 @@
1
+ import * as array_d_ts from './array.js';
2
+ export { array_d_ts as array };
3
+ export * from './assertions.js';
4
+ export * from './clsx.js';
5
+ export * from './nanoid.js';
6
+ import * as number_d_ts from './number.js';
7
+ export { number_d_ts as number };
8
+ import * as object_d_ts from './object.js';
9
+ export { object_d_ts as object };
10
+ import * as promise_d_ts from './promise.js';
11
+ export { promise_d_ts as promise };
12
+ import * as string_d_ts from './string.js';
13
+ export { string_d_ts as string };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./array.js"),r=require("./assertions.js"),t=require("./clsx.js"),o=require("./nanoid.js"),n=require("./number.js"),s=require("./object.js"),u=require("./promise.js"),c=require("./string.js");function a(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var i=a(e),p=a(n),f=a(s),j=a(u),b=a(c);exports.array=i,exports.number=p,exports.object=f,exports.promise=j,exports.string=b,Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(o).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})});
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import*as r from"./array.mjs";export*from"./assertions.mjs";export*from"./clsx.mjs";export*from"./nanoid.mjs";import*as s from"./number.mjs";import*as m from"./object.mjs";import*as o from"./promise.mjs";import*as a from"./string.mjs";export{r as array,s as number,m as object,o as promise,a as string};
@@ -0,0 +1,11 @@
1
+ declare const charset = "abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789";
2
+ /**
3
+ * Generate a secure nanoid string using Node.js crypto module.
4
+ * @param length - Length of the ID (default: 21)
5
+ * @param alphabets - Alphabet to use for the ID
6
+ * @returns A cryptographically secure unique ID string
7
+ * @source https://github.com/ai/nanoid
8
+ */
9
+ declare function nanoid(length?: number, alphabets?: string): string;
10
+
11
+ export { charset, nanoid };
package/dist/nanoid.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node:crypto");let t="abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789";exports.charset=t,exports.nanoid=function(r=21,o=t){let l=o.length;if(0===l||l>255)throw Error("Alphabet must contain less than 255 characters");let n=(2<<Math.floor(Math.log2(l-1)))-1,a=Math.ceil(1.6*n*r/l),h="";for(;h.length<r;){let t=e.randomBytes(a);for(let e=0;e<a&&h.length<r;e++){let r=t[e]&n;r<l&&(h+=o[r])}}return h};
@@ -0,0 +1 @@
1
+ import{randomBytes as t}from"node:crypto";let e="abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789";function r(o=21,l=e){let n=l.length;if(0===n||n>255)throw Error("Alphabet must contain less than 255 characters");let h=(2<<Math.floor(Math.log2(n-1)))-1,a=Math.ceil(1.6*h*o/n),c="";for(;c.length<o;){let e=t(a);for(let t=0;t<a&&c.length<o;t++){let r=e[t]&h;r<n&&(c+=l[r])}}return c}export{e as charset,r as nanoid};
@@ -0,0 +1,29 @@
1
+ import { AbbreviateOptions } from './types.js';
2
+ export { AbbreviateOptions, AbbreviationSymbols } from './types.js';
3
+
4
+ /**
5
+ * Checks if a number is within a range
6
+ * @param val The number to check
7
+ * @param min Minimum value
8
+ * @param max Maximum value
9
+ * @category Number
10
+ */
11
+ declare function inRange(val: number, min: number, max: number): boolean;
12
+ /**
13
+ * Clamps a number between a minimum and maximum value
14
+ * @param val The number to clamp
15
+ * @param min Minimum value
16
+ * @param max Maximum value
17
+ * @category Number
18
+ */
19
+ declare function clamp(val: number, min: number, max: number): number;
20
+ /**
21
+ * Abbreviates a number to a string with a symbol and a precision
22
+ * @param value - The number to abbreviate
23
+ * @param arg - The precision or options to use for the abbreviation
24
+ * @category Number
25
+ */
26
+ declare function abbreviate(value: number, precision?: number): string;
27
+ declare function abbreviate(value: number, options?: AbbreviateOptions): string;
28
+
29
+ export { abbreviate, clamp, inRange };
package/dist/number.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./assertions.js");let t=["","K","M","B","T"];exports.abbreviate=function(r,o){if(!e.isNumber(r))return"0";let n=1,i=t;"number"==typeof o?n=o:"object"==typeof o&&(n=o.precision??1,i=o.symbols??t);let s=e.isObject(i)?Object.entries(i):i.map((e,t)=>[e,10**(3*t)]);s.sort((e,t)=>t[1]-e[1]);let a=r<0?"-":"",u=Math.abs(r);for(let[e,t]of s){let r=(u/t).toFixed(n);if(!(1>Number(r)))return`${a}${r}${e}`}return Math.floor(u)===u?r.toString():`${a}${u.toFixed(n)}`},exports.clamp=function(e,t,r){return Math.min(Math.max(e,t),r)},exports.inRange=function(e,t,r){return e>=t&&e<=r};
@@ -0,0 +1 @@
1
+ import{isNumber as t,isObject as e}from"./assertions.mjs";function r(t,e,r){return t>=e&&t<=r}function o(t,e,r){return Math.min(Math.max(t,e),r)}let n=["","K","M","B","T"];function i(r,o){if(!t(r))return"0";let i=1,a=n;"number"==typeof o?i=o:"object"==typeof o&&(i=o.precision??1,a=o.symbols??n);let f=e(a)?Object.entries(a):a.map((t,e)=>[t,10**(3*e)]);f.sort((t,e)=>e[1]-t[1]);let m=r<0?"-":"",s=Math.abs(r);for(let[t,e]of f){let r=(s/e).toFixed(i);if(!(1>Number(r)))return`${m}${r}${t}`}return Math.floor(s)===s?r.toString():`${m}${s.toFixed(i)}`}export{i as abbreviate,o as clamp,r as inRange};
@@ -0,0 +1,19 @@
1
+ import { Dictionary } from './types.js';
2
+
3
+ /**
4
+ * Checks if a given object has a specified key
5
+ * @category Object
6
+ */
7
+ declare function keyInObject<T extends object = Dictionary>(val: T, key: keyof T | (string & {})): boolean;
8
+ /**
9
+ * Picks a set of keys from an object
10
+ * @category Object
11
+ */
12
+ declare function pick<T extends object, K extends keyof T = keyof T>(input: T, keys: K | K[]): Pick<T, K>;
13
+ /**
14
+ * Omits a set of keys from an object
15
+ * @category Object
16
+ */
17
+ declare function omit<T extends object, K extends keyof T = keyof T>(input: T, keys: K | K[]): Omit<T, K>;
18
+
19
+ export { keyInObject, omit, pick };
package/dist/object.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./array.js"),r=require("./assertions.js");exports.keyInObject=function(e,t){return r.isObject(e)&&t in e},exports.omit=function(r,t){let o={...r};for(let n of e.toArray(t))n in r&&delete o[n];return o},exports.pick=function(r,t){let o={};for(let n of e.toArray(t))n in r&&(o[n]=r[n]);return o};
@@ -0,0 +1 @@
1
+ import{toArray as t}from"./array.mjs";import{isObject as r}from"./assertions.mjs";function e(t,e){return r(t)&&e in t}function n(r,e){let n={};for(let o of t(e))o in r&&(n[o]=r[o]);return n}function o(r,e){let n={...r};for(let o of t(e))o in r&&delete n[o];return n}export{e as keyInObject,o as omit,n as pick};
@@ -0,0 +1,11 @@
1
+ declare function sleep(delay: number): Promise<void>;
2
+ /**
3
+ * Retries a function until it succeeds or the maximum number of retries is reached
4
+ * @param func The function to retry
5
+ * @param retries The number of retries
6
+ * @param delay The delay between retries (optional)
7
+ * @returns The result of the function
8
+ */
9
+ declare function retry<T>(func: () => Promise<T>, retries: number, delay?: number): Promise<T>;
10
+
11
+ export { retry, sleep };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./assertions.js");function r(r){if(e.isNumber(r)){if(!Number.isFinite(r)||r<0)throw RangeError("sleep: delay must be a positive finite number")}else throw TypeError("sleep: delay must be a number");return 0===r?Promise.resolve():new Promise(e=>setTimeout(e,r))}async function t(e,s,i=0){try{return await e()}catch(o){if(s>0)return await r(i),t(e,s-1,i);throw o}}exports.retry=t,exports.sleep=r;
@@ -0,0 +1 @@
1
+ import{isNumber as e}from"./assertions.mjs";function r(r){if(e(r)){if(!Number.isFinite(r)||r<0)throw RangeError("sleep: delay must be a positive finite number")}else throw TypeError("sleep: delay must be a number");return 0===r?Promise.resolve():new Promise(e=>setTimeout(e,r))}async function t(e,i,o=0){try{return await e()}catch(s){if(i>0)return await r(o),t(e,i-1,o);throw s}}export{t as retry,r as sleep};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Replace backslash to slash
3
+ * @category String
4
+ */
5
+ declare function slash(str: string): string;
6
+ /**
7
+ * Truncates a string to the specified length, adding "..." if it was longer.
8
+ * @param text The string to truncate
9
+ * @param length Maximum allowed length before truncation
10
+ * @category String
11
+ */
12
+ declare function truncate(input: string, length?: number): string;
13
+ /**
14
+ * Capitalizes the first letter of a string
15
+ * @param input The string to capitalize
16
+ * @category String
17
+ */
18
+ declare function capitalize(input: string): string;
19
+
20
+ export { capitalize, slash, truncate };
package/dist/string.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},exports.slash=function(e){return e.replace(/\\/g,"/")},exports.truncate=function(e,t=80){if(!e)return e;let r=e.trim(),n=Math.max(3,t);return r.length<=n?r:`${r.slice(0,n-3)}...`};
@@ -0,0 +1 @@
1
+ function t(t){return t.replace(/\\/g,"/")}function e(t,r=80){if(!t)return t;let n=t.trim(),a=Math.max(3,r);return n.length<=a?n:`${n.slice(0,a-3)}...`}function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}export{r as capitalize,t as slash,e as truncate};
@@ -0,0 +1,15 @@
1
+ type Dictionary<T = any> = Record<string, T>;
2
+ type AnyFunction<T = any> = (...args: unknown[]) => T;
3
+ type ClassValue = string | number | bigint | null | boolean | undefined;
4
+ type ClassArray = ClassValue[];
5
+ type ClassRecord = Record<string, any>;
6
+ type ClassNameValue = ClassValue | ClassArray | ClassRecord;
7
+ type AbbreviationSymbols = Dictionary<number> | string[];
8
+ type AbbreviateOptions = {
9
+ symbols?: AbbreviationSymbols;
10
+ precision?: number;
11
+ };
12
+ type Predicate = ((val: unknown) => boolean) | ((val: unknown) => val is unknown);
13
+ type NegatePredicate<T> = T extends (val: unknown) => val is infer U ? <V>(val: V) => val is Exclude<V, U> : T extends (val: unknown) => boolean ? (val: unknown) => boolean : never;
14
+
15
+ export type { AbbreviateOptions, AbbreviationSymbols, AnyFunction, ClassNameValue, Dictionary, NegatePredicate, Predicate };
package/license CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Avirup Ghosh
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Avirup Ghosh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@oviirup/utils",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Collection of common JavaScript / TypeScript utilities bt @oviirup",
5
- "repository": "https://github.com/oviirup/oviirup/tree/main/packages/utils",
6
5
  "license": "MIT",
6
+ "repository": "https://github.com/oviirup/utils",
7
7
  "author": "Avirup Ghosh (github.com/oviirup)",
8
8
  "exports": {
9
9
  ".": {
@@ -56,9 +56,18 @@
56
56
  }
57
57
  },
58
58
  "scripts": {
59
+ "prepare": "lefthook install",
59
60
  "build": "bunchee --minify --no-sourcemap",
61
+ "format": "biome format --write",
60
62
  "lint": "biome check",
61
63
  "test": "bun test",
62
64
  "typecheck": "tsc --noEmit"
65
+ },
66
+ "devDependencies": {
67
+ "@biomejs/biome": "^2",
68
+ "@types/bun": "^1",
69
+ "bunchee": "^6",
70
+ "lefthook": "^2",
71
+ "typescript": "^5"
63
72
  }
64
73
  }
package/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- # @oviirup/utils
2
-
3
- ## 1.0.2
4
-
5
- ### Patch Changes
6
-
7
- - [`32765f4`](https://github.com/oviirup/oviirup/commit/32765f4892c3d3283d7f9cbd3c4b78ec0a540637) Thanks [@oviirup](https://github.com/oviirup)! - 🔧 publish with update repo