租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
578 B

3 months ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.checkBucketNameTest = void 0;
  4. const isArray_1 = require("./isArray");
  5. exports.checkBucketNameTest = (name, createBucket) => {
  6. const bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;
  7. if (!bucketRegex.test(name)) {
  8. throw new Error('The bucket must be conform to the specifications');
  9. }
  10. };
  11. let res = isArray_1.isArray([1, 2, 3]);
  12. console.log(res, 'is array');
  13. res = isArray_1.isArray('');
  14. console.log(res, 'is array');