@codemod-utils/ember-cli-string
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -0,1 +1,20 @@ | ||
/** | ||
* Returns a string in camel-case. | ||
* | ||
* @param value | ||
* | ||
* A string. | ||
* | ||
* @return | ||
* | ||
* The string in camel case. | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* const newValue = camelize('css-class-name'); | ||
* | ||
* // 'cssClassName' | ||
* ``` | ||
*/ | ||
export declare function camelize(value: string): string; |
/* https://github.com/ember-cli/ember-cli-string-utils/blob/v1.1.0/index.js */ | ||
const STRING_CAMELIZE_REGEXP = /(-|_|\.|\s)+(.)?/g; | ||
/** | ||
* Returns a string in camel-case. | ||
* | ||
* @param value | ||
* | ||
* A string. | ||
* | ||
* @return | ||
* | ||
* The string in camel case. | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* const newValue = camelize('css-class-name'); | ||
* | ||
* // 'cssClassName' | ||
* ``` | ||
*/ | ||
export function camelize(value) { | ||
@@ -4,0 +23,0 @@ return value |
@@ -0,1 +1,21 @@ | ||
/** | ||
* Returns a string that can be used to name a JavaScript `class` | ||
* (a.k.a. Pascal case). | ||
* | ||
* @param value | ||
* | ||
* A string (an entity name). | ||
* | ||
* @return | ||
* | ||
* The string in Pascal case. | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* const newValue = classify('ui/button'); | ||
* | ||
* // 'UiButton' | ||
* ``` | ||
*/ | ||
export declare function classify(value: string): string; |
/* https://github.com/ember-cli/ember-cli-string-utils/blob/v1.1.0/index.js */ | ||
/* https://github.com/emberjs/ember.js/blob/v5.2.0/blueprints/component/index.js#L255-L256 */ | ||
/* https://github.com/emberjs/ember.js/blob/v5.3.0/blueprints/component/index.js#L255-L256 */ | ||
import { camelize } from './camelize.js'; | ||
/** | ||
* Returns a string that can be used to name a JavaScript `class` | ||
* (a.k.a. Pascal case). | ||
* | ||
* @param value | ||
* | ||
* A string (an entity name). | ||
* | ||
* @return | ||
* | ||
* The string in Pascal case. | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* const newValue = classify('ui/button'); | ||
* | ||
* // 'UiButton' | ||
* ``` | ||
*/ | ||
export function classify(value) { | ||
@@ -5,0 +25,0 @@ const tokens = value.replace(/\//g, '-').split('.'); |
@@ -0,1 +1,21 @@ | ||
/** | ||
* Returns a string associated with the angle bracket syntax | ||
* for components. | ||
* | ||
* @param value | ||
* | ||
* A string (an entity name). | ||
* | ||
* @return | ||
* | ||
* The string with double colon(s) (`::`). | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* const newValue = doubleColonize('ui/button'); | ||
* | ||
* // 'Ui::Button' | ||
* ``` | ||
*/ | ||
export declare function doubleColonize(value: string): string; |
@@ -1,3 +0,23 @@ | ||
/* https://github.com/emberjs/ember.js/blob/v5.2.0/blueprints/component-test/index.js#L13-L16 */ | ||
/* https://github.com/emberjs/ember.js/blob/v5.3.0/blueprints/component-test/index.js#L13-L16 */ | ||
import { classify } from './classify.js'; | ||
/** | ||
* Returns a string associated with the angle bracket syntax | ||
* for components. | ||
* | ||
* @param value | ||
* | ||
* A string (an entity name). | ||
* | ||
* @return | ||
* | ||
* The string with double colon(s) (`::`). | ||
* | ||
* @example | ||
* | ||
* ```ts | ||
* const newValue = doubleColonize('ui/button'); | ||
* | ||
* // 'Ui::Button' | ||
* ``` | ||
*/ | ||
export function doubleColonize(value) { | ||
@@ -4,0 +24,0 @@ const tokens = value.split('/'); |
{ | ||
"name": "@codemod-utils/ember-cli-string", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Utilities for string, as used by Ember CLI", | ||
@@ -40,12 +40,12 @@ "keywords": [ | ||
"@sondr3/minitest": "^0.1.2", | ||
"@types/lodash.template": "^4.5.1", | ||
"@types/node": "^18.17.15", | ||
"concurrently": "^8.2.1", | ||
"eslint": "^8.49.0", | ||
"@types/lodash.template": "^4.5.2", | ||
"@types/node": "^18.18.6", | ||
"concurrently": "^8.2.2", | ||
"eslint": "^8.52.0", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.2.2", | ||
"@shared-configs/typescript": "0.0.0", | ||
"@shared-configs/eslint-config-node": "0.0.0", | ||
"@codemod-utils/tests": "1.1.1", | ||
"@shared-configs/prettier": "0.0.0", | ||
"@codemod-utils/tests": "1.0.0" | ||
"@shared-configs/eslint-config-node": "0.0.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "engines": { |
@@ -22,8 +22,8 @@ [![This project uses GitHub Actions for continuous integration.](https://github.com/ijlee2/codemod-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/ijlee2/codemod-utils/actions/workflows/ci.yml) | ||
Create a string that is camel-cased. | ||
Returns a string in camel-case. | ||
```js | ||
```ts | ||
import { camelize } from '@codemod-utils/ember-cli-string'; | ||
camelize('css-class-name'); | ||
const newValue = camelize('css-class-name'); | ||
@@ -36,8 +36,8 @@ // 'cssClassName' | ||
Create a string that can be used to name a JavaScript `class`. | ||
Returns a string that can be used to name a JavaScript `class` (a.k.a. Pascal case). | ||
```js | ||
```ts | ||
import { classify } from '@codemod-utils/ember-cli-string'; | ||
const classifiedName = classify('ui/button'); | ||
const newValue = classify('ui/button'); | ||
@@ -50,8 +50,8 @@ // 'UiButton' | ||
Create a string that can be used to invoke a component with the angle bracket syntax. | ||
Returns a string associated with the angle bracket syntax for components. | ||
```js | ||
```ts | ||
import { doubleColonize } from '@codemod-utils/ember-cli-string'; | ||
doubleColonize('ui/button'); | ||
const newValue = doubleColonize('ui/button'); | ||
@@ -58,0 +58,0 @@ // 'Ui::Button' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7734
156