Socket
Socket
Sign inDemoInstall

rt-constants

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rt-constants

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


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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}`;
}

FAQs

Package last updated on 25 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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