How to use the is_js.all function in is_js

To help you get started, we’ve selected a few is_js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vabatta / omx-manager / lib / OmxManager.js View on Github external
OmxManager.prototype.create = function create(videos, args) {
  // Wrap videos to array if it's a string (sort of overload)
  if (is.string(videos)) videos = [videos];
  else if (is.not.array(videos)) throw new TypeError('Error: videos: must be a string array.');
  else if (!is.all.string(videos)) throw new TypeError('Error: videos: must be a string array.');

  // Check for the paths
  videos = this._resolveVideosPath(videos);

  // If passed an empty array throw an error
  if (videos.length === 0) throw new TypeError('Error: videos: array must not be empty.');

  // Check for arguments parameter
  if (is.not.object(args)) throw new TypeError('Error: args: must be an object.');

  // Return the instance
  return new OmxInstance(this, this._omxCommand, videos, args, this._dbusController);
};
github qiscus / qiscus-sdk-web-core / src / utils / param-utils.ts View on Github external
export const isOptArrayNumber = (item: any) => {
  const msg = getMsg(item, 'need to be array of number or null')
  return compose(
    msg,
    some(is.null, is.undefined, is.array, is.all.number)
  )
}
export const isOptArrayString = (item: any) => {
github qiscus / qiscus-sdk-web-core / src / utils / callbag.ts View on Github external
export const isReqArrayString = (msg: string) => compose(msg, every(is.not.null, is.not.undefined, is.array, is.all.string))
export const isOptString = (msg: string) => compose(msg, some(is.null, is.undefined, is.string))
github qiscus / qiscus-sdk-web-core / src / utils / param-utils.ts View on Github external
export function isArrayOfString(ids: number[] | string[]): ids is string[] {
  return is.all.truthy(is.array(ids), is.all.string(ids))
}
github qiscus / qiscus-sdk-web-core / src / utils / callbag.ts View on Github external
export const isReqArrayNumber = (msg: string) => compose(msg, every(is.not.null, is.not.undefined, is.array, is.all.number))
export const isReqArrayString = (msg: string) => compose(msg, every(is.not.null, is.not.undefined, is.array, is.all.string))