Comparing version 0.0.1 to 0.0.2-alpha.0
@@ -1,8 +0,28 @@ | ||
'use strict'; | ||
"use strict"; | ||
module.exports = bom; | ||
/** | ||
* @description 打开新页面 | ||
* @param {String} url 地址 | ||
* openTab("https://www.jd.com/"); | ||
*/ | ||
function openTab(url, target = "_blank") { | ||
const a = document.createElement("a"); | ||
a.setAttribute("href", url); | ||
a.setAttribute("target", target); | ||
a.setAttribute("id", "d2admin-link-temp"); | ||
document.body.appendChild(a); | ||
a.click(); | ||
document.body.removeChild(document.getElementById("d2admin-link-temp")); | ||
} | ||
function bom() { | ||
// TODO | ||
console.log('bom helper') | ||
function guid () { | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | ||
var r = Math.random() * 16 | 0, | ||
v = c == 'x' ? r : (r & 0x3 | 0x8); | ||
return v.toString(16); | ||
}); | ||
} | ||
module.exports = { | ||
openTab, | ||
}; |
{ | ||
"name": "bom-helper", | ||
"version": "0.0.1", | ||
"version": "0.0.2-alpha.0", | ||
"description": "javascript toolkit for BOM (Browser Object Model)", | ||
@@ -22,3 +22,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "b1b9a8156918b9a8abc3cfc98aafd70660122070" | ||
"gitHead": "7e60228a604dd7f08744c4be6a350f90e1551f8b" | ||
} |
@@ -8,5 +8,5 @@ # `bom` | ||
``` | ||
const bom = require('bom'); | ||
const bomHelper = require('bom-helper'); | ||
// TODO: DEMONSTRATE API | ||
bomHelper.openTab('http://www.baidu.com'); | ||
``` |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
1358
25
0