Sha256: c7ea2fe80b3697d96f4bfaf36906d751071205aa793ea801392fd23b96358ab1

Contents?: true

Size: 508 Bytes

Versions: 22

Compression:

Stored size: 508 Bytes

Contents

import { isNumeric } from "@helpers/lang";

function castAttributeValue(value) {
  if (value === "false") {
    return false;
  }

  if (value === "true") {
    return true;
  }

  if (isNumeric(value)) {
    return parseInt(value, 10);
  }

  return value;
}

function isNode(o) {
  return typeof Node === "object"
    ? o instanceof Node
    : o &&
        typeof o === "object" &&
        typeof o.nodeType === "number" &&
        typeof o.nodeName === "string";
}

export { castAttributeValue, isNode };

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/assets/js/helpers/dom.js
coveragebook_components-0.19.7 app/assets/js/helpers/dom.js
coveragebook_components-0.19.6 app/assets/js/helpers/dom.js
coveragebook_components-0.19.5 app/assets/js/helpers/dom.js
coveragebook_components-0.19.4 app/assets/js/helpers/dom.js
coveragebook_components-0.19.3 app/assets/js/helpers/dom.js
coveragebook_components-0.19.2 app/assets/js/helpers/dom.js
coveragebook_components-0.19.1 app/assets/js/helpers/dom.js
coveragebook_components-0.19.0 app/assets/js/helpers/dom.js
coveragebook_components-0.18.8 app/assets/js/helpers/dom.js
coveragebook_components-0.18.7 app/assets/js/helpers/dom.js
coveragebook_components-0.18.0 app/assets/js/helpers/dom.js
coveragebook_components-0.17.7 app/assets/js/helpers/dom.js
coveragebook_components-0.17.6 app/assets/js/helpers/dom.js
coveragebook_components-0.17.5 app/assets/js/helpers/dom.js
coveragebook_components-0.17.4 app/assets/js/helpers/dom.js
coveragebook_components-0.17.3 app/assets/js/helpers/dom.js
coveragebook_components-0.17.2 app/assets/js/helpers/dom.js
coveragebook_components-0.17.1 app/assets/js/helpers/dom.js
coveragebook_components-0.17.0 app/assets/js/helpers/dom.js