@jblib/should 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/should-be-true.d.ts +5 -0
- package/dist/should-be-true.d.ts.map +1 -0
- package/dist/should-be-true.js +6 -0
- package/dist/should-be-true.js.map +1 -0
- package/eslint.config.ts +6 -0
- package/package.json +42 -0
- package/src/index.ts +3 -0
- package/src/should-be-true.spec.ts +22 -0
- package/src/should-be-true.ts +3 -0
- package/tsconfig.json +8 -0
- package/tsdown.config.ts +23 -0
- package/vitest.config.ts +11 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-be-true.d.ts","names":[],"sources":["../src/should-be-true.ts"],"mappings":";cAAM,YAAA,GAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-be-true.js","names":[],"sources":["../src/should-be-true.ts"],"sourcesContent":["const shouldBeTrue = (v: unknown): boolean => v === true\n\nexport { shouldBeTrue }\n"],"mappings":";AAAA,MAAM,gBAAgB,MAAwB,MAAM"}
|
package/eslint.config.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jblib/should",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "should",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsdown",
|
|
8
|
+
"test": "vitest",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"lint:fix": "eslint . --fix"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"vitest": "catalog:",
|
|
14
|
+
"typescript": "catalog:",
|
|
15
|
+
"@jblib/eslint": "workspace:*",
|
|
16
|
+
"prettier": "catalog:",
|
|
17
|
+
"tsdown": "catalog:"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"should"
|
|
21
|
+
],
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "Joseph Beck"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/joseph-beck/jblib.git",
|
|
28
|
+
"directory": "packages/should"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"packageManager": "pnpm@10.33.0",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": "./src/index.ts",
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"exports": {
|
|
38
|
+
".": "./dist/index.js",
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { shouldBeTrue } from './should-be-true.js'
|
|
4
|
+
|
|
5
|
+
describe('should be true', () => {
|
|
6
|
+
it('should return true for true', () => {
|
|
7
|
+
expect(shouldBeTrue(true)).toBe(true)
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
it('should return false for false', () => {
|
|
11
|
+
expect(shouldBeTrue(false)).toBe(false)
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('should return false for non-true values', () => {
|
|
15
|
+
expect(shouldBeTrue(123)).toBe(false)
|
|
16
|
+
expect(shouldBeTrue('hello')).toBe(false)
|
|
17
|
+
expect(shouldBeTrue({})).toBe(false)
|
|
18
|
+
expect(shouldBeTrue([])).toBe(false)
|
|
19
|
+
expect(shouldBeTrue(null)).toBe(false)
|
|
20
|
+
expect(shouldBeTrue(undefined)).toBe(false)
|
|
21
|
+
})
|
|
22
|
+
})
|
package/tsconfig.json
ADDED
package/tsdown.config.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from 'tsdown'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['./src/index.ts'],
|
|
5
|
+
format: ['esm'],
|
|
6
|
+
platform: 'node',
|
|
7
|
+
unbundle: true,
|
|
8
|
+
dts: true,
|
|
9
|
+
sourcemap: true,
|
|
10
|
+
clean: true,
|
|
11
|
+
minify: false,
|
|
12
|
+
fixedExtension: false,
|
|
13
|
+
exports: {
|
|
14
|
+
devExports: true,
|
|
15
|
+
},
|
|
16
|
+
publint: {
|
|
17
|
+
strict: true,
|
|
18
|
+
},
|
|
19
|
+
attw: {
|
|
20
|
+
profile: 'esm-only',
|
|
21
|
+
level: 'error',
|
|
22
|
+
},
|
|
23
|
+
})
|