@willbooster/shared-lib 10.13.0 → 10.14.0
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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/shuffle.cjs +1 -1
- package/dist/shuffle.cjs.map +1 -1
- package/dist/shuffle.d.ts +2 -0
- package/dist/shuffle.js +1 -1
- package/dist/shuffle.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./appEnv.cjs"),t=require("./assert.cjs"),n=require("./githubTemplates.cjs"),r=require("./sleep.cjs"),i=require("./error.cjs"),a=require("./foreignCjk.cjs"),o=require("./humanize.cjs"),s=require("./mail.cjs"),c=require("./markdown.cjs"),l=require("./parseIsoDate.cjs"),u=require("./parseCommandLineArgs.cjs"),d=require("./text.cjs"),f=require("./prompt.cjs"),p=require("./promptFormatters.cjs"),m=require("./shuffle.cjs"),h=require("./recoverJson.cjs"),g=require("./sqlite.cjs"),_=require("./testingRules.cjs"),v=require("./zenkaku.cjs");exports.BUG_ISSUE_SECTIONS=n.BUG_ISSUE_SECTIONS,exports.CHANGE_ISSUE_SECTIONS=n.CHANGE_ISSUE_SECTIONS,exports.ISSUE_TEMPLATE_RULES=n.ISSUE_TEMPLATE_RULES,exports.PULL_REQUEST_BODY_RULES=n.PULL_REQUEST_BODY_RULES,exports.PULL_REQUEST_REQUIREMENTS_RULES=n.PULL_REQUEST_REQUIREMENTS_RULES,exports.PULL_REQUEST_SECTIONS=n.PULL_REQUEST_SECTIONS,exports.TEST_WRITING_RULES=_.TEST_WRITING_RULES,exports.detectForeignCjkInJapanese=a.detectForeignCjkInJapanese,exports.ensureTruthy=t.ensureTruthy,exports.errorify=i.errorify,exports.escapePromptTag=f.escapePromptTag,exports.escapeRegExp=d.escapeRegExp,exports.extractCodeBlocks=c.extractCodeBlocks,exports.extractIfSingleOutermostCodeBlock=c.extractIfSingleOutermostCodeBlock,exports.extractSections=c.extractSections,exports.findForeignCjkCharactersInJapanese=a.findForeignCjkCharactersInJapanese,exports.formatFilesForPrompt=p.formatFilesForPrompt,exports.formatMessagesForPrompt=p.formatMessagesForPrompt,exports.formatPrompt=f.formatPrompt,exports.getAppEnv=e.getAppEnv,exports.getConnectionLevelSqlitePragmas=g.getConnectionLevelSqlitePragmas,exports.getPersistentSqlitePragmas=g.getPersistentSqlitePragmas,exports.humanizeNumber=o.humanizeNumber,exports.ignoreEnoent=i.ignoreEnoent,exports.ignoreEnoentAsync=i.ignoreEnoentAsync,exports.ignoreError=i.ignoreError,exports.ignoreErrorAsync=i.ignoreErrorAsync,exports.mailTemplates=s.mailTemplates,exports.parseCommandLineArgs=u.parseCommandLineArgs,exports.parseIsoDate=l.parseIsoDate,exports.parseMarkdownSections=c.parseMarkdownSections,exports.quoteForShell=d.quoteForShell,exports.recoverJson=h.recoverJson,exports.renderSectionChecklist=n.renderSectionChecklist,exports.renderSectionTemplate=n.renderSectionTemplate,exports.serializeForPrompt=f.serializeForPrompt,exports.serializeForPromptInTag=f.serializeForPromptInTag,exports.shuffle=m.shuffle,exports.sleep=r.sleep,exports.toCodeBlock=d.toCodeBlock,exports.toTildeCodeBlock=d.toTildeCodeBlock,exports.truncateForPrompt=f.truncateForPrompt,exports.withRetry=i.withRetry,exports.zenkakuAlphanumericalsToHankaku=v.zenkakuAlphanumericalsToHankaku;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./appEnv.cjs"),t=require("./assert.cjs"),n=require("./githubTemplates.cjs"),r=require("./sleep.cjs"),i=require("./error.cjs"),a=require("./foreignCjk.cjs"),o=require("./humanize.cjs"),s=require("./mail.cjs"),c=require("./markdown.cjs"),l=require("./parseIsoDate.cjs"),u=require("./parseCommandLineArgs.cjs"),d=require("./text.cjs"),f=require("./prompt.cjs"),p=require("./promptFormatters.cjs"),m=require("./shuffle.cjs"),h=require("./recoverJson.cjs"),g=require("./sqlite.cjs"),_=require("./testingRules.cjs"),v=require("./zenkaku.cjs");exports.BUG_ISSUE_SECTIONS=n.BUG_ISSUE_SECTIONS,exports.CHANGE_ISSUE_SECTIONS=n.CHANGE_ISSUE_SECTIONS,exports.ISSUE_TEMPLATE_RULES=n.ISSUE_TEMPLATE_RULES,exports.PULL_REQUEST_BODY_RULES=n.PULL_REQUEST_BODY_RULES,exports.PULL_REQUEST_REQUIREMENTS_RULES=n.PULL_REQUEST_REQUIREMENTS_RULES,exports.PULL_REQUEST_SECTIONS=n.PULL_REQUEST_SECTIONS,exports.TEST_WRITING_RULES=_.TEST_WRITING_RULES,exports.detectForeignCjkInJapanese=a.detectForeignCjkInJapanese,exports.ensureTruthy=t.ensureTruthy,exports.errorify=i.errorify,exports.escapePromptTag=f.escapePromptTag,exports.escapeRegExp=d.escapeRegExp,exports.extractCodeBlocks=c.extractCodeBlocks,exports.extractIfSingleOutermostCodeBlock=c.extractIfSingleOutermostCodeBlock,exports.extractSections=c.extractSections,exports.findForeignCjkCharactersInJapanese=a.findForeignCjkCharactersInJapanese,exports.formatFilesForPrompt=p.formatFilesForPrompt,exports.formatMessagesForPrompt=p.formatMessagesForPrompt,exports.formatPrompt=f.formatPrompt,exports.getAppEnv=e.getAppEnv,exports.getConnectionLevelSqlitePragmas=g.getConnectionLevelSqlitePragmas,exports.getPersistentSqlitePragmas=g.getPersistentSqlitePragmas,exports.humanizeNumber=o.humanizeNumber,exports.ignoreEnoent=i.ignoreEnoent,exports.ignoreEnoentAsync=i.ignoreEnoentAsync,exports.ignoreError=i.ignoreError,exports.ignoreErrorAsync=i.ignoreErrorAsync,exports.mailTemplates=s.mailTemplates,exports.parseCommandLineArgs=u.parseCommandLineArgs,exports.parseIsoDate=l.parseIsoDate,exports.parseMarkdownSections=c.parseMarkdownSections,exports.quoteForShell=d.quoteForShell,exports.recoverJson=h.recoverJson,exports.renderSectionChecklist=n.renderSectionChecklist,exports.renderSectionTemplate=n.renderSectionTemplate,exports.serializeForPrompt=f.serializeForPrompt,exports.serializeForPromptInTag=f.serializeForPromptInTag,exports.shuffle=m.shuffle,exports.shuffleWithSeed=m.shuffleWithSeed,exports.sleep=r.sleep,exports.toCodeBlock=d.toCodeBlock,exports.toTildeCodeBlock=d.toTildeCodeBlock,exports.truncateForPrompt=f.truncateForPrompt,exports.withRetry=i.withRetry,exports.zenkakuAlphanumericalsToHankaku=v.zenkakuAlphanumericalsToHankaku;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { ParsedIsoDate } from './parseIsoDate.js';
|
|
|
11
11
|
export { parseCommandLineArgs } from './parseCommandLineArgs.js';
|
|
12
12
|
export { escapePromptTag, formatPrompt, serializeForPrompt, serializeForPromptInTag, truncateForPrompt, } from './prompt.js';
|
|
13
13
|
export { formatFilesForPrompt, formatMessagesForPrompt } from './promptFormatters.js';
|
|
14
|
-
export { shuffle } from './shuffle.js';
|
|
14
|
+
export { shuffle, shuffleWithSeed } from './shuffle.js';
|
|
15
15
|
export { recoverJson } from './recoverJson.js';
|
|
16
16
|
export type { JsonRepair, RecoveredJson, JsonRecovery } from './recoverJson.js';
|
|
17
17
|
export { sleep } from './sleep.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAppEnv as e}from"./appEnv.js";import{ensureTruthy as t}from"./assert.js";import{BUG_ISSUE_SECTIONS as n,CHANGE_ISSUE_SECTIONS as r,ISSUE_TEMPLATE_RULES as i,PULL_REQUEST_BODY_RULES as a,PULL_REQUEST_REQUIREMENTS_RULES as o,PULL_REQUEST_SECTIONS as s,renderSectionChecklist as c,renderSectionTemplate as l}from"./githubTemplates.js";import{sleep as u}from"./sleep.js";import{errorify as d,ignoreEnoent as f,ignoreEnoentAsync as p,ignoreError as m,ignoreErrorAsync as h,withRetry as g}from"./error.js";import{detectForeignCjkInJapanese as _,findForeignCjkCharactersInJapanese as v}from"./foreignCjk.js";import{humanizeNumber as y}from"./humanize.js";import{mailTemplates as b}from"./mail.js";import{extractCodeBlocks as x,extractIfSingleOutermostCodeBlock as S,extractSections as C,parseMarkdownSections as w}from"./markdown.js";import{parseIsoDate as T}from"./parseIsoDate.js";import{parseCommandLineArgs as E}from"./parseCommandLineArgs.js";import{escapeRegExp as D,quoteForShell as O,toCodeBlock as k,toTildeCodeBlock as A}from"./text.js";import{escapePromptTag as j,formatPrompt as M,serializeForPrompt as N,serializeForPromptInTag as P,truncateForPrompt as F}from"./prompt.js";import{formatFilesForPrompt as I,formatMessagesForPrompt as L}from"./promptFormatters.js";import{shuffle as R}from"./shuffle.js";import{recoverJson as
|
|
1
|
+
import{getAppEnv as e}from"./appEnv.js";import{ensureTruthy as t}from"./assert.js";import{BUG_ISSUE_SECTIONS as n,CHANGE_ISSUE_SECTIONS as r,ISSUE_TEMPLATE_RULES as i,PULL_REQUEST_BODY_RULES as a,PULL_REQUEST_REQUIREMENTS_RULES as o,PULL_REQUEST_SECTIONS as s,renderSectionChecklist as c,renderSectionTemplate as l}from"./githubTemplates.js";import{sleep as u}from"./sleep.js";import{errorify as d,ignoreEnoent as f,ignoreEnoentAsync as p,ignoreError as m,ignoreErrorAsync as h,withRetry as g}from"./error.js";import{detectForeignCjkInJapanese as _,findForeignCjkCharactersInJapanese as v}from"./foreignCjk.js";import{humanizeNumber as y}from"./humanize.js";import{mailTemplates as b}from"./mail.js";import{extractCodeBlocks as x,extractIfSingleOutermostCodeBlock as S,extractSections as C,parseMarkdownSections as w}from"./markdown.js";import{parseIsoDate as T}from"./parseIsoDate.js";import{parseCommandLineArgs as E}from"./parseCommandLineArgs.js";import{escapeRegExp as D,quoteForShell as O,toCodeBlock as k,toTildeCodeBlock as A}from"./text.js";import{escapePromptTag as j,formatPrompt as M,serializeForPrompt as N,serializeForPromptInTag as P,truncateForPrompt as F}from"./prompt.js";import{formatFilesForPrompt as I,formatMessagesForPrompt as L}from"./promptFormatters.js";import{shuffle as R,shuffleWithSeed as z}from"./shuffle.js";import{recoverJson as B}from"./recoverJson.js";import{getConnectionLevelSqlitePragmas as V,getPersistentSqlitePragmas as H}from"./sqlite.js";import{TEST_WRITING_RULES as U}from"./testingRules.js";import{zenkakuAlphanumericalsToHankaku as W}from"./zenkaku.js";export{n as BUG_ISSUE_SECTIONS,r as CHANGE_ISSUE_SECTIONS,i as ISSUE_TEMPLATE_RULES,a as PULL_REQUEST_BODY_RULES,o as PULL_REQUEST_REQUIREMENTS_RULES,s as PULL_REQUEST_SECTIONS,U as TEST_WRITING_RULES,_ as detectForeignCjkInJapanese,t as ensureTruthy,d as errorify,j as escapePromptTag,D as escapeRegExp,x as extractCodeBlocks,S as extractIfSingleOutermostCodeBlock,C as extractSections,v as findForeignCjkCharactersInJapanese,I as formatFilesForPrompt,L as formatMessagesForPrompt,M as formatPrompt,e as getAppEnv,V as getConnectionLevelSqlitePragmas,H as getPersistentSqlitePragmas,y as humanizeNumber,f as ignoreEnoent,p as ignoreEnoentAsync,m as ignoreError,h as ignoreErrorAsync,b as mailTemplates,E as parseCommandLineArgs,T as parseIsoDate,w as parseMarkdownSections,O as quoteForShell,B as recoverJson,c as renderSectionChecklist,l as renderSectionTemplate,N as serializeForPrompt,P as serializeForPromptInTag,R as shuffle,z as shuffleWithSeed,u as sleep,k as toCodeBlock,A as toTildeCodeBlock,F as truncateForPrompt,g as withRetry,W as zenkakuAlphanumericalsToHankaku};
|
package/dist/shuffle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){for(let t=e.length-1;
|
|
1
|
+
"use strict";function e(e){return n(e,Math.random)}function t(e,t){let r=1779033703^t.length;for(let e of t)r=Math.imul(r^e.codePointAt(0),3432918353),r=r<<13|r>>>19;return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),r^=r>>>16,n(e,()=>{r+=1831565813;let e=Math.imul(r^r>>>15,r|1);return e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296})}function n(e,t){for(let n=e.length-1;n>0;n--){let r=Math.floor(t()*(n+1));[e[n],e[r]]=[e[r],e[n]]}return e}exports.shuffle=e,exports.shuffleWithSeed=t;
|
|
2
2
|
//# sourceMappingURL=shuffle.cjs.map
|
package/dist/shuffle.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shuffle.cjs","names":[],"sources":["../src/shuffle.ts"],"sourcesContent":["export function shuffle<T>(array: T[]): T[] {\n for (let index = array.length - 1; index > 0; index--) {\n const index_ = Math.floor(
|
|
1
|
+
{"version":3,"file":"shuffle.cjs","names":[],"sources":["../src/shuffle.ts"],"sourcesContent":["export function shuffle<T>(array: T[]): T[] {\n return shuffleWithRandom(array, Math.random);\n}\n\n/** Shuffles an array in place, returning the same array. Equal string seeds produce equal permutations. */\nexport function shuffleWithSeed<T>(array: T[], seed: string): T[] {\n let state = 1_779_033_703 ^ seed.length;\n for (const character of seed) {\n state = Math.imul(state ^ character.codePointAt(0)!, 3_432_918_353);\n state = (state << 13) | (state >>> 19);\n }\n state = Math.imul(state ^ (state >>> 16), 2_246_822_507);\n state = Math.imul(state ^ (state >>> 13), 3_266_489_909);\n state ^= state >>> 16;\n\n return shuffleWithRandom(array, () => {\n state += 1_831_565_813;\n let value = Math.imul(state ^ (state >>> 15), state | 1);\n value ^= value + Math.imul(value ^ (value >>> 7), value | 61);\n return ((value ^ (value >>> 14)) >>> 0) / 4_294_967_296;\n });\n}\n\nfunction shuffleWithRandom<T>(array: T[], random: () => number): T[] {\n for (let index = array.length - 1; index > 0; index--) {\n const index_ = Math.floor(random() * (index + 1));\n [array[index], array[index_]] = [array[index_], array[index]] as [T, T];\n }\n return array;\n}\n"],"mappings":"aAAA,SAAgB,EAAW,EAAiB,CAC1C,OAAO,EAAkB,EAAO,KAAK,MAAM,CAC7C,CAGA,SAAgB,EAAmB,EAAY,EAAmB,CAChE,IAAI,EAAQ,WAAgB,EAAK,OACjC,IAAK,IAAM,KAAa,EACtB,EAAQ,KAAK,KAAK,EAAQ,EAAU,YAAY,CAAC,EAAI,UAAa,EAClE,EAAS,GAAS,GAAO,IAAU,GAMrC,MAJA,GAAQ,KAAK,KAAK,EAAS,IAAU,GAAK,UAAa,EACvD,EAAQ,KAAK,KAAK,EAAS,IAAU,GAAK,UAAa,EACvD,GAAS,IAAU,GAEZ,EAAkB,MAAa,CACpC,GAAS,WACT,IAAI,EAAQ,KAAK,KAAK,EAAS,IAAU,GAAK,EAAQ,CAAC,EAEvD,MADA,IAAS,EAAQ,KAAK,KAAK,EAAS,IAAU,EAAI,EAAQ,EAAE,IACnD,EAAS,IAAU,MAAS,GAAK,UAC5C,CAAC,CACH,CAEA,SAAS,EAAqB,EAAY,EAA2B,CACnE,IAAK,IAAI,EAAQ,EAAM,OAAS,EAAG,EAAQ,EAAG,IAAS,CACrD,IAAM,EAAS,KAAK,MAAM,EAAO,GAAK,EAAQ,EAAE,EAChD,CAAC,EAAM,GAAQ,EAAM,IAAW,CAAC,EAAM,GAAS,EAAM,EAAM,CAC9D,CACA,OAAO,CACT"}
|
package/dist/shuffle.d.ts
CHANGED
package/dist/shuffle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e){for(let t=e.length-1;
|
|
1
|
+
function e(e){return n(e,Math.random)}function t(e,t){let r=1779033703^t.length;for(let e of t)r=Math.imul(r^e.codePointAt(0),3432918353),r=r<<13|r>>>19;return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),r^=r>>>16,n(e,()=>{r+=1831565813;let e=Math.imul(r^r>>>15,r|1);return e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296})}function n(e,t){for(let n=e.length-1;n>0;n--){let r=Math.floor(t()*(n+1));[e[n],e[r]]=[e[r],e[n]]}return e}export{e as shuffle,t as shuffleWithSeed};
|
|
2
2
|
//# sourceMappingURL=shuffle.js.map
|
package/dist/shuffle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shuffle.js","names":[],"sources":["../src/shuffle.ts"],"sourcesContent":["export function shuffle<T>(array: T[]): T[] {\n for (let index = array.length - 1; index > 0; index--) {\n const index_ = Math.floor(
|
|
1
|
+
{"version":3,"file":"shuffle.js","names":[],"sources":["../src/shuffle.ts"],"sourcesContent":["export function shuffle<T>(array: T[]): T[] {\n return shuffleWithRandom(array, Math.random);\n}\n\n/** Shuffles an array in place, returning the same array. Equal string seeds produce equal permutations. */\nexport function shuffleWithSeed<T>(array: T[], seed: string): T[] {\n let state = 1_779_033_703 ^ seed.length;\n for (const character of seed) {\n state = Math.imul(state ^ character.codePointAt(0)!, 3_432_918_353);\n state = (state << 13) | (state >>> 19);\n }\n state = Math.imul(state ^ (state >>> 16), 2_246_822_507);\n state = Math.imul(state ^ (state >>> 13), 3_266_489_909);\n state ^= state >>> 16;\n\n return shuffleWithRandom(array, () => {\n state += 1_831_565_813;\n let value = Math.imul(state ^ (state >>> 15), state | 1);\n value ^= value + Math.imul(value ^ (value >>> 7), value | 61);\n return ((value ^ (value >>> 14)) >>> 0) / 4_294_967_296;\n });\n}\n\nfunction shuffleWithRandom<T>(array: T[], random: () => number): T[] {\n for (let index = array.length - 1; index > 0; index--) {\n const index_ = Math.floor(random() * (index + 1));\n [array[index], array[index_]] = [array[index_], array[index]] as [T, T];\n }\n return array;\n}\n"],"mappings":"AAAA,SAAgB,EAAW,EAAiB,CAC1C,OAAO,EAAkB,EAAO,KAAK,MAAM,CAC7C,CAGA,SAAgB,EAAmB,EAAY,EAAmB,CAChE,IAAI,EAAQ,WAAgB,EAAK,OACjC,IAAK,IAAM,KAAa,EACtB,EAAQ,KAAK,KAAK,EAAQ,EAAU,YAAY,CAAC,EAAI,UAAa,EAClE,EAAS,GAAS,GAAO,IAAU,GAMrC,MAJA,GAAQ,KAAK,KAAK,EAAS,IAAU,GAAK,UAAa,EACvD,EAAQ,KAAK,KAAK,EAAS,IAAU,GAAK,UAAa,EACvD,GAAS,IAAU,GAEZ,EAAkB,MAAa,CACpC,GAAS,WACT,IAAI,EAAQ,KAAK,KAAK,EAAS,IAAU,GAAK,EAAQ,CAAC,EAEvD,MADA,IAAS,EAAQ,KAAK,KAAK,EAAS,IAAU,EAAI,EAAQ,EAAE,IACnD,EAAS,IAAU,MAAS,GAAK,UAC5C,CAAC,CACH,CAEA,SAAS,EAAqB,EAAY,EAA2B,CACnE,IAAK,IAAI,EAAQ,EAAM,OAAS,EAAG,EAAQ,EAAG,IAAS,CACrD,IAAM,EAAS,KAAK,MAAM,EAAO,GAAK,EAAQ,EAAE,EAChD,CAAC,EAAM,GAAQ,EAAM,IAAW,CAAC,EAAM,GAAS,EAAM,EAAM,CAC9D,CACA,OAAO,CACT"}
|