Skip to content

Commit

Permalink
fix broken cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Nov 11, 2023
1 parent 3e444ae commit 53533c6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 51 deletions.
65 changes: 19 additions & 46 deletions dist/rita.cjs
Original file line number Diff line number Diff line change
@@ -1,43 +1,12 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};

// src/rita.js
var rita_exports = {};
__export(rita_exports, {
default: () => rita_default
});
module.exports = __toCommonJS(rita_exports);
var import_riscript = __toESM(require("riscript"), 1);
var _riscript = require('riscript'); var _riscript2 = _interopRequireDefault(_riscript);

// src/stemmer.js
var SnowballStemmer = class {
Expand Down Expand Up @@ -41939,7 +41908,7 @@ var SeededRandom = class {
var randgen_default = SeededRandom;

// src/markov.js
var import_flatted = require("flatted");
var _flatted = require('flatted');
var RiMarkov = class _RiMarkov {
constructor(n, opts = {}) {
this.n = n;
Expand Down Expand Up @@ -42170,10 +42139,10 @@ var RiMarkov = class _RiMarkov {
toJSON() {
let data = Object.keys(this).reduce((acc, k) => Object.assign(acc, { [k]: this[k] }), {});
data.sentenceEnds = [...data.sentenceEnds];
return (0, import_flatted.stringify)(data);
return _flatted.stringify.call(void 0, data);
}
static fromJSON(json) {
let parsed = (0, import_flatted.parse)(json);
let parsed = _flatted.parse.call(void 0, json);
let rm = Object.assign(new _RiMarkov(), parsed);
rm.sentenceEnds = new Set(...parsed.sentenceEnds);
if (!parsed.input)
Expand Down Expand Up @@ -42507,19 +42476,19 @@ var markov_default = RiMarkov;
// src/rita.js
var RiTa2 = class _RiTa {
static grammar(rules, context) {
return new import_riscript.default.Grammar(...arguments);
return new _riscript2.default.Grammar(...arguments);
}
static addTransform(name, definition) {
return import_riscript.default.addTransform(...arguments);
return _riscript2.default.addTransform(...arguments);
}
static articlize(word) {
return import_riscript.default.articlize(...arguments);
return _riscript2.default.articlize(...arguments);
}
static evaluate(script, context, opts) {
return import_riscript.default.evaluate(...arguments);
return _riscript2.default.evaluate(...arguments);
}
static getTransforms() {
return import_riscript.default.transforms;
return _riscript2.default.transforms;
}
static markov(n, opts) {
return new markov_default(...arguments);
Expand Down Expand Up @@ -42660,7 +42629,7 @@ var RiTa2 = class _RiTa {
};
markov_default.parent = RiTa2;
stemmer_default.parent = RiTa2;
RiTa2.RiGrammar = import_riscript.default.Grammar;
RiTa2.RiGrammar = _riscript2.default.Grammar;
RiTa2.RiMarkov = markov_default;
RiTa2.Stemmer = stemmer_default;
RiTa2.tagger = new tagger_default(RiTa2);
Expand All @@ -42675,7 +42644,7 @@ RiTa2.SILENT = false;
RiTa2.SILENCE_LTS = false;
RiTa2.CDN = "https://www.unpkg.com/rita/";
RiTa2.PHONES = ["aa", "ae", "ah", "ao", "aw", "ay", "b", "ch", "d", "dh", "eh", "er", "ey", "f", "g", "hh", "ih", "iy", "jh", "k", "l", "m", "n", "ng", "ow", "oy", "p", "r", "s", "sh", "t", "th", "uh", "uw", "v", "w", "y", "z", "zh"];
RiTa2.VERSION = "1.0.65";
RiTa2.VERSION = "1.0.66";
RiTa2.HAS_LEXICON = typeof __NOLEX__ === "undefined";
RiTa2.FIRST = 1;
RiTa2.SECOND = 2;
Expand Down Expand Up @@ -42703,7 +42672,11 @@ RiTa2.GERUND = 2;
RiTa2.SPLIT_CONTRACTIONS = false;
var ONLY_PUNCT = /^[\p{P}|\+|-|<|>|\^|\$|\ufffd|`]*$/u;
var IS_LETTER = /^[a-z\u00C0-\u00ff]+$/;
RiTa2.RiScript = import_riscript.default;
import_riscript.default.RiTa = RiTa2;
RiTa2.RiScript = _riscript2.default;
_riscript2.default.RiTa = RiTa2;
var rita_default = RiTa2;
//# sourceMappingURL=rita.cjs.map


exports.default = rita_default;

module.exports = exports.default//# sourceMappingURL=rita.cjs.map
2 changes: 1 addition & 1 deletion dist/rita.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rita.iife.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rita.iife.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rita.js
Original file line number Diff line number Diff line change
Expand Up @@ -42644,7 +42644,7 @@ RiTa2.SILENT = false;
RiTa2.SILENCE_LTS = false;
RiTa2.CDN = "https://www.unpkg.com/rita/";
RiTa2.PHONES = ["aa", "ae", "ah", "ao", "aw", "ay", "b", "ch", "d", "dh", "eh", "er", "ey", "f", "g", "hh", "ih", "iy", "jh", "k", "l", "m", "n", "ng", "ow", "oy", "p", "r", "s", "sh", "t", "th", "uh", "uw", "v", "w", "y", "z", "zh"];
RiTa2.VERSION = "1.0.65";
RiTa2.VERSION = "1.0.66";
RiTa2.HAS_LEXICON = typeof __NOLEX__ === "undefined";
RiTa2.FIRST = 1;
RiTa2.SECOND = 2;
Expand Down
2 changes: 1 addition & 1 deletion dist/rita.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const cjs: Options = {
...opts,
platform: "node",
cjsInterop: true,
splitting: true,
outExtension({ format }) { return { js: `.cjs` } },
}

Expand Down

0 comments on commit 53533c6

Please sign in to comment.