Browse Source

Merge pull request #699 from threema-ch/preset-env

Increase browser requirements
Danilo Bargen 6 years ago
parent
commit
f0dd94dca5
4 changed files with 12 additions and 6 deletions
  1. 6 0
      dist/babelify-config.js
  2. 3 3
      src/app.ts
  3. 1 1
      src/filters.ts
  4. 2 2
      src/services/string.ts

+ 6 - 0
dist/babelify-config.js

@@ -2,6 +2,12 @@ const babelifyConfig = {
     presets: [
         ['@babel/preset-env', {
             'useBuiltIns': 'entry',
+            'targets': {
+                'firefox': 60,
+                'chrome': 65,
+                'opera': 52,
+                'safari': 11,
+            },
         }],
     ],
     extensions: '.ts',

+ 3 - 3
src/app.ts

@@ -76,9 +76,9 @@ angular.module('3ema', [
 
 // Constants to be used by controllers
 .constant('BROWSER_MIN_VERSIONS', {
-    FF: 50,
-    CHROME: 45,
-    OPERA: 32,
+    FF: 60,
+    CHROME: 65,
+    OPERA: 52,
     SAFARI: 11,
 })
 

+ 1 - 1
src/filters.ts

@@ -158,7 +158,7 @@ angular.module('3ema.filters', [])
             if (text !== null && text.length > 10) {
                 let result = text.match(/@\[([\*\@a-zA-Z0-9][\@a-zA-Z0-9]{7})\]/g);
                 if (result !== null) {
-                    result = ([...new Set(result)]);
+                    result = new Set(result);
                     // Unique
                     for (const possibleMention of result) {
                         const identity = possibleMention.substr(2, 8);

+ 2 - 2
src/services/string.ts

@@ -17,7 +17,7 @@
 
 export class StringService {
     public byteChunk(str: string, byteLength: number, offset: number = null): string[] {
-        const chars = [...str];
+        const chars = Array.from(str);
         const chunks = [''];
         let currentChunkSize = 0;
         let chunkIndex = 0;
@@ -75,7 +75,7 @@ export class StringService {
             realLength: 0,
         };
         if (input !== null && input.length > 0) {
-            const chars = [...input];
+            const chars = Array.from(input);
             let charFound = false;
             const realPos = Math.min(pos, chars.length) - 1;