@radiantabyss/vue 3.3.5 → 3.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radiantabyss/vue",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "author": "radiantabyss.com",
5
5
  "license": "ISC",
6
6
  "eslintConfig": {
package/src/Invoke.js CHANGED
@@ -1,3 +1,5 @@
1
+ import Str from './Support/Str';
2
+
1
3
  let sprite_version = import.meta.env.VITE_SPRITE_VERSION;
2
4
 
3
5
  const invoke = async function(method, edge, payload = {}, display_errors = false) {
@@ -54,7 +56,12 @@ const invoke = async function(method, edge, payload = {}, display_errors = false
54
56
  return data;
55
57
  }
56
58
  catch(e) {
57
- e = e.toString().replace('Error: Error invoking remote method \'invoke\': ', '');
59
+ if ( typeof e == 'object' ) {
60
+ e = e.message;
61
+ }
62
+ else {
63
+ e = e.toString().replace('Error: Error invoking remote method \'invoke\': ', '');
64
+ }
58
65
 
59
66
  if ( display_errors ) {
60
67
  Alert.error(Str.nl2br(e), 7000);
@@ -1,3 +1,5 @@
1
+ import Str from './../Support/Str';
2
+
1
3
  let group_middleware = null;
2
4
 
3
5
  function addRoute(path, action, middleware, name, throw_error) {
@@ -315,7 +315,7 @@ let self = {
315
315
  }).replace(',', ' @');
316
316
  },
317
317
 
318
- prettify_time(date) {
318
+ pretty_time(date) {
319
319
  const options = {};
320
320
  const parsed_date = new Date(new Date(date + 'Z').toLocaleString('en-US', options)); // Add 'Z' for UTC handling
321
321
 
@@ -335,6 +335,38 @@ let self = {
335
335
  let day = date.getDate();
336
336
  return `${date.getFullYear()}-${self.leading_zero(month)}-${self.leading_zero(day)}`;
337
337
  },
338
+
339
+ mask(str) {
340
+ if ( !str.length ) {
341
+ return;
342
+ }
343
+
344
+ let visible_chars_left = 0;
345
+ let visible_chars_right = 0;
346
+
347
+ if ( str.length > 6 ) {
348
+ visible_chars_left = 2;
349
+ }
350
+
351
+ if ( str.length > 10 ) {
352
+ visible_chars_right = 2;
353
+ }
354
+ if ( str.length > 20 ) {
355
+ visible_chars_left = 3;
356
+ visible_chars_left = 3;
357
+ }
358
+
359
+ let bullet_count = str.length - visible_chars_left - visible_chars_right;
360
+ if ( bullet_count < 0 ) {
361
+ bullet_count = str.length;
362
+ }
363
+
364
+ if ( bullet_count > 10 ) {
365
+ bullet_count = 10;
366
+ }
367
+
368
+ return str.substring(0, visible_chars_left) + '⁕'.repeat(bullet_count) + str.substring(str.length - visible_chars_right);
369
+ },
338
370
  }
339
371
 
340
372
  export default self;