@jblib/is 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.
@@ -0,0 +1,3 @@
1
+ import { isNumber } from "./is-number.js";
2
+ import { isString } from "./is-string.js";
3
+ export { isNumber, isString };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { isNumber } from "./is-number.js";
2
+ import { isString } from "./is-string.js";
3
+
4
+ export { isNumber, isString };
@@ -0,0 +1,11 @@
1
+ //#region src/is-number.d.ts
2
+ /**
3
+ * Checks if a value is a number.
4
+ *
5
+ * @param v value to check
6
+ * @returns boolean indicating if the value is a number
7
+ */
8
+ declare const isNumber: (v: unknown) => v is number;
9
+ //#endregion
10
+ export { isNumber };
11
+ //# sourceMappingURL=is-number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-number.d.ts","names":[],"sources":["../src/is-number.ts"],"mappings":";;;;;;;cAMM,QAAA,GAAY,CAAA,cAAa,CAAA"}
@@ -0,0 +1,12 @@
1
+ //#region src/is-number.ts
2
+ /**
3
+ * Checks if a value is a number.
4
+ *
5
+ * @param v value to check
6
+ * @returns boolean indicating if the value is a number
7
+ */
8
+ const isNumber = (v) => typeof v === "number";
9
+
10
+ //#endregion
11
+ export { isNumber };
12
+ //# sourceMappingURL=is-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-number.js","names":[],"sources":["../src/is-number.ts"],"sourcesContent":["/**\n * Checks if a value is a number.\n *\n * @param v value to check\n * @returns boolean indicating if the value is a number\n */\nconst isNumber = (v: unknown): v is number => typeof v === 'number'\n\nexport { isNumber }\n"],"mappings":";;;;;;;AAMA,MAAM,YAAY,MAA4B,OAAO,MAAM"}
@@ -0,0 +1,11 @@
1
+ //#region src/is-string.d.ts
2
+ /**
3
+ * Checks if a value is a string.
4
+ *
5
+ * @param v value to check
6
+ * @returns boolean indicating if the value is a string
7
+ */
8
+ declare const isString: (v: unknown) => v is string;
9
+ //#endregion
10
+ export { isString };
11
+ //# sourceMappingURL=is-string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-string.d.ts","names":[],"sources":["../src/is-string.ts"],"mappings":";;;;;;;cAMM,QAAA,GAAY,CAAA,cAAa,CAAA"}
@@ -0,0 +1,12 @@
1
+ //#region src/is-string.ts
2
+ /**
3
+ * Checks if a value is a string.
4
+ *
5
+ * @param v value to check
6
+ * @returns boolean indicating if the value is a string
7
+ */
8
+ const isString = (v) => typeof v === "string";
9
+
10
+ //#endregion
11
+ export { isString };
12
+ //# sourceMappingURL=is-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-string.js","names":[],"sources":["../src/is-string.ts"],"sourcesContent":["/**\n * Checks if a value is a string.\n *\n * @param v value to check\n * @returns boolean indicating if the value is a string\n */\nconst isString = (v: unknown): v is string => typeof v === 'string'\n\nexport { isString }\n"],"mappings":";;;;;;;AAMA,MAAM,YAAY,MAA4B,OAAO,MAAM"}
@@ -0,0 +1,6 @@
1
+ import { jblibConfig } from '@jblib/eslint'
2
+ import { type Linter } from 'eslint'
3
+
4
+ const config: Linter.Config[] = [...jblibConfig]
5
+
6
+ export default config
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@jblib/is",
3
+ "version": "0.0.1",
4
+ "description": "is",
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
+ "is"
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/is"
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,4 @@
1
+ import { isNumber } from './is-number.js'
2
+ import { isString } from './is-string.js'
3
+
4
+ export { isNumber, isString }
@@ -0,0 +1,17 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ import { isNumber } from './is-number.js'
4
+
5
+ describe('is number', () => {
6
+ it('should return true for numbers', () => {
7
+ expect(isNumber(123)).toBe(true)
8
+ })
9
+
10
+ it('should return false for non-numbers', () => {
11
+ expect(isNumber('hello')).toBe(false)
12
+ expect(isNumber({})).toBe(false)
13
+ expect(isNumber([])).toBe(false)
14
+ expect(isNumber(null)).toBe(false)
15
+ expect(isNumber(undefined)).toBe(false)
16
+ })
17
+ })
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Checks if a value is a number.
3
+ *
4
+ * @param v value to check
5
+ * @returns boolean indicating if the value is a number
6
+ */
7
+ const isNumber = (v: unknown): v is number => typeof v === 'number'
8
+
9
+ export { isNumber }
@@ -0,0 +1,17 @@
1
+ import { describe, expect, it } from 'vitest'
2
+
3
+ import { isString } from './is-string.js'
4
+
5
+ describe('is string', () => {
6
+ it('should return true for strings', () => {
7
+ expect(isString('hello')).toBe(true)
8
+ })
9
+
10
+ it('should return false for non-strings', () => {
11
+ expect(isString(123)).toBe(false)
12
+ expect(isString({})).toBe(false)
13
+ expect(isString([])).toBe(false)
14
+ expect(isString(null)).toBe(false)
15
+ expect(isString(undefined)).toBe(false)
16
+ })
17
+ })
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Checks if a value is a string.
3
+ *
4
+ * @param v value to check
5
+ * @returns boolean indicating if the value is a string
6
+ */
7
+ const isString = (v: unknown): v is string => typeof v === 'string'
8
+
9
+ export { isString }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "noEmit": false
6
+ },
7
+ "include": ["src", "*.config.ts"]
8
+ }
@@ -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
+ })
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vitest/config'
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ exclude: ['src/**/*.gen.ts'],
6
+ include: ['src/**/*.spec.ts'],
7
+ },
8
+ resolve: {
9
+ tsconfigPaths: true,
10
+ },
11
+ })