初始化环境文件
This commit is contained in:
25
node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
generated
vendored
Normal file
25
node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { isValidHostLabel } from "@smithy/util-endpoints";
|
||||
import { isIpAddress } from "../isIpAddress";
|
||||
export const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
||||
if (allowSubDomains) {
|
||||
for (const label of value.split(".")) {
|
||||
if (!isVirtualHostableS3Bucket(label)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!isValidHostLabel(value)) {
|
||||
return false;
|
||||
}
|
||||
if (value.length < 3 || value.length > 63) {
|
||||
return false;
|
||||
}
|
||||
if (value !== value.toLowerCase()) {
|
||||
return false;
|
||||
}
|
||||
if (isIpAddress(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
Reference in New Issue
Block a user