How to use the oniguruma/build/Release/onig_scanner.node.OnigString.prototype function in oniguruma

To help you get started, we’ve selected a few oniguruma 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 phenomic / phenomic / jest-setup.js View on Github external
if (value === undefined) return "undefined";
    if (value === null) return "null";
    if (value.constructor == OnigString) return value;
    return value.toString();
  };

  OnigScanner.prototype.convertToNumber = function(value) {
    value = parseInt(value);
    if (!isFinite(value)) {
      value = 0;
    }
    value = Math.max(value, 0);
    return value;
  };

  OnigString.prototype.substring = function(start, end) {
    return this.content.substring(start, end);
  };

  OnigString.prototype.toString = function(start, end) {
    return this.content;
  };

  Object.defineProperty(OnigString.prototype, "length", {
    get() {
      return this.content.length;
    },
    // https://github.com/facebook/jest/issues/3552
    configurable: true,
  });

  // exports.OnigScanner = OnigScanner
github phenomic / phenomic / jest-setup.js View on Github external
if (!isFinite(value)) {
      value = 0;
    }
    value = Math.max(value, 0);
    return value;
  };

  OnigString.prototype.substring = function(start, end) {
    return this.content.substring(start, end);
  };

  OnigString.prototype.toString = function(start, end) {
    return this.content;
  };

  Object.defineProperty(OnigString.prototype, "length", {
    get() {
      return this.content.length;
    },
    // https://github.com/facebook/jest/issues/3552
    configurable: true,
  });

  // exports.OnigScanner = OnigScanner
  // exports.OnigRegExp = OnigRegExp
  // exports.OnigString = OnigString
  return { OnigScanner, OnigRegExp, OnigString };
});
/* eslint-enable */
github phenomic / phenomic / jest-setup.js View on Github external
};

  OnigScanner.prototype.convertToNumber = function(value) {
    value = parseInt(value);
    if (!isFinite(value)) {
      value = 0;
    }
    value = Math.max(value, 0);
    return value;
  };

  OnigString.prototype.substring = function(start, end) {
    return this.content.substring(start, end);
  };

  OnigString.prototype.toString = function(start, end) {
    return this.content;
  };

  Object.defineProperty(OnigString.prototype, "length", {
    get() {
      return this.content.length;
    },
    // https://github.com/facebook/jest/issues/3552
    configurable: true,
  });

  // exports.OnigScanner = OnigScanner
  // exports.OnigRegExp = OnigRegExp
  // exports.OnigString = OnigString
  return { OnigScanner, OnigRegExp, OnigString };
});