Skip to content

Commit

Permalink
Merge branch 'release/release/0.13.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Sep 25, 2023
2 parents 97718ed + f60c1ec commit c8bbd58
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 35 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeed",
"type": "module",
"version": "0.13.11",
"version": "0.13.12",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down Expand Up @@ -67,12 +67,12 @@
"watch": "nr build:tsup -- --watch"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.3",
"@antfu/eslint-config": "^0.42.0",
"@antfu/ni": "^0.21.8",
"@types/node": "^20",
"c8": "^8.0.1",
"cross-fetch": "^4.0.0",
"esbuild": "^0.19.2",
"esbuild": "^0.19.3",
"eslint": "^8.49.0",
"madge": "^6.1.0",
"tsup": "^7.2.0",
Expand Down
9 changes: 2 additions & 7 deletions src/browser/base64.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
// (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved.

/** @deprecated */
export function urlBase64ToUint8Array(
base64String: string,
): Uint8Array | undefined {
/** @deprecated use fromBase64 instead */
export function urlBase64ToUint8Array(base64String: string): Uint8Array | undefined {
const padding = '='.repeat((4 - (base64String.length % 4)) % 4)
const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/')

const rawData = window.atob(base64)
const outputArray = new Uint8Array(rawData.length)

for (let i = 0; i < rawData.length; ++i)
outputArray[i] = rawData.charCodeAt(i)

return outputArray
}
24 changes: 17 additions & 7 deletions src/common/log/log-filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ describe('log-filter', () => {
{
const matches = useNamespaceFilter('a')
expect(matches.filter).toBe('a')
expect(matches.accept).toEqual([/^a$/])
expect(matches.accept).toEqual([/^a/])
expect(matches.reject).toEqual([])
expect(matches('a')).toBe(true)
expect(matches('aa')).toBe(false)
expect(matches('aa')).toBe(true)
expect(matches('b:c')).toBe(false)
}
{
const matches = useNamespaceFilter('a*')
expect(matches.filter).toBe('a*')
expect(matches.accept).toEqual([/^a.*?$/])
expect(matches.accept).toEqual([/^a.*?/])
expect(matches.reject).toEqual([])
expect(matches('a')).toBe(true)
expect(matches('aa')).toBe(true)
Expand All @@ -36,8 +36,8 @@ describe('log-filter', () => {
{
const matches = useNamespaceFilter('a*,b*,-c*')
expect(matches.filter).toBe('a*,b*,-c*')
expect(matches.accept).toEqual([/^a.*?$/, /^b.*?$/])
expect(matches.reject).toEqual([/^c.*?$/])
expect(matches.accept).toEqual([/^a.*?/, /^b.*?/])
expect(matches.reject).toEqual([/^c.*?/])
expect(matches('a')).toBe(true)
expect(matches('aa')).toBe(true)
expect(matches('b:c')).toBe(true)
Expand All @@ -46,8 +46,18 @@ describe('log-filter', () => {
{
const matches = useNamespaceFilter('*,-c*')
expect(matches.filter).toBe('*,-c*')
expect(matches.accept).toEqual([/^.*?$/])
expect(matches.reject).toEqual([/^c.*?$/])
expect(matches.accept).toEqual([/^.*?/])
expect(matches.reject).toEqual([/^c.*?/])
expect(matches('a')).toBe(true)
expect(matches('aa')).toBe(true)
expect(matches('b:c')).toBe(true)
expect(matches('c:d')).toBe(false)
}
{
const matches = useNamespaceFilter('*,-c')
expect(matches.filter).toBe('*,-c')
expect(matches.accept).toEqual([/^.*?/])
expect(matches.reject).toEqual([/^c/])
expect(matches('a')).toBe(true)
expect(matches('aa')).toBe(true)
expect(matches('b:c')).toBe(true)
Expand Down
4 changes: 2 additions & 2 deletions src/common/log/log-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export function useNamespaceFilter(
}
const template = split[i].replace(/\*/g, '.*?')
if (template[0] === '-')
reject.push(new RegExp(`^${template.substr(1)}$`))
reject.push(new RegExp(`^${template.substr(1)}`))
else
accept.push(new RegExp(`^${template}$`))
accept.push(new RegExp(`^${template}`))
}

fn = function (name: string) {
Expand Down
32 changes: 16 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"declaration": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "preserve",
"target": "ES2020",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable"
],
"jsx": "preserve",
"module": "ES2020",
"moduleResolution": "node",
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"strictNullChecks": true,
"target": "ES2020",
"baseUrl": ".",
"types": [
"node",
"vitest/globals"
]
],
"resolveJsonModule": true,
"allowJs": true,
"declaration": true,
"sourceMap": true,
"isolatedModules": true,
"esModuleInterop": true,
"strict": true,
"strictNullChecks": true
},
"include": [
"src/**/*.ts",
"vitest-setup.ts"
],
"exclude": [
"_archive",
"node_modules",
"dist"
],
"include": [
"src/**/*.ts",
"vitest-setup.ts"
]
}

0 comments on commit c8bbd58

Please sign in to comment.