@alextheman/utility 2.19.0 → 2.20.0

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.
package/dist/index.cjs CHANGED
@@ -64,6 +64,8 @@ __export(index_exports, {
64
64
  isOrdered: () => isOrdered_default,
65
65
  isSameDate: () => isSameDate_default,
66
66
  kebabToCamel: () => kebabToCamel_default,
67
+ normaliseImportPath: () => normaliseImportPath,
68
+ normalizeImportPath: () => normalizeImportPath_default,
67
69
  omitProperties: () => omitProperties_default,
68
70
  paralleliseArrays: () => paralleliseArrays_default,
69
71
  parseEmail: () => Email_default,
@@ -390,6 +392,18 @@ function kebabToCamel(string, options) {
390
392
  }
391
393
  var kebabToCamel_default = kebabToCamel;
392
394
 
395
+ // src/functions/normalizeImportPath.ts
396
+ var import_path = __toESM(require("path"), 1);
397
+ function normalizeImportPath(importPath) {
398
+ const normalizedPath = import_path.default.posix.normalize(importPath);
399
+ if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) {
400
+ return `./${normalizedPath}`;
401
+ }
402
+ return normalizedPath;
403
+ }
404
+ var normaliseImportPath = normalizeImportPath;
405
+ var normalizeImportPath_default = normalizeImportPath;
406
+
393
407
  // src/functions/omitProperties.ts
394
408
  function omitProperties(object, keysToOmit) {
395
409
  const outputObject = __spreadValues({}, object);
@@ -671,6 +685,8 @@ var UUID_default = parseUUID;
671
685
  isOrdered,
672
686
  isSameDate,
673
687
  kebabToCamel,
688
+ normaliseImportPath,
689
+ normalizeImportPath,
674
690
  omitProperties,
675
691
  paralleliseArrays,
676
692
  parseEmail,
package/dist/index.d.cts CHANGED
@@ -86,6 +86,9 @@ interface KebabToCamelOptions {
86
86
  }
87
87
  declare function kebabToCamel(string: string, options?: KebabToCamelOptions): string;
88
88
 
89
+ declare function normalizeImportPath(importPath: string): string;
90
+ declare const normaliseImportPath: typeof normalizeImportPath;
91
+
89
92
  declare function omitProperties<T extends Record<string, unknown> | Readonly<Record<string, unknown>>, K extends keyof T>(object: T, keysToOmit: K | readonly K[]): Omit<T, K>;
90
93
 
91
94
  type ParallelTuple<A, B> = [A, B | undefined];
@@ -130,4 +133,4 @@ type StripIndentsFunction = (strings: TemplateStringsArray, ...interpolations: u
130
133
  declare function stripIndents(options: StripIndentsOptions): StripIndentsFunction;
131
134
  declare function stripIndents(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
132
135
 
133
- export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type RemoveIndentsFunction, type RemoveIndentsOptions, type StringListToArrayOptions, type StripIndentsFunction, type StripIndentsOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, omitProperties, paralleliseArrays, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, stripIndents, truncate, wait };
136
+ export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type RemoveIndentsFunction, type RemoveIndentsOptions, type StringListToArrayOptions, type StripIndentsFunction, type StripIndentsOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normalizeImportPath, omitProperties, paralleliseArrays, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, stripIndents, truncate, wait };
package/dist/index.d.ts CHANGED
@@ -86,6 +86,9 @@ interface KebabToCamelOptions {
86
86
  }
87
87
  declare function kebabToCamel(string: string, options?: KebabToCamelOptions): string;
88
88
 
89
+ declare function normalizeImportPath(importPath: string): string;
90
+ declare const normaliseImportPath: typeof normalizeImportPath;
91
+
89
92
  declare function omitProperties<T extends Record<string, unknown> | Readonly<Record<string, unknown>>, K extends keyof T>(object: T, keysToOmit: K | readonly K[]): Omit<T, K>;
90
93
 
91
94
  type ParallelTuple<A, B> = [A, B | undefined];
@@ -130,4 +133,4 @@ type StripIndentsFunction = (strings: TemplateStringsArray, ...interpolations: u
130
133
  declare function stripIndents(options: StripIndentsOptions): StripIndentsFunction;
131
134
  declare function stripIndents(strings: TemplateStringsArray, ...interpolations: unknown[]): string;
132
135
 
133
- export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type RemoveIndentsFunction, type RemoveIndentsOptions, type StringListToArrayOptions, type StripIndentsFunction, type StripIndentsOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, omitProperties, paralleliseArrays, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, stripIndents, truncate, wait };
136
+ export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type IgnoreCase, type KebabToCamelOptions, type NonUndefined, type OptionalOnCondition, type RecordKey, type RemoveIndentsFunction, type RemoveIndentsOptions, type StringListToArrayOptions, type StripIndentsFunction, type StripIndentsOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolate, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, kebabToCamel, normaliseImportPath, normalizeImportPath, omitProperties, paralleliseArrays, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, removeIndents, stringListToArray, stringToBoolean, stripIndents, truncate, wait };
package/dist/index.js CHANGED
@@ -324,6 +324,18 @@ function kebabToCamel(string, options) {
324
324
  }
325
325
  var kebabToCamel_default = kebabToCamel;
326
326
 
327
+ // src/functions/normalizeImportPath.ts
328
+ import path from "path";
329
+ function normalizeImportPath(importPath) {
330
+ const normalizedPath = path.posix.normalize(importPath);
331
+ if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) {
332
+ return `./${normalizedPath}`;
333
+ }
334
+ return normalizedPath;
335
+ }
336
+ var normaliseImportPath = normalizeImportPath;
337
+ var normalizeImportPath_default = normalizeImportPath;
338
+
327
339
  // src/functions/omitProperties.ts
328
340
  function omitProperties(object, keysToOmit) {
329
341
  const outputObject = __spreadValues({}, object);
@@ -604,6 +616,8 @@ export {
604
616
  isOrdered_default as isOrdered,
605
617
  isSameDate_default as isSameDate,
606
618
  kebabToCamel_default as kebabToCamel,
619
+ normaliseImportPath,
620
+ normalizeImportPath_default as normalizeImportPath,
607
621
  omitProperties_default as omitProperties,
608
622
  paralleliseArrays_default as paralleliseArrays,
609
623
  Email_default as parseEmail,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "description": "Helpful utility functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,7 +40,7 @@
40
40
  "zod": "^4.1.12"
41
41
  },
42
42
  "devDependencies": {
43
- "@alextheman/eslint-plugin": "^3.0.0",
43
+ "@alextheman/eslint-plugin": "^3.2.1",
44
44
  "@types/node": "^24.10.1",
45
45
  "eslint": "^9.39.1",
46
46
  "globals": "^16.5.0",
@@ -50,6 +50,6 @@
50
50
  "tsup": "^8.5.1",
51
51
  "typescript": "^5.9.3",
52
52
  "vite-tsconfig-paths": "^5.1.4",
53
- "vitest": "^4.0.9"
53
+ "vitest": "^4.0.13"
54
54
  }
55
55
  }