Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pedrouid/iso-random

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pedrouid/iso-random - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

dist/cjs/browser/index.d.ts

3

dist/cjs/index.d.ts

@@ -1,3 +0,2 @@

export declare function randomBytes(length: number): Uint8Array;
export default randomBytes;
export * from './node';
//# sourceMappingURL=index.d.ts.map

@@ -9,36 +9,7 @@ "use strict";

}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.randomBytes = void 0;
const env = __importStar(require("@pedrouid/environment"));
const helpers_1 = require("./helpers");
function randomBytes(length) {
if (!helpers_1.isValidKeyLength(length)) {
throw new Error(`randomBytes - invalid key length: ${length}`);
}
let result;
if (env.isBrowser()) {
result = helpers_1.browserRandomBytes(length);
}
else if (env.isNode()) {
result = helpers_1.nodeRandomBytes(length);
}
else {
result = helpers_1.fallbackRandomBytes(length);
}
return result;
}
exports.randomBytes = randomBytes;
exports.default = randomBytes;
__exportStar(require("./node"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@pedrouid/iso-random",
"description": "Isomorphic Library for Random Bytes",
"version": "1.1.1",
"version": "1.2.0",
"author": "Pedro Gomes <github.com/pedrouid>",

@@ -17,3 +17,10 @@ "license": "MIT",

],
"main": "dist/cjs/index.js",
"main": "dist/cjs/node/index.js",
"exports": {
".": {
"node": "./node/index.js",
"browser": "./browser/index.js",
"default": "./fallback/index.js"
}
},
"types": "dist/cjs/index.d.ts",

@@ -20,0 +27,0 @@ "unpkg": "dist/umd/index.min.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc