@vitessce/sets-utils 3.1.1 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +357 -0
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2069,6 +2069,363 @@ function convexHull(points) {
2069
2069
  }
2070
2070
  var concavemanExports = concaveman$2.exports;
2071
2071
  const concaveman$1 = /* @__PURE__ */ getDefaultExportFromCjs(concavemanExports);
2072
+ function commonjsRequire(path) {
2073
+ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
2074
+ }
2075
+ var pluralize = { exports: {} };
2076
+ (function(module2, exports2) {
2077
+ (function(root2, pluralize2) {
2078
+ if (typeof commonjsRequire === "function" && true && true) {
2079
+ module2.exports = pluralize2();
2080
+ } else {
2081
+ root2.pluralize = pluralize2();
2082
+ }
2083
+ })(commonjsGlobal, function() {
2084
+ var pluralRules = [];
2085
+ var singularRules = [];
2086
+ var uncountables = {};
2087
+ var irregularPlurals = {};
2088
+ var irregularSingles = {};
2089
+ function sanitizeRule(rule) {
2090
+ if (typeof rule === "string") {
2091
+ return new RegExp("^" + rule + "$", "i");
2092
+ }
2093
+ return rule;
2094
+ }
2095
+ function restoreCase(word, token) {
2096
+ if (word === token)
2097
+ return token;
2098
+ if (word === word.toLowerCase())
2099
+ return token.toLowerCase();
2100
+ if (word === word.toUpperCase())
2101
+ return token.toUpperCase();
2102
+ if (word[0] === word[0].toUpperCase()) {
2103
+ return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
2104
+ }
2105
+ return token.toLowerCase();
2106
+ }
2107
+ function interpolate(str, args) {
2108
+ return str.replace(/\$(\d{1,2})/g, function(match, index) {
2109
+ return args[index] || "";
2110
+ });
2111
+ }
2112
+ function replace(word, rule) {
2113
+ return word.replace(rule[0], function(match, index) {
2114
+ var result = interpolate(rule[1], arguments);
2115
+ if (match === "") {
2116
+ return restoreCase(word[index - 1], result);
2117
+ }
2118
+ return restoreCase(match, result);
2119
+ });
2120
+ }
2121
+ function sanitizeWord(token, word, rules) {
2122
+ if (!token.length || uncountables.hasOwnProperty(token)) {
2123
+ return word;
2124
+ }
2125
+ var len = rules.length;
2126
+ while (len--) {
2127
+ var rule = rules[len];
2128
+ if (rule[0].test(word))
2129
+ return replace(word, rule);
2130
+ }
2131
+ return word;
2132
+ }
2133
+ function replaceWord(replaceMap, keepMap, rules) {
2134
+ return function(word) {
2135
+ var token = word.toLowerCase();
2136
+ if (keepMap.hasOwnProperty(token)) {
2137
+ return restoreCase(word, token);
2138
+ }
2139
+ if (replaceMap.hasOwnProperty(token)) {
2140
+ return restoreCase(word, replaceMap[token]);
2141
+ }
2142
+ return sanitizeWord(token, word, rules);
2143
+ };
2144
+ }
2145
+ function checkWord(replaceMap, keepMap, rules, bool) {
2146
+ return function(word) {
2147
+ var token = word.toLowerCase();
2148
+ if (keepMap.hasOwnProperty(token))
2149
+ return true;
2150
+ if (replaceMap.hasOwnProperty(token))
2151
+ return false;
2152
+ return sanitizeWord(token, token, rules) === token;
2153
+ };
2154
+ }
2155
+ function pluralize2(word, count, inclusive) {
2156
+ var pluralized = count === 1 ? pluralize2.singular(word) : pluralize2.plural(word);
2157
+ return (inclusive ? count + " " : "") + pluralized;
2158
+ }
2159
+ pluralize2.plural = replaceWord(
2160
+ irregularSingles,
2161
+ irregularPlurals,
2162
+ pluralRules
2163
+ );
2164
+ pluralize2.isPlural = checkWord(
2165
+ irregularSingles,
2166
+ irregularPlurals,
2167
+ pluralRules
2168
+ );
2169
+ pluralize2.singular = replaceWord(
2170
+ irregularPlurals,
2171
+ irregularSingles,
2172
+ singularRules
2173
+ );
2174
+ pluralize2.isSingular = checkWord(
2175
+ irregularPlurals,
2176
+ irregularSingles,
2177
+ singularRules
2178
+ );
2179
+ pluralize2.addPluralRule = function(rule, replacement) {
2180
+ pluralRules.push([sanitizeRule(rule), replacement]);
2181
+ };
2182
+ pluralize2.addSingularRule = function(rule, replacement) {
2183
+ singularRules.push([sanitizeRule(rule), replacement]);
2184
+ };
2185
+ pluralize2.addUncountableRule = function(word) {
2186
+ if (typeof word === "string") {
2187
+ uncountables[word.toLowerCase()] = true;
2188
+ return;
2189
+ }
2190
+ pluralize2.addPluralRule(word, "$0");
2191
+ pluralize2.addSingularRule(word, "$0");
2192
+ };
2193
+ pluralize2.addIrregularRule = function(single, plural) {
2194
+ plural = plural.toLowerCase();
2195
+ single = single.toLowerCase();
2196
+ irregularSingles[single] = plural;
2197
+ irregularPlurals[plural] = single;
2198
+ };
2199
+ [
2200
+ // Pronouns.
2201
+ ["I", "we"],
2202
+ ["me", "us"],
2203
+ ["he", "they"],
2204
+ ["she", "they"],
2205
+ ["them", "them"],
2206
+ ["myself", "ourselves"],
2207
+ ["yourself", "yourselves"],
2208
+ ["itself", "themselves"],
2209
+ ["herself", "themselves"],
2210
+ ["himself", "themselves"],
2211
+ ["themself", "themselves"],
2212
+ ["is", "are"],
2213
+ ["was", "were"],
2214
+ ["has", "have"],
2215
+ ["this", "these"],
2216
+ ["that", "those"],
2217
+ // Words ending in with a consonant and `o`.
2218
+ ["echo", "echoes"],
2219
+ ["dingo", "dingoes"],
2220
+ ["volcano", "volcanoes"],
2221
+ ["tornado", "tornadoes"],
2222
+ ["torpedo", "torpedoes"],
2223
+ // Ends with `us`.
2224
+ ["genus", "genera"],
2225
+ ["viscus", "viscera"],
2226
+ // Ends with `ma`.
2227
+ ["stigma", "stigmata"],
2228
+ ["stoma", "stomata"],
2229
+ ["dogma", "dogmata"],
2230
+ ["lemma", "lemmata"],
2231
+ ["schema", "schemata"],
2232
+ ["anathema", "anathemata"],
2233
+ // Other irregular rules.
2234
+ ["ox", "oxen"],
2235
+ ["axe", "axes"],
2236
+ ["die", "dice"],
2237
+ ["yes", "yeses"],
2238
+ ["foot", "feet"],
2239
+ ["eave", "eaves"],
2240
+ ["goose", "geese"],
2241
+ ["tooth", "teeth"],
2242
+ ["quiz", "quizzes"],
2243
+ ["human", "humans"],
2244
+ ["proof", "proofs"],
2245
+ ["carve", "carves"],
2246
+ ["valve", "valves"],
2247
+ ["looey", "looies"],
2248
+ ["thief", "thieves"],
2249
+ ["groove", "grooves"],
2250
+ ["pickaxe", "pickaxes"],
2251
+ ["passerby", "passersby"]
2252
+ ].forEach(function(rule) {
2253
+ return pluralize2.addIrregularRule(rule[0], rule[1]);
2254
+ });
2255
+ [
2256
+ [/s?$/i, "s"],
2257
+ [/[^\u0000-\u007F]$/i, "$0"],
2258
+ [/([^aeiou]ese)$/i, "$1"],
2259
+ [/(ax|test)is$/i, "$1es"],
2260
+ [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
2261
+ [/(e[mn]u)s?$/i, "$1s"],
2262
+ [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
2263
+ [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
2264
+ [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
2265
+ [/(seraph|cherub)(?:im)?$/i, "$1im"],
2266
+ [/(her|at|gr)o$/i, "$1oes"],
2267
+ [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
2268
+ [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
2269
+ [/sis$/i, "ses"],
2270
+ [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
2271
+ [/([^aeiouy]|qu)y$/i, "$1ies"],
2272
+ [/([^ch][ieo][ln])ey$/i, "$1ies"],
2273
+ [/(x|ch|ss|sh|zz)$/i, "$1es"],
2274
+ [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
2275
+ [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
2276
+ [/(pe)(?:rson|ople)$/i, "$1ople"],
2277
+ [/(child)(?:ren)?$/i, "$1ren"],
2278
+ [/eaux$/i, "$0"],
2279
+ [/m[ae]n$/i, "men"],
2280
+ ["thou", "you"]
2281
+ ].forEach(function(rule) {
2282
+ return pluralize2.addPluralRule(rule[0], rule[1]);
2283
+ });
2284
+ [
2285
+ [/s$/i, ""],
2286
+ [/(ss)$/i, "$1"],
2287
+ [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
2288
+ [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
2289
+ [/ies$/i, "y"],
2290
+ [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
2291
+ [/\b(mon|smil)ies$/i, "$1ey"],
2292
+ [/\b((?:tit)?m|l)ice$/i, "$1ouse"],
2293
+ [/(seraph|cherub)im$/i, "$1"],
2294
+ [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
2295
+ [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
2296
+ [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
2297
+ [/(test)(?:is|es)$/i, "$1is"],
2298
+ [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
2299
+ [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
2300
+ [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
2301
+ [/(alumn|alg|vertebr)ae$/i, "$1a"],
2302
+ [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
2303
+ [/(matr|append)ices$/i, "$1ix"],
2304
+ [/(pe)(rson|ople)$/i, "$1rson"],
2305
+ [/(child)ren$/i, "$1"],
2306
+ [/(eau)x?$/i, "$1"],
2307
+ [/men$/i, "man"]
2308
+ ].forEach(function(rule) {
2309
+ return pluralize2.addSingularRule(rule[0], rule[1]);
2310
+ });
2311
+ [
2312
+ // Singular words with no plurals.
2313
+ "adulthood",
2314
+ "advice",
2315
+ "agenda",
2316
+ "aid",
2317
+ "aircraft",
2318
+ "alcohol",
2319
+ "ammo",
2320
+ "analytics",
2321
+ "anime",
2322
+ "athletics",
2323
+ "audio",
2324
+ "bison",
2325
+ "blood",
2326
+ "bream",
2327
+ "buffalo",
2328
+ "butter",
2329
+ "carp",
2330
+ "cash",
2331
+ "chassis",
2332
+ "chess",
2333
+ "clothing",
2334
+ "cod",
2335
+ "commerce",
2336
+ "cooperation",
2337
+ "corps",
2338
+ "debris",
2339
+ "diabetes",
2340
+ "digestion",
2341
+ "elk",
2342
+ "energy",
2343
+ "equipment",
2344
+ "excretion",
2345
+ "expertise",
2346
+ "firmware",
2347
+ "flounder",
2348
+ "fun",
2349
+ "gallows",
2350
+ "garbage",
2351
+ "graffiti",
2352
+ "hardware",
2353
+ "headquarters",
2354
+ "health",
2355
+ "herpes",
2356
+ "highjinks",
2357
+ "homework",
2358
+ "housework",
2359
+ "information",
2360
+ "jeans",
2361
+ "justice",
2362
+ "kudos",
2363
+ "labour",
2364
+ "literature",
2365
+ "machinery",
2366
+ "mackerel",
2367
+ "mail",
2368
+ "media",
2369
+ "mews",
2370
+ "moose",
2371
+ "music",
2372
+ "mud",
2373
+ "manga",
2374
+ "news",
2375
+ "only",
2376
+ "personnel",
2377
+ "pike",
2378
+ "plankton",
2379
+ "pliers",
2380
+ "police",
2381
+ "pollution",
2382
+ "premises",
2383
+ "rain",
2384
+ "research",
2385
+ "rice",
2386
+ "salmon",
2387
+ "scissors",
2388
+ "series",
2389
+ "sewage",
2390
+ "shambles",
2391
+ "shrimp",
2392
+ "software",
2393
+ "species",
2394
+ "staff",
2395
+ "swine",
2396
+ "tennis",
2397
+ "traffic",
2398
+ "transportation",
2399
+ "trout",
2400
+ "tuna",
2401
+ "wealth",
2402
+ "welfare",
2403
+ "whiting",
2404
+ "wildebeest",
2405
+ "wildlife",
2406
+ "you",
2407
+ /pok[eé]mon$/i,
2408
+ // Regexes.
2409
+ /[^aeiou]ese$/i,
2410
+ // "chinese", "japanese"
2411
+ /deer$/i,
2412
+ // "deer", "reindeer"
2413
+ /fish$/i,
2414
+ // "fish", "blowfish", "angelfish"
2415
+ /measles$/i,
2416
+ /o[iu]s$/i,
2417
+ // "carnivorous"
2418
+ /pox$/i,
2419
+ // "chickpox", "smallpox"
2420
+ /sheep$/i
2421
+ ].forEach(pluralize2.addUncountableRule);
2422
+ return pluralize2;
2423
+ });
2424
+ })(pluralize);
2425
+ var pluralizeExports = pluralize.exports;
2426
+ const plur = /* @__PURE__ */ getDefaultExportFromCjs(pluralizeExports);
2427
+ plur.addPluralRule("glomerulus", "glomeruli");
2428
+ plur.addPluralRule("interstitium", "interstitia");
2072
2429
  function fromEntries(iterable) {
2073
2430
  return [...iterable].reduce((obj, { 0: key, 1: val }) => Object.assign(obj, { [key]: val }), {});
2074
2431
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/sets-utils",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -25,8 +25,8 @@
25
25
  "lodash-es": "^4.17.21",
26
26
  "tinycolor2": "^1.4.1",
27
27
  "uuid": "^9.0.0",
28
- "@vitessce/schemas": "3.1.1",
29
- "@vitessce/utils": "3.1.1"
28
+ "@vitessce/schemas": "3.1.3",
29
+ "@vitessce/utils": "3.1.3"
30
30
  },
31
31
  "scripts": {
32
32
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",