Your IP : 216.73.216.86


Current Path : /home/emeraadmin/www/4d695/
Upload File :
Current File : /home/emeraadmin/www/4d695/utils.tar

isValidType.d.ts000064400000000123151701363130007567 0ustar00export declare function isValidType(type: unknown, allowArray?: boolean): boolean;
cloneWithRef.d.ts000064400000000172151701363130007727 0ustar00/// <reference types="react" />
export declare function cloneWithRef(element: any, newRef: any): React.ReactElement<any>;
js_utils.d.ts000064400000000243151701363130007171 0ustar00export declare function isFunction(input: unknown): boolean;
export declare function noop(): void;
export declare function isPlainObject(input: unknown): boolean;
isRef.d.ts000064400000000142151701363130006403 0ustar00export interface Ref<T> {
    current: T;
}
export declare function isRef(obj: unknown): boolean;
isRef.js000064400000000330151701363130006146 0ustar00export function isRef(obj) {
    return (
    // eslint-disable-next-line no-prototype-builtins
    obj !== null &&
        typeof obj === 'object' &&
        Object.prototype.hasOwnProperty.call(obj, 'current'));
}
cloneWithRef.js000064400000001763151701363130007502 0ustar00import { cloneElement } from 'react';
import { invariant } from '@react-dnd/invariant';
function setRef(ref, node) {
    if (typeof ref === 'function') {
        ref(node);
    }
    else {
        ref.current = node;
    }
}
export function cloneWithRef(element, newRef) {
    const previousRef = element.ref;
    invariant(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' +
        'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' +
        'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
    if (!previousRef) {
        // When there is no ref on the element, use the new ref directly
        return cloneElement(element, {
            ref: newRef,
        });
    }
    else {
        return cloneElement(element, {
            ref: (node) => {
                setRef(previousRef, node);
                setRef(newRef, node);
            },
        });
    }
}
js_utils.js000064400000001116151701363130006735 0ustar00// cheap lodash replacements
export function isFunction(input) {
    return typeof input === 'function';
}
export function noop() {
    // noop
}
function isObjectLike(input) {
    return typeof input === 'object' && input !== null;
}
export function isPlainObject(input) {
    if (!isObjectLike(input)) {
        return false;
    }
    if (Object.getPrototypeOf(input) === null) {
        return true;
    }
    let proto = input;
    while (Object.getPrototypeOf(proto) !== null) {
        proto = Object.getPrototypeOf(proto);
    }
    return Object.getPrototypeOf(input) === proto;
}
isValidType.js000064400000000362151701363130007340 0ustar00export function isValidType(type, allowArray) {
    return (typeof type === 'string' ||
        typeof type === 'symbol' ||
        (!!allowArray &&
            Array.isArray(type) &&
            type.every((t) => isValidType(t, false))));
}
symbol-observable.js000064400000000230151701425410010524 0ustar00// Inlined version of the `symbol-observable` polyfill
export default (() =>
  (typeof Symbol === 'function' && Symbol.observable) || '@@observable')()
isPlainObject.js000064400000000610151701425410007625 0ustar00/**
 * @param {any} obj The object to inspect.
 * @returns {boolean} True if the argument appears to be a plain object.
 */
export default function isPlainObject(obj) {
  if (typeof obj !== 'object' || obj === null) return false

  let proto = obj
  while (Object.getPrototypeOf(proto) !== null) {
    proto = Object.getPrototypeOf(proto)
  }

  return Object.getPrototypeOf(obj) === proto
}
warning.js000064400000001133151701425410006545 0ustar00/**
 * Prints a warning in the console if it exists.
 *
 * @param {String} message The warning message.
 * @returns {void}
 */
export default function warning(message) {
  /* eslint-disable no-console */
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
    console.error(message)
  }
  /* eslint-enable no-console */
  try {
    // This error was thrown as a convenience so that if you enable
    // "break on all exceptions" in your console,
    // it would pause the execution at this line.
    throw new Error(message)
  } catch (e) {} // eslint-disable-line no-empty
}
actionTypes.js000064400000001071151701425410007403 0ustar00/**
 * These are private action types reserved by Redux.
 * For any unknown actions, you must return the current state.
 * If the current state is undefined, you must return the initial state.
 * Do not reference these action types directly in your code.
 */

const randomString = () =>
  Math.random().toString(36).substring(7).split('').join('.')

const ActionTypes = {
  INIT: `@@redux/INIT${randomString()}`,
  REPLACE: `@@redux/REPLACE${randomString()}`,
  PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`,
}

export default ActionTypes
kindOf.js000064400000002712151701425410006316 0ustar00// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
function miniKindOf(val) {
  if (val === void 0) return 'undefined'
  if (val === null) return 'null'

  const type = typeof val
  switch (type) {
    case 'boolean':
    case 'string':
    case 'number':
    case 'symbol':
    case 'function': {
      return type
    }
    default:
      break
  }

  if (Array.isArray(val)) return 'array'
  if (isDate(val)) return 'date'
  if (isError(val)) return 'error'

  const constructorName = ctorName(val)
  switch (constructorName) {
    case 'Symbol':
    case 'Promise':
    case 'WeakMap':
    case 'WeakSet':
    case 'Map':
    case 'Set':
      return constructorName
    default:
      break
  }

  // other
  return type.slice(8, -1).toLowerCase().replace(/\s/g, '')
}

function ctorName(val) {
  return typeof val.constructor === 'function' ? val.constructor.name : null
}

function isError(val) {
  return (
    val instanceof Error ||
    (typeof val.message === 'string' &&
      val.constructor &&
      typeof val.constructor.stackTraceLimit === 'number')
  )
}

function isDate(val) {
  if (val instanceof Date) return true
  return (
    typeof val.toDateString === 'function' &&
    typeof val.getDate === 'function' &&
    typeof val.setDate === 'function'
  )
}

export function kindOf(val) {
  let typeOfVal = typeof val

  if (process.env.NODE_ENV !== 'production') {
    typeOfVal = miniKindOf(val)
  }

  return typeOfVal
}
formatProdErrorMessage.js000064400000001046151701425410011537 0ustar00/**
 * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
 *
 * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
 * during build.
 * @param {number} code
 */
function formatProdErrorMessage(code) {
  return (
    `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or ` +
    'use the non-minified dev environment for full errors. '
  )
}

export default formatProdErrorMessage