Sha256: b8e7261f41dd775524077306a69c01796bd5a2a742c7338e6607ff4e689bc356

Contents?: true

Size: 1.25 KB

Versions: 51

Compression:

Stored size: 1.25 KB

Contents

declare namespace camelcase {
	interface Options {
		/**
		Uppercase the first character: `foo-bar` → `FooBar`.

		@default false
		*/
		readonly pascalCase?: boolean;
	}
}

declare const camelcase: {
	/**
	Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.

	@param input - String to convert to camel case.

	@example
	```
	import camelCase = require('camelcase');

	camelCase('foo-bar');
	//=> 'fooBar'

	camelCase('foo_bar');
	//=> 'fooBar'

	camelCase('Foo-Bar');
	//=> 'fooBar'

	camelCase('Foo-Bar', {pascalCase: true});
	//=> 'FooBar'

	camelCase('--foo.bar', {pascalCase: false});
	//=> 'fooBar'

	camelCase('foo bar');
	//=> 'fooBar'

	console.log(process.argv[3]);
	//=> '--foo-bar'
	camelCase(process.argv[3]);
	//=> 'fooBar'

	camelCase(['foo', 'bar']);
	//=> 'fooBar'

	camelCase(['__foo__', '--bar'], {pascalCase: true});
	//=> 'FooBar'
	```
	*/
	(input: string | ReadonlyArray<string>, options?: camelcase.Options): string;

	// TODO: Remove this for the next major release, refactor the whole definition to:
	// declare function camelcase(
	// 	input: string | ReadonlyArray<string>,
	// 	options?: camelcase.Options
	// ): string;
	// export = camelcase;
	default: typeof camelcase;
};

export = camelcase;

Version data entries

51 entries across 50 versions & 10 rubygems

Version Path
trusty-cms-6.3.1 node_modules/camelcase/index.d.ts
optimacms-0.1.61 spec/dummy/node_modules/camelcase/index.d.ts
disco_app-0.18.0 test/dummy/node_modules/camelcase/index.d.ts
disco_app-0.18.2 test/dummy/node_modules/camelcase/index.d.ts
trusty-cms-5.0.7 node_modules/camelcase/index.d.ts
trusty-cms-5.0.6 node_modules/camelcase/index.d.ts
trusty-cms-5.0.5 node_modules/camelcase/index.d.ts
trusty-cms-5.0.4 node_modules/camelcase/index.d.ts
disco_app-0.16.1 test/dummy/node_modules/camelcase/index.d.ts
disco_app-0.15.2 test/dummy/node_modules/camelcase/index.d.ts
trusty-cms-5.0.3 node_modules/camelcase/index.d.ts
trusty-cms-5.0.2 node_modules/camelcase/index.d.ts
disco_app-0.18.4 test/dummy/node_modules/camelcase/index.d.ts
disco_app-0.18.1 test/dummy/node_modules/camelcase/index.d.ts
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/camelcase/index.d.ts
disco_app-0.14.0 test/dummy/node_modules/camelcase/index.d.ts
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/camelcase/index.d.ts
trusty-cms-5.0.1 node_modules/camelcase/index.d.ts
trusty-cms-4.3.5 node_modules/camelcase/index.d.ts
trusty-cms-5.0.0 node_modules/camelcase/index.d.ts