@pistachiojs/core 0.1.0-dev.0 → 0.1.0-dev.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/package.json +4 -1
- package/CHANGELOG.md +0 -7
- package/src/index.ts +0 -1
- package/src/strings/index.ts +0 -1
- package/src/strings/to-capitalize.ts +0 -10
- package/tests/strings/to-capitalize.test.ts +0 -28
- package/tsconfig.json +0 -7
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pistachiojs/core",
|
|
3
3
|
"description": "-",
|
|
4
|
-
"version": "0.1.0-dev.
|
|
4
|
+
"version": "0.1.0-dev.1",
|
|
5
5
|
"author": "Dirga Prakesha <dirga.prakesha@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.esm.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
11
14
|
"scripts": {
|
|
12
15
|
"build": "rollup -c ../../rollup.config.mjs --environment TARGET:core",
|
|
13
16
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
|
package/CHANGELOG.md
DELETED
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './strings'
|
package/src/strings/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './to-capitalize'
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a string to capitalize.
|
|
3
|
-
* @param value - Value string to capitalize.
|
|
4
|
-
* @returns Value string capitalize.
|
|
5
|
-
*/
|
|
6
|
-
export function toCapitalize(value: string): string {
|
|
7
|
-
if (value.length === 0) return value
|
|
8
|
-
|
|
9
|
-
return value.charAt(0).toUpperCase() + value.slice(1)
|
|
10
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { toCapitalize } from '../../src/strings'
|
|
3
|
-
|
|
4
|
-
describe('toCapitalize', () => {
|
|
5
|
-
it('should capitalize lower case strings', () => {
|
|
6
|
-
expect(toCapitalize('hello')).toBe('Hello')
|
|
7
|
-
expect(toCapitalize('world')).toBe('World')
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
it('should handle already capitalized strings', () => {
|
|
11
|
-
expect(toCapitalize('Hello')).toBe('Hello')
|
|
12
|
-
expect(toCapitalize('Z')).toBe('Z')
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('should handle single characters', () => {
|
|
16
|
-
expect(toCapitalize('a')).toBe('A')
|
|
17
|
-
expect(toCapitalize('Z')).toBe('Z')
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('should handle empty strings', () => {
|
|
21
|
-
expect(toCapitalize('')).toBe('')
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('should only capitalize first character', () => {
|
|
25
|
-
expect(toCapitalize('hello world')).toBe('Hello world')
|
|
26
|
-
expect(toCapitalize('hELLO')).toBe('HELLO')
|
|
27
|
-
})
|
|
28
|
-
})
|