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

captain-invalid-goods

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

captain-invalid-goods - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

27

lib/index.js

@@ -1145,3 +1145,5 @@ (function webpackUniversalModuleDefinition(root, factory) {

function getCdnImageUrl(url, parameter) {
function getCdnImageUrl(url) {
var parameter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
if (!url) {

@@ -1151,11 +1153,15 @@ return (0, _readConfig2['default'])('url.cdn_static') + '/image/wap/no_pic.png';

// 如果已经是指定尺寸的 cdn 地址,不改尺寸
if (url.match(/.+!\d+x\d+.+/)) {
parameter = '';
} else {
parameter = !!parameter && parameter.length > 0 ? parameter : '!100x100.jpg';
var CDN_DOMAIN = 'yzcdn.cn/';
var containSize = url.match(/.+!\d+x\d+.+/);
var containProtocal = url.match(/^(https?:)?\/\//i);
var isCDNImage = url.indexOf(CDN_DOMAIN) !== -1;
// 若未指定尺寸,且为 yzcdn 域名,则默认指定 100 * 100 尺寸
if (!containSize && !parameter && (isCDNImage || !containProtocal)) {
parameter = '!100x100.jpg';
}
if (!url.match(/^(https?:)?\/\//i)) {
return (0, _readConfig2['default'])('url.imgqn') + '/' + url + parameter;
if (!containProtocal) {
url = url[0] !== '/' ? '/' + url : url;
return '' + (0, _readConfig2['default'])('url.imgqn') + url + parameter;
}

@@ -1174,3 +1180,6 @@

function site(url, prefix) {
function site() {
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var env = (0, _readConfig2['default'])('env');

@@ -1177,0 +1186,0 @@ var base = (0, _readConfig2['default'])('url');

{
"name": "captain-invalid-goods",
"version": "0.3.0",
"version": "0.3.1",
"description": "不可用商品列表组件",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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