Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fe-utils

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fe-utils - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

getVersionOfIOS.js

21

fe-utils.js

@@ -154,2 +154,18 @@ (function (global, factory) {

var getVersionOfIOS = function getVersionOfIOS() {
var agent = window.navigator.userAgent.toLowerCase();
if (/ipad|iphone|ipod/.test(agent)) {
// 优雅降级
if (agent.indexOf('like mac os x') > 0) {
// ios
var regStr = /os [\d._]*/gi;
var verinfo = agent.match(regStr);
return verinfo.toString().replace(/[^0-9|_.]/ig, '').replace(/_/ig, '.');
}
}
return null;
};
var chnNumChar = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];

@@ -254,2 +270,6 @@ var chTwNumChar = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '拾'];

document.body.addEventListener('touchmove', function (e) {
var target = e.target || e.currentTarget;
if (target.className.indexOf('prevent-view-scroll') !== -1) {
return;
}
e._isScroller || e.preventDefault();

@@ -265,2 +285,3 @@ });

detectedInfos: detectedInfos,
getVersionOfIOS: getVersionOfIOS,
NumberToChinese: NumberToChinese,

@@ -267,0 +288,0 @@ preventViewScroll: preventViewScroll

2

libs/main.js

@@ -6,2 +6,3 @@ import date from './date'

import detectedInfos from './detectedInfos'
import getVersionOfIOS from './getVersionOfIOS'
import NumberToChinese from './NumberToChinese'

@@ -16,4 +17,5 @@ import preventViewScroll from './preventViewScroll'

detectedInfos,
getVersionOfIOS,
NumberToChinese,
preventViewScroll
}

@@ -31,2 +31,6 @@ const preventViewScroll = (classes) => {

document.body.addEventListener('touchmove', function (e) {
const target = e.target || e.currentTarget
if (target.className.indexOf('prevent-view-scroll') !== -1) {
return
}
e._isScroller || e.preventDefault()

@@ -33,0 +37,0 @@ })

2

package.json
{
"name": "fe-utils",
"version": "1.0.2",
"version": "1.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "fe-utils.js",

@@ -31,2 +31,6 @@ var preventViewScroll = function preventViewScroll(classes) {

document.body.addEventListener('touchmove', function (e) {
var target = e.target || e.currentTarget;
if (target.className.indexOf('prevent-view-scroll') !== -1) {
return;
}
e._isScroller || e.preventDefault();

@@ -33,0 +37,0 @@ });

@@ -27,19 +27,21 @@ # fe-utils v1.0.2

#### allMethods:
1. NumberToChinese
* NumberToChinese(12345) // '一万二千三百四十五'
* NumberToChinese(12345, true) // '壹万贰仟叁佰肆十伍'
2. cookie
* setCookie(name, domain, domain, expiredays)
* getCookie(name)
* delCookie(name, domain)
3. date
* dateFormat() // dateFormat(new Date(), 'MM月dd日 hh:mm:ss')
4. detectedInfos
* isAndroid / isIOS / isWindowPhone / isWX / isWeibo / isMobile / isPC
5. preventViewScroll
6. urlQuery
* queryOne // queryOne('name', ['http://xx.com?name=kevin']) -> 'kevin'
* queryAll // queryOne('http://xx.com?name=kevin&age=18') -> {name: 'kevin', age: 18}
7. toRoman
toRoman(25) // 'XXV'
1. ** NumberToChinese **
* NumberToChinese(12345) // '一万二千三百四十五'
* NumberToChinese(12345, true) // '壹万贰仟叁佰肆十伍'
2. ** cookie **
* setCookie(name, domain, domain, expiredays)
* getCookie(name)
* delCookie(name, domain)
3. ** date **
* dateFormat() // dateFormat(new Date(), 'MM月dd日 hh:mm:ss')
4. ** detectedInfos **
* isAndroid / isIOS / isWindowPhone / isWX / isWeibo / isMobile / isPC
5. ** preventViewScroll **
* <https://github.com/lzwaiwai/preventViewScroll>
6. ** urlQuery **
* queryOne // queryOne('name', ['http://xx.com?name=kevin']) -> 'kevin'
* queryAll // queryOne('http://xx.com?name=kevin&age=18') -> {name: 'kevin', age: 18}
7. ** toRoman **
toRoman(25) // 'XXV'
8. ** getVersionOfIOS **
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc