File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export default class FilesCollectionCore extends EventEmitter {
134
134
* @returns {Object }
135
135
*/
136
136
_getExt ( fileName ) {
137
- if ( ! ! ~ fileName . indexOf ( '.' ) ) {
137
+ if ( fileName . includes ( '.' ) ) {
138
138
const extension = ( fileName . split ( '.' ) . pop ( ) . split ( '?' ) [ 0 ] || '' ) . toLowerCase ( ) ;
139
139
return { ext : extension , extension, extensionWithDot : `.${ extension } ` } ;
140
140
}
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ for (let i = 0; i < _helpers.length; i++) {
123
123
*/
124
124
const fixJSONParse = function ( obj ) {
125
125
for ( let key in obj ) {
126
- if ( helpers . isString ( obj [ key ] ) && ! ! ~ obj [ key ] . indexOf ( '=--JSON-DATE--=' ) ) {
126
+ if ( helpers . isString ( obj [ key ] ) && obj [ key ] . includes ( '=--JSON-DATE--=' ) ) {
127
127
obj [ key ] = obj [ key ] . replace ( '=--JSON-DATE--=' , '' ) ;
128
128
obj [ key ] = new Date ( parseInt ( obj [ key ] ) ) ;
129
129
} else if ( helpers . isObject ( obj [ key ] ) ) {
@@ -134,7 +134,7 @@ const fixJSONParse = function(obj) {
134
134
v = obj [ key ] [ i ] ;
135
135
if ( helpers . isObject ( v ) ) {
136
136
obj [ key ] [ i ] = fixJSONParse ( v ) ;
137
- } else if ( helpers . isString ( v ) && ! ! ~ v . indexOf ( '=--JSON-DATE--=' ) ) {
137
+ } else if ( helpers . isString ( v ) && v . includes ( '=--JSON-DATE--=' ) ) {
138
138
v = v . replace ( '=--JSON-DATE--=' , '' ) ;
139
139
obj [ key ] [ i ] = new Date ( parseInt ( v ) ) ;
140
140
}
Original file line number Diff line number Diff line change @@ -157,11 +157,11 @@ export class UploadInstance extends EventEmitter {
157
157
throw new Meteor . Error ( 400 , '"fileName" must me specified for base64 upload!' ) ;
158
158
}
159
159
160
- if ( ! ! ~ this . config . file . indexOf ( 'data:' ) ) {
160
+ if ( this . config . file . includes ( 'data:' ) ) {
161
161
this . config . file = this . config . file . replace ( 'data:' , '' ) ;
162
162
}
163
163
164
- if ( ! ! ~ this . config . file . indexOf ( ',' ) ) {
164
+ if ( this . config . file . includes ( ',' ) ) {
165
165
const _file = this . config . file . split ( ',' ) ;
166
166
this . fileData = {
167
167
size : Math . floor ( ( ( _file [ 1 ] . replace ( / \= / g, '' ) ) . length / 4 ) * 3 ) ,
You canβt perform that action at this time.
0 commit comments