Skip to content

Commit

Permalink
Merge branch 'release/v0.15.24'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Dec 8, 2023
2 parents 665823c + d9c3164 commit deb582f
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 53 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ on:
tags:
- 'v*'

# on:
# push:
# branches:
# - main
# - master
# release:
# types: [created]
# # workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"upgrade": true,
"install": "prompt",
"packageManager": "pnpm",
"reject": [
]
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeed",
"type": "module",
"version": "0.15.23",
"version": "0.15.24",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down Expand Up @@ -69,18 +69,18 @@
"watch": "nr build:tsup -- --watch"
},
"devDependencies": {
"@antfu/eslint-config": "^2.2.2",
"@antfu/eslint-config": "^2.4.2",
"@antfu/ni": "^0.21.12",
"@types/node": "^20.10.3",
"@types/node": "^20.10.4",
"c8": "^8.0.1",
"cross-fetch": "^4.0.0",
"esbuild": "^0.19.8",
"eslint": "^8.55.0",
"madge": "^6.1.0",
"tsup": "^8.0.1",
"typedoc": "^0.25.4",
"typescript": "^5.3.2",
"vite": "^5.0.5",
"vitest": "^0.34.6"
"typescript": "^5.3.3",
"vite": "^5.0.6",
"vitest": "^1.0.2"
}
}
10 changes: 5 additions & 5 deletions src/common/csv.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ describe('csv.spec', () => {
])
expect(txt).toMatchInlineSnapshot(`
"1,one,10000000000,1e10,1.23
2,\\"two
lines\\",,,1
3,\\"tree \\"\\"drei\\"\\"\\",{},\\"{\\"\\"a\\"\\":1}\\",\\"[1,2,3]\\"
2,"two
lines",,,1
3,"tree ""drei""",{},"{""a"":1}","[1,2,3]"
"
`)

Expand All @@ -34,9 +34,9 @@ describe('csv.spec', () => {
],
Array [
"3",
"tree \\"drei\\"",
"tree "drei"",
"{}",
"{\\"a\\":1}",
"{"a":1}",
"[1,2,3]",
],
]
Expand Down
4 changes: 2 additions & 2 deletions src/common/data/bin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ Uint8Array [
expect(hex).toMatchInlineSnapshot(`
"0000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................
0010 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................
0020 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F .!\\"#$%&'()*+,-./
0020 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F .!"#$%&'()*+,-./
0030 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>?
0040 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO
0050 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\\\\]^_
0050 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\\]^_
0060 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F \`abcdefghijklmno
0070 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F pqrstuvwxyz{|}~.
0080 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F ................
Expand Down
18 changes: 9 additions & 9 deletions src/common/data/deep.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,21 @@ describe('deep', () => {
// Haha, this is simpler :) But not working in lists
expect(JSON.stringify(sample, null, 2)).toMatchInlineSnapshot(`
"{
\\"hello\\": {
\\"world\\": -1,
\\"null1\\": null,
\\"sea\\": \\"none\\"
"hello": {
"world": -1,
"null1": null,
"sea": "none"
},
\\"other\\": [
"other": [
{
\\"fish\\": 8
"fish": 8
},
null,
null,
\\"Hello\\"
"Hello"
],
\\"before\\": {
\\"magic\\": 666
"before": {
"magic": 666
}
}"
`)
Expand Down
2 changes: 1 addition & 1 deletion src/common/data/json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('convert', () => {
}
}
const t = new Test(new Uint8Array([1, 2, 3]))
expect(jsonStringifySafe(t)).toMatchInlineSnapshot('"{\\"id\\":{\\"0\\":1,\\"1\\":2,\\"2\\":3}}"')
expect(jsonStringifySafe(t)).toMatchInlineSnapshot(`"{"id":{"0":1,"1":2,"2":3}}"`)
})

it('should jsonParse', () => {
Expand Down
17 changes: 8 additions & 9 deletions src/common/dispose-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import type { DisposerFunction } from './dispose-types'
import { promisify } from './exec'
import type { LoggerInterface } from './log/log-base'

export function useTimeout(
fn: DisposerFunction,
timeout = 0,
): DisposerFunction {
export type TimerExecFunction = () => void | Promise<void>

export function useTimeout(fn: TimerExecFunction, timeout = 0): DisposerFunction {
let timeoutHandle: any = setTimeout(fn, timeout)
return () => {
if (timeoutHandle) {
Expand All @@ -17,7 +16,7 @@ export function useTimeout(
}
}

export function useInterval(fn: DisposerFunction, interval: number): DisposerFunction {
export function useInterval(fn: TimerExecFunction, interval: number): DisposerFunction {
let intervalHandle: any = setInterval(fn, interval)
return () => {
if (intervalHandle) {
Expand All @@ -28,7 +27,7 @@ export function useInterval(fn: DisposerFunction, interval: number): DisposerFun
}

/** The interval starts only, when the function is finished. */
export function useIntervalPause(fn: DisposerFunction, interval: number, immediately = false): DisposerFunction {
export function useIntervalPause(fn: TimerExecFunction, interval: number, immediately = false): DisposerFunction {
let intervalHandle: any
let stop = false

Expand Down Expand Up @@ -94,9 +93,9 @@ export function useEventListenerOnce(
export function useDisposeWithUtils(config?: string | UseDisposeConfig | LoggerInterface) {
const dispose = useDispose(config)
return Object.assign(dispose, {
timeout: (fn: DisposerFunction, timeout = 0) => dispose.add(useTimeout(fn, timeout)),
interval: (fn: DisposerFunction, interval = 0) => dispose.add(useInterval(fn, interval)),
intervalPause: (fn: DisposerFunction, interval = 0) => dispose.add(useIntervalPause(fn, interval)),
timeout: (fn: TimerExecFunction, timeout = 0) => dispose.add(useTimeout(fn, timeout)),
interval: (fn: TimerExecFunction, interval = 0) => dispose.add(useInterval(fn, interval)),
intervalPause: (fn: TimerExecFunction, interval = 0) => dispose.add(useIntervalPause(fn, interval)),
on: (emitter: any, eventName: string, fn: (ev?: any) => void, ...args: any[]) => dispose.add(useEventListener(emitter, eventName, fn, ...args)),
once: (emitter: any, eventName: string, fn: (ev?: any) => void, ...args: any[]) => dispose.add(useEventListenerOnce(emitter, eventName, fn, ...args)),
})
Expand Down
2 changes: 1 addition & 1 deletion src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('treeshake', () => {
// <stdin>
var a = [1, 2, 3, 3];
var aa = arrayUnion(a);
console.log(\\"result arrayUnion\\", aa);
console.log("result arrayUnion", aa);
})();
"
`)
Expand Down
2 changes: 1 addition & 1 deletion src/node/args.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('args.spec', () => {
"listItem",
],
"someNumber": 123,
"someOne": "\\"empty string\\"",
"someOne": ""empty string"",
}
`)
})
Expand Down
10 changes: 0 additions & 10 deletions tsconfig-cjs.json

This file was deleted.

0 comments on commit deb582f

Please sign in to comment.