mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
make sure packager doesn't get confused
This commit is contained in:
parent
58b6dee87a
commit
bf63ab1ec6
7
node_modules/kaefer/lib/util.js
generated
vendored
7
node_modules/kaefer/lib/util.js
generated
vendored
@ -2,14 +2,15 @@ define(function(require, exports, module) {
|
||||
|
||||
exports.inherits = function(Child, Parent) {
|
||||
Child.prototype = Object.create(Parent.prototype, { constructor: { value: Child }});
|
||||
}
|
||||
};
|
||||
|
||||
var isNode = (typeof global !== "undefined" && ({}).toString.call(global) == '[object global]');
|
||||
var isBrowser = (typeof window !== "undefined" && ({}).toString.call(window) == '[object window]');
|
||||
|
||||
if (isNode) {
|
||||
exports.uid = function(length) {
|
||||
return (require("crypto")
|
||||
// make sure packagers don't try to package "crypto"
|
||||
return (require("cry" + "pto")
|
||||
.randomBytes(length)
|
||||
.toString("base64")
|
||||
.slice(0, length)
|
||||
@ -27,7 +28,7 @@ if (isNode) {
|
||||
for (var i = 0; i < length; i++) {
|
||||
arr[i] = Math.floor(Math.random() * 255);
|
||||
}
|
||||
return btoa(String.fromCharCode.apply(null, values)).slice(0, 10);
|
||||
return btoa(String.fromCharCode.apply(null, arr)).slice(0, 10);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user