1- 'use strict' ;
1+ import itype from 'itype' ;
2+ import jonny from 'jonny' ;
3+ import Emitify from 'emitify' ;
4+ import exec from 'execon' ;
5+ import * as Images from './images.mjs' ;
26
3- const itype = require ( 'itype' ) ;
4- const jonny = require ( 'jonny' ) ;
5- const Emitify = require ( 'emitify' ) ;
6- const exec = require ( 'execon' ) ;
7- const Images = require ( './images.mjs' ) ;
8-
9- module . exports . getIdBySrc = getIdBySrc ;
107/**
118 * Function gets id by src
129 * @param src
1310 *
1411 * Example: http://domain.com/1.js -> 1_js
1512 */
16- function getIdBySrc ( src ) {
13+ export function getIdBySrc ( src ) {
1714 const isStr = itype . string ( src ) ;
1815
1916 if ( ! isStr )
@@ -37,7 +34,7 @@ function getIdBySrc(src) {
3734 *
3835 * @param params
3936 */
40- module . exports . ajax = ( params ) => {
37+ export const ajax = ( params ) => {
4138 const p = params ;
4239 const isObject = itype . object ( p . data ) ;
4340 const isArray = itype . array ( p . data ) ;
@@ -94,11 +91,11 @@ module.exports.ajax = (params) => {
9491 xhr . send ( data ) ;
9592} ;
9693
97- module . exports . put = ( url , body ) => {
94+ export const put = ( url , body ) => {
9895 const emitter = Emitify ( ) ;
9996 const xhr = new XMLHttpRequest ( ) ;
10097
101- url = encodeURI ( url ) . replace ( / # / g, '%23 ' ) ;
98+ url = encodeURI ( url ) . replace ( / # / g, '# ' ) ;
10299
103100 xhr . open ( 'put' , url , true ) ;
104101
0 commit comments