File tree Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 11.DS_Store
2+ * .d.ts
23* .log
34coverage /
45node_modules /
Original file line number Diff line number Diff line change 1+ /**
2+ * @typedef {import('unist').Node } Node
3+ *
4+ * @typedef {Object } NormalizeOptions
5+ * @property {boolean } [allowDashes=false]
6+ * @property {boolean } [allowApostrophes=false]
7+ */
8+
19import { toString } from 'nlcst-to-string'
210
11+ /**
12+ * @param {string|Node|Array.<Node> } node
13+ * @param {NormalizeOptions } [options={}]
14+ */
315export function normalize ( node , options ) {
416 var value = ( typeof node === 'string' ? node : toString ( node ) )
517 . toLowerCase ( )
Original file line number Diff line number Diff line change 2424 "sideEffects" : false ,
2525 "type" : " module" ,
2626 "main" : " index.js" ,
27+ "types" : " index.d.ts" ,
2728 "files" : [
29+ " index.d.ts" ,
2830 " index.js"
2931 ],
3032 "dependencies" : {
33+ "@types/unist" : " ^2.0.0" ,
3134 "nlcst-to-string" : " ^3.0.0"
3235 },
3336 "devDependencies" : {
37+ "@types/tape" : " ^4.0.0" ,
3438 "c8" : " ^7.0.0" ,
3539 "prettier" : " ^2.0.0" ,
3640 "remark-cli" : " ^9.0.0" ,
3741 "remark-preset-wooorm" : " ^8.0.0" ,
42+ "rimraf" : " ^3.0.0" ,
3843 "tape" : " ^5.0.0" ,
44+ "type-coverage" : " ^2.0.0" ,
45+ "typescript" : " ^4.0.0" ,
3946 "xo" : " ^0.39.0"
4047 },
4148 "scripts" : {
49+ "prepack" : " npm run build && npm run format" ,
50+ "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
4251 "format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
4352 "test-api" : " node test.js" ,
4453 "test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
45- "test" : " npm run format && npm run test-coverage"
54+ "test" : " npm run build && npm run format && npm run test-coverage"
4655 },
4756 "prettier" : {
4857 "tabWidth" : 2 ,
6372 "plugins" : [
6473 " preset-wooorm"
6574 ]
75+ },
76+ "typeCoverage" : {
77+ "atLeast" : 100 ,
78+ "detail" : true ,
79+ "strict" : true
6680 }
6781}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import {normalize} from './index.js'
33
44test ( 'Basic' , function ( t ) {
55 t . throws ( function ( ) {
6+ // @ts -ignore runtime.
67 normalize ( true )
78 } , 'should fail when given a boolean' )
89
Original file line number Diff line number Diff line change 1+ {
2+ "include" : [" *.js" ],
3+ "compilerOptions" : {
4+ "target" : " ES2020" ,
5+ "lib" : [" ES2020" ],
6+ "module" : " ES2020" ,
7+ "moduleResolution" : " node" ,
8+ "allowJs" : true ,
9+ "checkJs" : true ,
10+ "declaration" : true ,
11+ "emitDeclarationOnly" : true ,
12+ "allowSyntheticDefaultImports" : true ,
13+ "skipLibCheck" : true
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments