{"id":22079903,"url":"https://github.com/techlab23/tweetablejs","last_synced_at":"2025-03-23T20:43:46.690Z","repository":{"id":98765046,"uuid":"116140630","full_name":"techlab23/tweetablejs","owner":"techlab23","description":"Short and reusable JS code","archived":false,"fork":false,"pushed_at":"2018-01-04T14:05:22.000Z","size":2,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T04:19:24.335Z","etag":null,"topics":["es6","javascript","js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/techlab23.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-03T13:36:00.000Z","updated_at":"2024-09-30T06:03:00.000Z","dependencies_parsed_at":"2023-03-19T13:35:53.055Z","dependency_job_id":null,"html_url":"https://github.com/techlab23/tweetablejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlab23%2Ftweetablejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlab23%2Ftweetablejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlab23%2Ftweetablejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techlab23%2Ftweetablejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techlab23","download_url":"https://codeload.github.com/techlab23/tweetablejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245168810,"owners_count":20571799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["es6","javascript","js"],"created_at":"2024-11-30T23:11:38.469Z","updated_at":"2025-03-23T20:43:46.660Z","avatar_url":"https://github.com/techlab23.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tweetable JS\n\n### validateACN\n\nValidate the given Australian Company Number (ACN)\n\n```js\nconst validateACN = acn =\u003e {\n  if (acn.length != 9 || isNaN(parseInt(acn))) return false\n  const w = [8,7,6,5,4,3,2,1].reduce((acc,itm,idx) =\u003e acc + (parseInt(acn.charAt(idx)) * itm),0)\n  const cd = (10 - (w % 10)) == 10 ? 0 : 10 - (w % 10)\n  return cd === parseInt(acn[8])\n}\n```\n```js\nvalidateACN('004085616')\n```\n\n### validateABN\n\nValidate the given Australian Business Number (ABN)\n\n```js\nconst validateABN = abn =\u003e {\n  if (abn.length != 11 || isNaN(parseInt(abn))) return false\n  const w = [10,1,3,5,7,9,11,13,15,17,19].reduce((acc,itm,idx) =\u003e acc + (idx===0 ? (parseInt(abn.charAt(idx))-1)*itm : parseInt(abn.charAt(idx))*itm),0)\n  return (w % 89) === 0\n}\n```\n```js\nvalidateABN('51824753556')\n```\n\n### validateMod10v01\n\nValidate the given number with Mod10V01 (Luhn's alogorithm)\n\n```js\nconst validateMod10v01 = inp =\u003e {\n  if (inp.length\u003e20||isNaN(parseInt(inp))) return false\n  let w = [...inp].reduceRight((acc,itm,idx) =\u003e {\n    let num = parseInt(itm) * ((idx+1) % 2 == 0 ? 2 : 1)\n    return acc + (num \u003c 10 ? num : num - 9)\n  },0)\n  return (w % 10) === 0\n}\n```\n```js\nvalidateMod10v01('79927398713')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechlab23%2Ftweetablejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechlab23%2Ftweetablejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechlab23%2Ftweetablejs/lists"}