Skip to content

Commit

Permalink
fixup: docs and package.json fixes and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous committed Jan 16, 2023
1 parent dc21a44 commit da652dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ See the [main branch][] for the current v4 release.

[i]: https://github.com/mcous
[vite]: https://vitejs.dev/

[Typescript]:
[typescript]: https://www.typescriptlang.org/
[unist]: https://unifiedjs.com/
[hast]: https://github.com/syntax-tree/hast

Expand All @@ -98,7 +97,7 @@ The v5 release will attempt to fix / address the following open issues:
- [x] gerberParser.parseSync clobbers filetype option ([#306][])
- [x] Gerber file starting with newline incorrectly identified as drill file ([#307][])
- [x] Generate consistent document size for all layers. ([#324][])
- [x] G93 code in drill file rendered as drilled hole ([#353][])
- [ ] G93 code in drill file rendered as drilled hole ([#353][])
- [x] Allow soldermask layer to cover vias in board render ([#399][])

[#49]: https://github.com/tracespace/tracespace/issues/49
Expand Down
2 changes: 1 addition & 1 deletion packages/plotter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.0.0-unreleased",
"version": "5.0.0-alpha.0",
"description": "Plot @tracespace/parser ASTs into image trees.",
"types": "./lib/index.d.ts",
"exports": {
Expand Down
22 changes: 11 additions & 11 deletions packages/xml-id/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ npm install @tracespace/xml-id@next
## usage

```js
import {sanitize, random} from '@tracespace/xml-id'
import {ensure, random, sanitize} from '@tracespace/xml-id'
```

The alphabet used by this module is a subset of what is valid for XML which is also CSS identifier and URL friendly.

### ensure(source: unknown, length?: number): string

Given an input `source`, returns a sanitized `source` if it was a string. Otherwise, generates a random ID with length `length` (defaulting to 12 if unspecified).

```js
const id1 = ensure(undefined) // 'w57gH_nT3-o8'
const id2 = ensure(undefined, 8) // 'Gi3ma2Ef'
const id3 = ensure('0abc def.') // '_abc_def_'
```

### random(length?: number): string

Returns a basic, (non-cryptographically-secure) random string that can be safely used as an XML ID. If unspecified or 0, `length` will be 12.
Expand All @@ -38,13 +48,3 @@ Takes a string and replaces any characters that would be invalid in an XML ID wi
```js
const id1 = sanitize('0abc def.') // '_abc_def_'
```

### ensure(source: unknown, length?: number): string

Given an input `source`, returns a sanitized `source` if it was a string. Otherwise, generates a random ID with length `length` (defaulting to 12 if unspecified).

```js
const id1 = ensure(undefined) // 'w57gH_nT3-o8'
const id2 = ensure(undefined, 8) // 'Gi3ma2Ef'
const id3 = ensure('0abc def.') // '_abc_def_'
```

0 comments on commit da652dd

Please sign in to comment.