@poppinss/utils 6.0.0-3 → 6.1.0-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/build/index.d.ts CHANGED
@@ -12,5 +12,6 @@ export { naturalSort } from './src/natural_sort.js';
12
12
  export { ObjectBuilder } from './src/object_builder.js';
13
13
  export { safeEqual } from './src/safe_equal.js';
14
14
  export { slash } from './src/slash.js';
15
+ export { RuntimeException } from './src/exceptions/runtime_exception.js';
15
16
  export declare function getDirname(url: string | URL): string;
16
17
  export declare function getFilename(url: string | URL): string;
package/build/index.js CHANGED
@@ -13,6 +13,7 @@ export { naturalSort } from './src/natural_sort.js';
13
13
  export { ObjectBuilder } from './src/object_builder.js';
14
14
  export { safeEqual } from './src/safe_equal.js';
15
15
  export { slash } from './src/slash.js';
16
+ export { RuntimeException } from './src/exceptions/runtime_exception.js';
16
17
  export function getDirname(url) {
17
18
  return pathDirname(getFilename(url));
18
19
  }
@@ -1,8 +1,5 @@
1
- declare type Constructor = new (...args: any[]) => any;
2
- export declare type NormalizeConstructor<T extends Constructor> = {
3
- new (...args: any[]): InstanceType<T>;
4
- } & Omit<T, 'constructor'>;
5
- export interface UnaryFunction<T, R> {
1
+ import type { Constructor } from './types.js';
2
+ interface UnaryFunction<T, R> {
6
3
  (source: T): R;
7
4
  }
8
5
  export declare function compose<T extends Constructor, A>(superclass: T, mixin: UnaryFunction<T, A>): A;
@@ -1,5 +1,5 @@
1
- declare type Constructor = new (...args: any[]) => any;
2
- declare type AbstractConstructor = abstract new (...args: any[]) => any;
1
+ type Constructor = new (...args: any[]) => any;
2
+ type AbstractConstructor = abstract new (...args: any[]) => any;
3
3
  export declare function defineStaticProperty<T extends Constructor | AbstractConstructor, Prop extends keyof T>(self: T, propertyName: Prop, { initialValue, strategy, }: {
4
4
  initialValue: T[Prop];
5
5
  strategy: 'inherit' | 'define' | ((value: T[Prop]) => T[Prop]);
@@ -0,0 +1,5 @@
1
+ import { Exception } from '../exception.js';
2
+ export declare class RuntimeException extends Exception {
3
+ static code: string;
4
+ static status: number;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { Exception } from '../exception.js';
2
+ export class RuntimeException extends Exception {
3
+ static code = 'E_RUNTIME_EXCEPTION';
4
+ static status = 500;
5
+ }
@@ -1,4 +1,4 @@
1
- declare type BufferSafeValue = ArrayBuffer | SharedArrayBuffer | number[] | string | {
1
+ type BufferSafeValue = ArrayBuffer | SharedArrayBuffer | number[] | string | {
2
2
  valueOf(): string | object;
3
3
  } | {
4
4
  [Symbol.toPrimitive](hint: 'string'): string;
@@ -1,18 +1,22 @@
1
- declare type PickKeysByValue<T, V> = {
1
+ type PickKeysByValue<T, V> = {
2
2
  [K in keyof T]: T[K] extends V ? K : never;
3
3
  }[keyof T];
4
- export declare type OmitProperties<T, P> = Omit<T, PickKeysByValue<T, P>>;
5
- declare type ScanFsBaseOptions = {
4
+ export type OmitProperties<T, P> = Omit<T, PickKeysByValue<T, P>>;
5
+ type ScanFsBaseOptions = {
6
6
  ignoreMissingRoot?: boolean;
7
7
  filter?: (filePath: string, index: number) => boolean;
8
8
  sort?: (current: string, next: string) => number;
9
9
  };
10
- export declare type ImportAllFilesOptions = ScanFsBaseOptions & {
10
+ export type ImportAllFilesOptions = ScanFsBaseOptions & {
11
11
  transformKeys?: (keys: string[]) => string[];
12
12
  };
13
- export declare type ReadAllFilesOptions = ScanFsBaseOptions & {
13
+ export type ReadAllFilesOptions = ScanFsBaseOptions & {
14
14
  pathType?: 'relative' | 'unixRelative' | 'absolute' | 'unixAbsolute' | 'url';
15
15
  };
16
- export declare type JSONReplacer = (this: any, key: string, value: any) => any;
17
- export declare type JSONReviver = (this: any, key: string, value: any) => any;
16
+ export type JSONReplacer = (this: any, key: string, value: any) => any;
17
+ export type JSONReviver = (this: any, key: string, value: any) => any;
18
+ export type Constructor = new (...args: any[]) => any;
19
+ export type NormalizeConstructor<T extends Constructor> = {
20
+ new (...args: any[]): InstanceType<T>;
21
+ } & Omit<T, 'constructor'>;
18
22
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poppinss/utils",
3
- "version": "6.0.0-3",
3
+ "version": "6.1.0-0",
4
4
  "description": "Handy utilities for repetitive work",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -53,32 +53,32 @@
53
53
  "author": "virk,poppinss",
54
54
  "license": "MIT",
55
55
  "devDependencies": {
56
- "@commitlint/cli": "^17.1.2",
57
- "@commitlint/config-conventional": "^17.1.0",
56
+ "@commitlint/cli": "^17.3.0",
57
+ "@commitlint/config-conventional": "^17.3.0",
58
58
  "@japa/assert": "^1.3.6",
59
59
  "@japa/expect-type": "^1.0.2",
60
60
  "@japa/run-failed-tests": "^1.1.0",
61
61
  "@japa/runner": "^2.2.2",
62
62
  "@japa/spec-reporter": "^1.3.2",
63
- "@swc/core": "^1.3.11",
63
+ "@swc/core": "^1.3.20",
64
64
  "@types/fs-extra": "^9.0.13",
65
65
  "@types/node": "^18.11.7",
66
66
  "c8": "^7.12.0",
67
67
  "del-cli": "^5.0.0",
68
- "eslint": "^8.26.0",
68
+ "eslint": "^8.28.0",
69
69
  "eslint-config-prettier": "^8.5.0",
70
70
  "eslint-plugin-adonis": "^3.0.3",
71
71
  "eslint-plugin-prettier": "^4.2.1",
72
- "fs-extra": "^10.1.0",
72
+ "fs-extra": "^11.0.0",
73
73
  "github-label-sync": "^2.2.0",
74
74
  "husky": "^8.0.1",
75
75
  "lodash": "^4.17.21",
76
76
  "lodash-cli": "^4.17.5",
77
77
  "move-file-cli": "^3.0.0",
78
78
  "np": "^7.6.2",
79
- "prettier": "^2.7.1",
79
+ "prettier": "^2.8.0",
80
80
  "ts-node": "^10.9.1",
81
- "typescript": "^4.8.3"
81
+ "typescript": "^4.9.3"
82
82
  },
83
83
  "dependencies": {
84
84
  "@lukeed/ms": "^2.0.0",