It's 2024. You should use tsup instead of this.
🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
✨ .d.ts bundle + type-checking
It's 2024. You should use tsup instead of this.
🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
✨ .d.ts bundle + type-checking
| (function () { | |
| 'use strict'; | |
| var element = document.createElement('script'); | |
| element.src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.min.js"; | |
| element.type = "text/javascript"; | |
| document.head.appendChild(element); | |
| })(); |
| function sanitize(object) { | |
| if (_.isString(object)) return _sanitizeString(object); | |
| if (_.isArray(object)) return _sanitizeArray(object); | |
| if (_.isPlainObject(object)) return _sanitizeObject(object); | |
| return object; | |
| } | |
| function _sanitizeString(string) { | |
| return _.isEmpty(string) ? null : string; | |
| } |
| var CryptoJS = require('crypto-js') | |
| var request = require('request-promise') | |
| /* | |
| * npm install crypto-js request-promise request | |
| * node wx_t1t_hack.js | |
| */ | |
| // export function testEncription(msg, fullKey) { | |
| // var fullKey = fullKey.slice(0, 16) |
| const axios = require('axios'); | |
| const http = require('http'); | |
| const https = require('https'); | |
| module.exports = axios.create({ | |
| //60 sec timeout | |
| timeout: 60000, | |
| //keepAlive pools and reuses TCP connections, so it's faster | |
| httpAgent: new http.Agent({ keepAlive: true }), |
| import provinces from 'china-division/dist/provinces.json'; | |
| import cities from 'china-division/dist/cities.json'; | |
| import areas from 'china-division/dist/areas.json'; | |
| areas.forEach((area) => { | |
| const matchCity = cities.filter(city => city.code === area.cityCode)[0]; | |
| if (matchCity) { | |
| matchCity.children = matchCity.children || []; | |
| matchCity.children.push({ | |
| label: area.name, |
| var uniqueArray = function(arrArg) { | |
| return arrArg.filter(function(elem, pos,arr) { | |
| return arr.indexOf(elem) == pos; | |
| }); | |
| }; | |
| var uniqEs6 = (arrArg) => { | |
| return arrArg.filter((elem, pos, arr) => { | |
| return arr.indexOf(elem) == pos; | |
| }); |
| // Credits: Adam's answer in http://stackoverflow.com/a/20786262/69362 | |
| var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope'); | |
| $rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){ | |
| console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams); | |
| }); | |
| $rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){ | |
| console.log('$stateChangeError - fired when an error occurs during transition.'); | |
| console.log(arguments); |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |