@percy/client
Advanced tools
Comparing version 1.26.2 to 1.26.3-alpha.4
@@ -0,1 +1,6 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
import fs from 'fs'; | ||
@@ -323,12 +328,15 @@ import PercyEnv from '@percy/env'; | ||
resources: { | ||
data: resources.map(r => ({ | ||
type: 'resources', | ||
id: r.sha ?? (r.content && sha256hash(r.content)), | ||
attributes: { | ||
'resource-url': r.url || null, | ||
'is-root': r.root || null, | ||
'for-widths': r.widths || null, | ||
mimetype: r.mimetype || null | ||
} | ||
})) | ||
data: resources.map(r => { | ||
var _r$sha; | ||
return { | ||
type: 'resources', | ||
id: (_r$sha = r.sha) !== null && _r$sha !== void 0 ? _r$sha : r.content && sha256hash(r.content), | ||
attributes: { | ||
'resource-url': r.url || null, | ||
'is-root': r.root || null, | ||
'for-widths': r.widths || null, | ||
mimetype: r.mimetype || null | ||
} | ||
}; | ||
}) | ||
} | ||
@@ -482,7 +490,6 @@ } | ||
for (let index = 0; index < tiles.length; index++) { | ||
yield this.uploadComparisonTile(comparisonId, { | ||
yield this.uploadComparisonTile(comparisonId, _objectSpread({ | ||
index, | ||
total: tiles.length, | ||
...tiles[index] | ||
}); | ||
total: tiles.length | ||
}, tiles[index])); | ||
} | ||
@@ -489,0 +496,0 @@ }, this, 2); |
@@ -0,1 +1,6 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
import net from 'net'; | ||
@@ -6,2 +11,3 @@ import tls from 'tls'; | ||
import logger from '@percy/logger'; | ||
import { stripQuotesAndSpaces } from '@percy/env/utils'; | ||
const CRLF = '\r\n'; | ||
@@ -66,3 +72,6 @@ const STATUS_REG = /^HTTP\/1.[01] (\d*)/; | ||
let proxyUrl = options.protocol === 'https:' && (process.env.https_proxy || process.env.HTTPS_PROXY) || process.env.http_proxy || process.env.HTTP_PROXY; | ||
let shouldProxy = !!proxyUrl && !hostnameMatches(process.env.no_proxy || process.env.NO_PROXY, href(options)); | ||
let shouldProxy = !!proxyUrl && !hostnameMatches(stripQuotesAndSpaces(process.env.no_proxy || process.env.NO_PROXY), href(options)); | ||
if (proxyUrl && typeof proxyUrl === 'string') { | ||
proxyUrl = stripQuotesAndSpaces(proxyUrl); | ||
} | ||
if (shouldProxy) { | ||
@@ -134,6 +143,5 @@ proxyUrl = new URL(proxyUrl); | ||
// default keep-alive | ||
super({ | ||
keepAlive: true, | ||
...options | ||
}); | ||
super(_objectSpread({ | ||
keepAlive: true | ||
}, options)); | ||
} | ||
@@ -140,0 +148,0 @@ createConnection(options, callback) { |
@@ -0,1 +1,9 @@ | ||
const _excluded = ["body", "headers", "retries", "retryNotFound", "interval", "noProxy", "buffer"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
import os from 'os'; | ||
@@ -112,11 +120,11 @@ import fs from 'fs'; | ||
let { | ||
body, | ||
headers, | ||
retries, | ||
retryNotFound, | ||
interval, | ||
noProxy, | ||
buffer, | ||
...requestOptions | ||
} = options; | ||
body, | ||
headers, | ||
retries, | ||
retryNotFound, | ||
interval, | ||
noProxy, | ||
buffer | ||
} = options, | ||
requestOptions = _objectWithoutProperties(options, _excluded); | ||
let { | ||
@@ -141,6 +149,5 @@ protocol, | ||
if (body !== undefined && typeof body !== 'string') { | ||
headers = { | ||
'Content-Type': 'application/json', | ||
...headers | ||
}; | ||
headers = _objectSpread({ | ||
'Content-Type': 'application/json' | ||
}, headers); | ||
body = JSON.stringify(body); | ||
@@ -183,4 +190,4 @@ } | ||
if (statusCode >= 200 && statusCode < 300) { | ||
var _callback; | ||
resolve((await ((_callback = callback) === null || _callback === void 0 ? void 0 : _callback(body, res))) ?? body); | ||
var _await$callback, _callback; | ||
resolve((_await$callback = await ((_callback = callback) === null || _callback === void 0 ? void 0 : _callback(body, res))) !== null && _await$callback !== void 0 ? _await$callback : body); | ||
} else { | ||
@@ -187,0 +194,0 @@ var _body, _body$errors, _body$errors$find; |
{ | ||
"name": "@percy/client", | ||
"version": "1.26.2", | ||
"version": "1.26.3-alpha.4", | ||
"license": "MIT", | ||
@@ -12,3 +12,3 @@ "repository": { | ||
"access": "public", | ||
"tag": "latest" | ||
"tag": "alpha" | ||
}, | ||
@@ -36,6 +36,6 @@ "engines": { | ||
"dependencies": { | ||
"@percy/env": "1.26.2", | ||
"@percy/logger": "1.26.2" | ||
"@percy/env": "1.26.3-alpha.4", | ||
"@percy/logger": "1.26.3-alpha.4" | ||
}, | ||
"gitHead": "f97b6c463109420a4045dc0396bf9d429c2dc77d" | ||
"gitHead": "d89ab97b8d5169eafd3eb42bdbbef41a2ac624ba" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48908
1009
2
+ Added@percy/env@1.26.3-alpha.4(transitive)
+ Added@percy/logger@1.26.3-alpha.4(transitive)
- Removed@percy/env@1.26.2(transitive)
- Removed@percy/logger@1.26.2(transitive)
Updated@percy/env@1.26.3-alpha.4
Updated@percy/logger@1.26.3-alpha.4