{"id":28875845,"url":"https://github.com/393197906/veal","last_synced_at":"2026-05-03T22:31:34.047Z","repository":{"id":57095429,"uuid":"177960093","full_name":"393197906/veal","owner":"393197906","description":"a common tool library","archived":false,"fork":false,"pushed_at":"2020-07-13T22:17:28.000Z","size":79,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-14T09:22:49.649Z","etag":null,"topics":["aook","http","js","utils","vuejs"],"latest_commit_sha":null,"homepage":"https://aevjs.club/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/393197906.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-27T09:23:08.000Z","updated_at":"2020-02-21T18:05:45.000Z","dependencies_parsed_at":"2022-08-22T23:00:27.347Z","dependency_job_id":null,"html_url":"https://github.com/393197906/veal","commit_stats":null,"previous_names":["393197906/aook"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/393197906/veal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/393197906%2Fveal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/393197906%2Fveal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/393197906%2Fveal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/393197906%2Fveal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/393197906","download_url":"https://codeload.github.com/393197906/veal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/393197906%2Fveal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32587816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aook","http","js","utils","vuejs"],"created_at":"2025-06-20T16:12:32.258Z","updated_at":"2026-05-03T22:31:34.030Z","avatar_url":"https://github.com/393197906.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# veal\n[![Build Status](https://travis-ci.org/393197906/veal.svg?branch=master)](https://travis-ci.org/393197906/veal)\n[![npm](https://img.shields.io/badge/TypeScript-%E2%9C%93-007ACC.svg)](https://www.typescriptlang.org/) \n[![Netlify Status](https://api.netlify.com/api/v1/badges/a57a9a3d-5f33-44c7-a280-e2a6aefbd0d5/deploy-status)](https://app.netlify.com/sites/aev/deploys)\n\n\u003e a common tool library\n\n\u003e Provide web service API and common function\n\n\n\n## core\n* regexp\n```javascript\nexport const regexp = {\n    number: /^[0-9]*\\.?[0-9]*$/, // 数字\n    float: /^(-?\\d+)(\\.\\d+)?$/, // 浮点数\n    zh: /^[\\u4e00-\\u9fa5]{0,}$/, // 汉字\n    mobilePhone: /^(13[0-9]|14[0-9]|15[0-9]|166|17[0-9]|18[0-9]|19[8|9])\\d{8}$/, // 手机号\n    telPhone: /^\\d{3}-\\d{7,8}|\\d{4}-\\d{7,8}$/, //  固定电话\n    email:/^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/ // 邮箱\n}\n```\n\n* formatDate\n\u003e (data:(string\\|number),fmt:string?)=\u003e string\n\n\u003e 将时间戳格式化为日期字符串\n\n* dateToStamp\n\u003e (str:string,len:number=10?)=\u003e number\n\n\u003e 将日期字符串转换为时间戳\n\n* deepClone\n\u003e (source:object)=\u003e object\n\n\u003e 深拷贝\n\n\n* sublen\n\u003e (value:string,len:number=8?)=\u003e string\n\n\u003e 字符串截取\n\n* fixedTo\n\u003e (val:(string\\|number),len:number=4?)=\u003e number\n\n\u003e 四舍五入保留n位小数\n\n* delayFn\n\u003e (fn, delay, mustDelay)=\u003e function\n```javascript\n\n/**\n * 函数节流\n * @param fn 需要被节流的函数\n * @param delay 触发执行的时间间隔\n * @param mustDelay 必然触发执行的间隔时间\n * @returns {*}\n */\n```\n\n* isFunction\n\u003e (target:any)=\u003e boolean\n\n\u003e 判断是不是函数\n\n* isPlainObject\n\u003e (target:any)=\u003e boolean\n\n\u003e 判断是不是字面量对象\n\n* mergeOptions\n\u003e (l:plainObject,r:plainObject)=\u003e plainObject\n\n\u003e 深度合并对象\n\n* compose\n\u003e (...rest:Array\u003cfunction\u003e)=\u003e function\n\n\u003e 函数管道\n\n* curry\n\u003e (function)=\u003e function\n\n\u003e 柯里化函数工厂\n\n* urlEncode\n\u003e (target:plainObject)=\u003e string\n\n\u003e 转换对象为uri参数字符串\n\n## http\n\n* createFetch\n\u003e (hof:function?)=\u003e Fetch\n\n\u003e fetch 工厂\n\n* applyMiddleware\n\u003e (...middleware:Array\u003cfunction\u003e?)=\u003e (Fecth|any)\n\n\u003e 中间件加载器\n\n### http middlewares\n* log\n\n\u003e 日志中间件\n\n* methods\n\n\u003e 基础http方法中间件(会改变fetch的默认行为 生成一个 包含{get,post,del,put}方法的对象)\n\n\u003e `NOTE:` 如果使用`methods`中间件，`methods`必须是`applyMiddleware`的第一个参数，因为`methods`会改变`fetch`的默认行为\n\n* filter\n\u003e (errorHandler=()=\u003e{}?,chain=(response)=\u003e{/*...*/}?)=\u003e middleware\n\n\u003e errorHandler:error=\u003evoid 错误处理方法 \n\n\u003e chain:response=\u003ePromise\u003cany\u003e 自定义数据处理 \n\n* headers\n\u003e (headers:plainObject)=\u003emiddleware\n\n\u003e 设置`headers`\n\n### demo\n\n```javascript\n// base\nconst fetch = createFetch();\n\n// advanced\nconst fetch = createFetch(applyMiddleware(methods,filter(),log));\n```\n\n## math\n```javascript\nmath.strip(0.09999999999999998); // = 0.1\nmath.plus(0.1, 0.2);             // = 0.3, not 0.30000000000000004\nmath.plus(2.3, 2.4);             // = 4.7, not 4.699999999999999\nmath.minus(1.0, 0.9);            // = 0.1, not 0.09999999999999998\nmath.times(3, 0.3);              // = 0.9, not 0.8999999999999999\nmath.times(0.362, 100);          // = 36.2, not 36.199999999999996\nmath.divide(1.21, 1.1);          // = 1.1, not 1.0999999999999999\nmath.round(0.105, 2);            // = 0.11, not 0.1\n```\n\n## vue\n* Vue.prototype.$_util \n\u003e [`core`](#core)挂载入口\n\n* Vue.prototype.$_math\n\u003e [`math`](#math)挂载入口\n\n* Vue.filters\n\u003e [`core`](#core)挂载\n\n### components\n* Cache\n ```javascript\n {\n   props: {\n          keys: { // cache keys\n              type: Array,\n              default: () =\u003e []\n          }\n      }\n  }\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F393197906%2Fveal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F393197906%2Fveal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F393197906%2Fveal/lists"}