Socket
Socket
Sign inDemoInstall

builder-util-runtime

Package Overview
Dependencies
3
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.7.1 to 8.7.2

151

out/uuid.js

@@ -44,59 +44,49 @@ "use strict";

let UUID =
/** @class */
(() => {
class UUID {
constructor(uuid) {
this.ascii = null;
this.binary = null;
const check = UUID.check(uuid);
class UUID {
constructor(uuid) {
this.ascii = null;
this.binary = null;
const check = UUID.check(uuid);
if (!check) {
throw new Error("not a UUID");
}
if (!check) {
throw new Error("not a UUID");
}
this.version = check.version;
this.version = check.version;
if (check.format === "ascii") {
this.ascii = uuid;
} else {
this.binary = uuid;
}
if (check.format === "ascii") {
this.ascii = uuid;
} else {
this.binary = uuid;
}
}
static v5(name, namespace) {
return uuidNamed(name, "sha1", 0x50, namespace);
}
static v5(name, namespace) {
return uuidNamed(name, "sha1", 0x50, namespace);
}
toString() {
if (this.ascii == null) {
this.ascii = stringify(this.binary);
}
return this.ascii;
toString() {
if (this.ascii == null) {
this.ascii = stringify(this.binary);
}
inspect() {
return `UUID v${this.version} ${this.toString()}`;
}
return this.ascii;
}
static check(uuid, offset = 0) {
if (typeof uuid === "string") {
uuid = uuid.toLowerCase();
inspect() {
return `UUID v${this.version} ${this.toString()}`;
}
if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) {
return false;
}
static check(uuid, offset = 0) {
if (typeof uuid === "string") {
uuid = uuid.toLowerCase();
if (uuid === "00000000-0000-0000-0000-000000000000") {
return {
version: undefined,
variant: "nil",
format: "ascii"
};
}
if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) {
return false;
}
if (uuid === "00000000-0000-0000-0000-000000000000") {
return {
version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4,
variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5),
version: undefined,
variant: "nil",
format: "ascii"

@@ -106,26 +96,26 @@ };

if (Buffer.isBuffer(uuid)) {
if (uuid.length < offset + 16) {
return false;
}
return {
version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4,
variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5),
format: "ascii"
};
}
let i = 0;
if (Buffer.isBuffer(uuid)) {
if (uuid.length < offset + 16) {
return false;
}
for (; i < 16; i++) {
if (uuid[offset + i] !== 0) {
break;
}
}
let i = 0;
if (i === 16) {
return {
version: undefined,
variant: "nil",
format: "binary"
};
for (; i < 16; i++) {
if (uuid[offset + i] !== 0) {
break;
}
}
if (i === 16) {
return {
version: (uuid[offset + 6] & 0xf0) >> 4,
variant: getVariant((uuid[offset + 8] & 0xe0) >> 5),
version: undefined,
variant: "nil",
format: "binary"

@@ -135,31 +125,34 @@ };

throw (0, _index().newError)("Unknown type of uuid", "ERR_UNKNOWN_UUID_TYPE");
} // read stringified uuid into a Buffer
return {
version: (uuid[offset + 6] & 0xf0) >> 4,
variant: getVariant((uuid[offset + 8] & 0xe0) >> 5),
format: "binary"
};
}
throw (0, _index().newError)("Unknown type of uuid", "ERR_UNKNOWN_UUID_TYPE");
} // read stringified uuid into a Buffer
static parse(input) {
const buffer = Buffer.allocUnsafe(16);
let j = 0;
for (let i = 0; i < 16; i++) {
buffer[i] = hex2byte[input[j++] + input[j++]];
static parse(input) {
const buffer = Buffer.allocUnsafe(16);
let j = 0;
if (i === 3 || i === 5 || i === 7 || i === 9) {
j += 1;
}
for (let i = 0; i < 16; i++) {
buffer[i] = hex2byte[input[j++] + input[j++]];
if (i === 3 || i === 5 || i === 7 || i === 9) {
j += 1;
}
return buffer;
}
} // from rfc4122#appendix-C
return buffer;
}
} // from rfc4122#appendix-C
UUID.OID = UUID.parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8");
return UUID;
})();
exports.UUID = UUID;
UUID.OID = UUID.parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"); // according to rfc4122#section-4.1.1
// according to rfc4122#section-4.1.1
function getVariant(bits) {

@@ -166,0 +159,0 @@ switch (bits) {

{
"name": "builder-util-runtime",
"version": "8.7.1",
"version": "8.7.2",
"main": "out/index.js",

@@ -17,3 +17,3 @@ "author": "Vladimir Krivosheev",

"dependencies": {
"debug": "^4.2.0",
"debug": "^4.1.1",
"sax": "^1.2.4"

@@ -20,0 +20,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc