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

suba

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suba - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

dist/suba.js

@@ -63,3 +63,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar Validator = {\n // 判断手机有效性\n // 手机号码\n // 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188\n // 联通:130,131,132,152,155,156,185,186\n // 电信:133,1349,153,180,189\n validPhone: function validPhone(phone) {\n phone = phone || '';\n var regexTestPhone = /^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$/;\n // 中国移动\n var regexTestChinaMobile = /^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d)\\d{7}$/;\n // 中国联通\n var regexTestChinaUnicome = /^1(3[0-2]|5[256]|8[56])\\d{8}$/;\n // 中国电信\n var regexTestChinaTelecom = /^1((33|53|8[09])[0-9]|349)\\d{7}$/;\n return regexTestPhone.test(phone) && (regexTestChinaMobile.test(phone) || regexTestChinaUnicome.test(phone) || regexTestChinaTelecom.test(phone));\n },\n\n\n // 验证token是否有效\n validToken: function validToken(timestamp, expires_in) {\n var result = null;\n var scale = 1000;\n if (!timestamp || !expires_in || typeof timestamp !== 'number' || typeof expires_in !== 'number') {\n result = false;\n } else {\n result = new Date().getTime() < timestamp + expires_in * scale;\n }\n return result;\n }\n};\n\nexports.default = Validator;\nmodule.exports = exports['default'];//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvbW9kdWxlcy92YWxpZGF0b3IuanM/MTUyMSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLElBQU0sWUFB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RhbXAgfHwgIWV4cGlyZXNfaW4gfHwgdHlwZW9mIHRpbWVzdGFtcCAhPT0gJ251bWJlcicgfHwgdHlwZW9mIGV4cGlyZXNfaW4gIT09ICdudW1iZXInKSB7XG4gICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmVzdWx0ID0gKG5ldyBEYXRlKCkuZ2V0VGltZSgpIDwgKHRpbWVzdGFtcCArIGV4cGlyZXNfaW4gKiBzY2FsZSkpO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9LFxufTtcblxuZXhwb3J0IGRlZmF1bHQgVmFsaWRhdG9yO1xuXG5cblxuLyoqIFdFQlBBQ0sgRk9PVEVSICoqXG4gKiogLi9zcmMvbW9kdWxlcy92YWxpZGF0b3IuanNcbiAqKi8iXSwic291cmNlUm9vdCI6IiJ9");
eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar Validator = {\n // 判断手机有效性\n // 手机号码\n // 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188\n // 联通:130,131,132,152,155,156,185,186\n // 电信:133,1349,153,180,181,189\n validPhone: function validPhone(phone) {\n phone = phone || '';\n // var regexTestPhone = /^1(3[0-9]|5[0-35-9]|8[0125-9])\\d{8}$/;\n // // 中国移动\n // var regexTestChinaMobile = /^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d)\\d{7}$/;\n // // 中国联通\n // var regexTestChinaUnicome = /^1(3[0-2]|5[256]|8[56])\\d{8}$/;\n // // 中国电信\n // var regexTestChinaTelecom = /^1((33|53|8[019])[0-9]|349)\\d{7}$/;\n // return regexTestPhone.test(phone) &&\n // (regexTestChinaMobile.test(phone) ||\n // regexTestChinaUnicome.test(phone) ||\n // regexTestChinaTelecom.test(phone));\n return (/^1\\d{10}$/.test(phone)\n );\n },\n\n\n // 验证token是否有效\n validToken: function validToken(timestamp, expires_in) {\n var result = null;\n var scale = 1000;\n if (!timestamp || !expires_in || typeof timestamp !== 'number' || typeof expires_in !== 'number') {\n result = false;\n } else {\n result = new Date().getTime() < timestamp + expires_in * scale;\n }\n return result;\n }\n};\n\nexports.default = Validator;\nmodule.exports = exports['default'];//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvbW9kdWxlcy92YWxpZGF0b3IuanM/MTUyMSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLElBQU0sWUFBWTtBQUNoQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsWUFOZ0Isc0JBTUwsS0FOSyxFQU1FO0FBQ2hCLFlBQVEsU0FBUyxFQUFqQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFPLGFBQVksSUFBWixDQUFpQixLQUFqQjtBQUFQO0FBQ0QsR0FwQmU7OztBQXNCaEI7QUFDQSxZQXZCZ0Isc0JBdUJMLFNBdkJLLEVBdUJNLFVBdkJOLEVBdUJrQjtBQUNoQyxRQUFJLFNBQVMsSUFBYjtBQUNBLFFBQU0sUUFBUSxJQUFkO0FBQ0EsUUFBSSxDQUFDLFNBQUQsSUFBYyxDQUFDLFVBQWYsSUFBNkIsT0FBTyxTQUFQLEtBQXFCLFFBQWxELElBQThELE9BQU8sVUFBUCxLQUFzQixRQUF4RixFQUFrRztBQUNoRyxlQUFTLEtBQVQ7QUFDRCxLQUZELE1BRU87QUFDTCxlQUFVLElBQUksSUFBSixHQUFXLE9BQVgsS0FBd0IsWUFBWSxhQUFhLEtBQTNEO0FBQ0Q7QUFDRCxXQUFPLE1BQVA7QUFDRDtBQWhDZSxDQUFsQjs7a0JBbUNlLFMiLCJmaWxlIjoiMS5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IFZhbGlkYXRvciA9IHtcbiAgLy8g5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uZSk7XG4gIH0sXG5cbiAgLy8g6aqM6K+BdG9rZW7mmK/lkKbmnInmlYhcbiAgdmFsaWRUb2tlbih0aW1lc3RhbXAsIGV4cGlyZXNfaW4pIHtcbiAgICBsZXQgcmVzdWx0ID0gbnVsbDtcbiAgICBjb25zdCBzY2FsZSA9IDEwMDA7XG4gICAgaWYgKCF0aW1lc3RhbXAgfHwgIWV4cGlyZXNfaW4gfHwgdHlwZW9mIHRpbWVzdGFtcCAhPT0gJ251bWJlcicgfHwgdHlwZW9mIGV4cGlyZXNfaW4gIT09ICdudW1iZXInKSB7XG4gICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmVzdWx0ID0gKG5ldyBEYXRlKCkuZ2V0VGltZSgpIDwgKHRpbWVzdGFtcCArIGV4cGlyZXNfaW4gKiBzY2FsZSkpO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9LFxufTtcblxuZXhwb3J0IGRlZmF1bHQgVmFsaWRhdG9yO1xuXG5cblxuLyoqIFdFQlBBQ0sgRk9PVEVSICoqXG4gKiogLi9zcmMvbW9kdWxlcy92YWxpZGF0b3IuanNcbiAqKi8iXSwic291cmNlUm9vdCI6IiJ9");

@@ -66,0 +66,0 @@ /***/ }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.suba=t():e.suba=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o(1),u=r(n),d={Validator:u["default"]};t["default"]=d,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={validPhone:function(e){e=e||"";var t=/^1(3[0-9]|5[0-35-9]|8[025-9])\d{8}$/,o=/^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\d)\d{7}$/,r=/^1(3[0-2]|5[256]|8[56])\d{8}$/,n=/^1((33|53|8[09])[0-9]|349)\d{7}$/;return t.test(e)&&(o.test(e)||r.test(e)||n.test(e))},validToken:function(e,t){var o=null,r=1e3;return o=!(!e||!t||"number"!=typeof e||"number"!=typeof t)&&(new Date).getTime()<e+t*r}};t["default"]=o,e.exports=t["default"]}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.suba=t():e.suba=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o(1),u=r(n),f={Validator:u["default"]};t["default"]=f,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={validPhone:function(e){return e=e||"",/^1\d{10}$/.test(e)},validToken:function(e,t){var o=null,r=1e3;return o=!(!e||!t||"number"!=typeof e||"number"!=typeof t)&&(new Date).getTime()<e+t*r}};t["default"]=o,e.exports=t["default"]}])});
//# sourceMappingURL=suba.min.js.map
{
"name": "suba",
"version": "0.1.3",
"version": "0.1.4",
"description": "A bag for Liril Su",

@@ -5,0 +5,0 @@ "main": "dist/suba.js",

@@ -6,13 +6,17 @@ const Validator = {

// 联通:130,131,132,152,155,156,185,186
// 电信:133,1349,153,180,189
// 电信:133,1349,153,180,181,189
validPhone(phone) {
phone = phone || '';
var regexTestPhone = /^1(3[0-9]|5[0-35-9]|8[025-9])\d{8}$/;
// 中国移动
var regexTestChinaMobile = /^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\d)\d{7}$/;
// 中国联通
var regexTestChinaUnicome = /^1(3[0-2]|5[256]|8[56])\d{8}$/;
// 中国电信
var regexTestChinaTelecom = /^1((33|53|8[09])[0-9]|349)\d{7}$/;
return regexTestPhone.test(phone) && (regexTestChinaMobile.test(phone) || regexTestChinaUnicome.test(phone) || regexTestChinaTelecom.test(phone));
// var regexTestPhone = /^1(3[0-9]|5[0-35-9]|8[0125-9])\d{8}$/;
// // 中国移动
// var regexTestChinaMobile = /^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\d)\d{7}$/;
// // 中国联通
// var regexTestChinaUnicome = /^1(3[0-2]|5[256]|8[56])\d{8}$/;
// // 中国电信
// var regexTestChinaTelecom = /^1((33|53|8[019])[0-9]|349)\d{7}$/;
// return regexTestPhone.test(phone) &&
// (regexTestChinaMobile.test(phone) ||
// regexTestChinaUnicome.test(phone) ||
// regexTestChinaTelecom.test(phone));
return /^1\d{10}$/.test(phone);
},

@@ -19,0 +23,0 @@

@@ -13,2 +13,3 @@ /* eslint no-magic-numbers: 0 */ // simple math checks

validPhone('15555555555').should.equal(true);
validPhone('18112973132').should.equal(true);
});

@@ -15,0 +16,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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