@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.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/is-number.d.ts +11 -0
- package/dist/is-number.d.ts.map +1 -0
- package/dist/is-number.js +12 -0
- package/dist/is-number.js.map +1 -0
- package/dist/is-string.d.ts +11 -0
- package/dist/is-string.d.ts.map +1 -0
- package/dist/is-string.js +12 -0
- package/dist/is-string.js.map +1 -0
- package/eslint.config.ts +6 -0
- package/package.json +42 -0
- package/src/index.ts +4 -0
- package/src/is-number.spec.ts +17 -0
- package/src/is-number.ts +9 -0
- package/src/is-string.spec.ts +17 -0
- package/src/is-string.ts +9 -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,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"}
|
package/eslint.config.ts
ADDED
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,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
|
+
})
|
package/src/is-number.ts
ADDED
|
@@ -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
|
+
})
|
package/src/is-string.ts
ADDED
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
|
+
})
|