0.10.4 • Published 5 years ago

rt-constants v0.10.4

Weekly downloads
5
License
MIT
Repository
-
Last release
5 years ago

AcceptedFileExtension.js

export const ACCEPTED_IMAGE_FILE_EXTENSION = List([
  "jpg",
  "jpeg",
  "png",
  "gif"
]);
export const ACCEPTED_IMAGE_FILE_EXTENSION_STRING = transToString(
  ACCEPTED_IMAGE_FILE_EXTENSION
);

export const ACCEPTED_VIDEO_FILE_EXTENSION = List([
  "mp4"
  // "ogg",
  // "ogv",
  // "webm"
]);
export const ACCEPTED_VIDEO_FILE_EXTENSION_STRING = transToString(
  ACCEPTED_VIDEO_FILE_EXTENSION
);

export const ALL_ACCEPTED_FILE_EXTENSION = List([
  "htm",
  "html",
  "css",
  "js",
  "txt",
  "json",

  ...ACCEPTED_IMAGE_FILE_EXTENSION,
  "svg",

  ...ACCEPTED_VIDEO_FILE_EXTENSION
]);

AcceptedFileExtension.js

export const PC_BREAKPOINT_WIDTH = 1025; // pc ( resolution >= 1024 )
export const TABLET_BREAKPOINT_WIDTH = 640; // tablet ( 640 <= resolution < 1024 )
export const MOBILE_BREAKPOINT_WIDTH = 639; // mobile ( resolution < 640 )

genWarningMsg.js

const WARNING_MSG = {
  none: "",
  invalid: "is invalid",
  empty: "不可為空",
  zero: "cannot be zero",
  emptyZero: "cannot be empty or 0",
  positive: "should be a positive number",
  lessThan: "should less than",
  noLessThan: "cannot less than",
  emptyZeroNoLessThan: "cannot be empty or 0 or less than",
  greaterThan: "should greater than",
  noGreaterThan: "cannot greater than",
  emptyZeroNoGreaterThan: "cannot be empty or 0 or greater than"
};

export default function genWarningMsg(title, condition = "none", rules = "") {
  const error_type = WARNING_MSG[condition];

  return `${title} ${error_type} ${rules}`;
}
0.10.4

5 years ago

0.10.3

5 years ago

0.10.2

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago