
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
sp-fe-func
Advanced tools
Common Function for Dev.
npm install --save sp-fe-func
// or yarn add sp-fe-func
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/sp-fe-func/index.min.js"></script>
<script>
__FUNC.serviceAPI(options = {
url: '/',
method: 'get',
data: {},
success: function () {},
fail: function () {},
headers: {}
});
__FUNC.serviceAPI({url: 'http://test.com/test.json'})
</script>
//__FUNC: {serviceAPI, Validate, Url, Validate}
const __FUNC = require('sp-fe-func')
Based on axios.
serviceAPI (options = {})
[url]: String[method]: String[data]: Object[success]: Function[fail]: Function __FUNC.serviceAPI({
url: 'http://test.com/test.json',
success: (res) => {
console.log(res)
}
})
isEmail (email)
email: String __FUNC.Validate.isEmail('test@test.com')
//=> true
isEqual (str, compare, isDeep)
str: Stringcompare: String[isDeep]: Boolean __FUNC.Validate.isEqual('123','123')
//=> true
__FUNC.Validate.isEqual('123',123,true)
//=> false
Chinese IdCard Validate (length = 18)
isIdCard (id)
id: String
__FUNC.Validate.isIdCard('51018419700106006X')
//=> return {areaCode:510184,year:1970,month:01,day:06, gender:0}
//Boolean(return) = true
__FUNC.Validate.isIdCard('510184197001060060')
//=> false
isNumber (num, length)
num: String[length]: Number default is num.length
__FUNC.Validate.isNumber('13619120030')
//=> true
__FUNC.Validate.isNumber('12132535x')
//=> false
__FUNC.Validate.isNumber('12132535x', 5)
//=> true
Chinese PhoneNumber Validate (length = 11)
isPhoneNumber (num)
num: String
__FUNC.Validate.isPhoneNumber('13619120030')
//=> true
__FUNC.Validate.isPhoneNumber('12132535')
//=> false
getParams (url, keyName)
url: String[keyName]: String __FUNC.Url.getParams('http://test.com/user?id=23&name=alice')
//=> {id: 23, name: alice}
__FUNC.Url.getParams('http://test.com/user?id=23&name=alice', 'name')
//=> alice
MIT
FAQs
Common Functions for Url, Validate, Ajax etc
The npm package sp-fe-func receives a total of 0 weekly downloads. As such, sp-fe-func popularity was classified as not popular.
We found that sp-fe-func demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.