Skip to content

Commit 7efc6b1

Browse files
committed
🥭 w/ wiki
1 parent c0c7a31 commit 7efc6b1

File tree

7 files changed

+31
-29
lines changed

7 files changed

+31
-29
lines changed

TODO

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,18 @@ SEE NOTES
55
- https://www.npmjs.com/package/regex-native-function
66
- https://github.com/hipstersmoothie/compose-tiny
77

8-
_.after
98
_.ary
10-
_.before
11-
_.bind
129
_.bindKey
1310
_.flip
14-
_.negate
1511
_.overArgs
1612
_.partial
1713
_.partialRight
1814
_.rearg
19-
2015
_.spread
2116
_.unspread
22-
2317
_.unary
2418
_.wrap
19+
_.restArguments
2520

2621
http://peter.michaux.ca/articles/lazy-function-definition-pattern
2722
https://css-tricks.com/debouncing-throttling-explained-examples/

build.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const fs = require('fs');
12
const build = require('extra-build');
23

34
const owner = 'nodef';
@@ -88,9 +89,14 @@ function publishPackages(ds) {
8889

8990

9091
// Generate wiki for all exported symbols.
91-
function generateWiki() {
92-
// createWikiFiles();
93-
// generateWikiFiles();
92+
function generateWiki(ds) {
93+
var rkind = /namespace|function/i;
94+
for (var d of ds) {
95+
var f = `wiki/${d.name}.md`;
96+
if (!rkind.test(d.kind)) continue;
97+
if (fs.existsSync(f)) continue;
98+
build.writeFileText(f, build.wikiMarkdown(d));
99+
}
94100
}
95101

96102

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extra-function",
3-
"version": "1.0.11",
3+
"version": "1.0.12",
44
"description": "A collection of ways for transforming functions.",
55
"main": "index.js",
66
"module": "index.mjs",
@@ -33,7 +33,7 @@
3333
"@rollup/plugin-commonjs": "^22.0.1",
3434
"@rollup/plugin-node-resolve": "^13.3.0",
3535
"@types/jest": "^28.1.6",
36-
"extra-build": "^2.2.13",
36+
"extra-build": "^2.2.16",
3737
"extra-sleep": "^1.0.5",
3838
"jest": "^28.1.3",
3939
"rollup-plugin-cleanup": "^3.2.1",

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function ARGUMENTS(...args: any[]): any[] {
3535

3636
/**
3737
* Do nothing.
38+
* @param args arguments (ignored)
3839
*/
3940
export function NOOP(...args: any[]): void {
4041
}

tests/index.test.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ test("is", () => {
110110

111111

112112
test("isAsync", () => {
113-
var a = isAsync(async () => 0)
113+
var a = isAsync(async () => 0);
114114
expect(a).toBe(true);
115-
var a = isAsync(() => 0)
115+
var a = isAsync(() => 0);
116116
expect(a).toBe(false);
117117
});
118118

@@ -233,16 +233,16 @@ test("reverse", () => {
233233
function divide(x: number, y: number) {
234234
return x/y;
235235
}
236-
var fd = reverse(divide);
237-
expect(fd(2, 4)).toBe(2);
238-
expect(fd(2, 6)).toBe(3);
239-
expect(fd(2, 8)).toBe(4);
236+
var fn = reverse(divide);
237+
expect(fn(2, 4)).toBe(2);
238+
expect(fn(2, 6)).toBe(3);
239+
expect(fn(2, 8)).toBe(4);
240240
var array = [1];
241241
function push(...args: number[]) {
242242
array.push(...args);
243243
}
244-
var fp = reverse(push);
245-
fp(2, 3, 4); // push(2, 3, 4) in reverse order
244+
var fn = reverse(push);
245+
fn(2, 3, 4); // push(2, 3, 4) in reverse order
246246
expect(array).toStrictEqual([1, 4, 3, 2]);
247247
});
248248

wiki

Submodule wiki updated from dbf2fb9 to 04bed60

0 commit comments

Comments
 (0)