1.0.8 • Published 3 months ago

@lazy-glob/rename v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

README.md

compute rename from glob like pattern

code split from https://github.com/dienluong/mvmv

install

yarn add @lazy-glob/rename
yarn-tool add @lazy-glob/rename
yt add @lazy-glob/rename
import { inspect } from 'util';
import { computeName } from '../lib/util/computeName';

describe(`demo`, () =>
{

	([

		['123.456', '*.*', '**'],
		['123.456', '*.*', '*.ts'],
		[[
			'larry-fine-lines-season1-episode3.txt',
			'moe-howard-lines-s04-ep01.txt',
			'curly-howard-lines-s2-e2.txt',
		], '**-*-lines-*?-*?.txt', '*_*-lines-s?e?.txt'],

		[[
			'larry-fine-lines-season1-episode3.txt',
			'moe-howard-lines-s04-ep01.txt',
			'curly-howard-lines-s2-e2.txt',
		], '*.txt', 'temp/*.old'],

	] as Parameters<typeof computeName>[]).forEach(argv => {

		test(inspect(argv), () =>
		{

			let actual = computeName(...argv);

			console.dir(actual);

			expect(actual).toMatchSnapshot();

		});

	})

})
1.0.8

3 months ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.1

3 years ago