@stonecrop/stonecrop 0.4.36 → 0.4.37

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.
@@ -20,14 +20,13 @@ export function useStonecrop(registry) {
20
20
  try {
21
21
  store = useDataStore();
22
22
  }
23
- catch (e) {
23
+ catch {
24
24
  throw new Error('Please enable the Stonecrop plugin before using the Stonecrop composable');
25
25
  }
26
26
  stonecrop.value = new Stonecrop(registry, store);
27
27
  const route = registry.router.currentRoute.value;
28
28
  const doctypeSlug = route.params.records?.toString().toLowerCase();
29
- const recordId = route.params.record?.toString().toLowerCase();
30
- // TODO: handle views other than list and form views?
29
+ const recordId = route.params.record?.toString().toLowerCase(); // TODO: handle views other than list and form views?
31
30
  if (!doctypeSlug && !recordId) {
32
31
  return;
33
32
  }
@@ -8,15 +8,9 @@
8
8
  * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}
9
9
  * @public
10
10
  */
11
- export function NotImplementedError(message) {
12
- this.message = message || '';
11
+ export class NotImplementedError extends Error {
12
+ constructor(message = '') {
13
+ super(message);
14
+ this.name = 'NotImplemented';
15
+ }
13
16
  }
14
- NotImplementedError.prototype = Object.create(Error.prototype, {
15
- constructor: { value: NotImplementedError },
16
- name: { value: 'NotImplemented' },
17
- stack: {
18
- get: function () {
19
- return new Error().stack;
20
- },
21
- },
22
- });
@@ -1 +1 @@
1
- {"version":3,"file":"composable.d.ts","sourceRoot":"","sources":["../../src/composable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,GAAG,EAAO,MAAM,KAAK,CAAA;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;CACrC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,eAAe,CA8CjE"}
1
+ {"version":3,"file":"composable.d.ts","sourceRoot":"","sources":["../../src/composable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,GAAG,EAAO,MAAM,KAAK,CAAA;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;CACrC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,eAAe,CA4CjE"}
@@ -8,8 +8,7 @@
8
8
  * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}
9
9
  * @public
10
10
  */
11
- export declare function NotImplementedError(message: string): void;
12
- export declare namespace NotImplementedError {
13
- var prototype: any;
11
+ export declare class NotImplementedError extends Error {
12
+ constructor(message?: string);
14
13
  }
15
14
  //# sourceMappingURL=exceptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../../src/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,QAElD;yBAFe,mBAAmB"}
1
+ {"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../../src/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBACjC,OAAO,GAAE,MAAW;CAIhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stonecrop.d.ts","sourceRoot":"","sources":["../../src/stonecrop.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,WAAW,CAAA;AAEnC,OAAO,QAAQ,MAAM,YAAY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