<commit_before>'use strict'

const _ = require('lodash');
const AtomicCounter = require('./atomic-counter.js');

class ServiceCounter extends AtomicCounter {
	static description() {
		return {
			"key": "registry_service"
		}
	}
	range() {
		if (!this.properties) return [];

		return this.properties.content;
	}
	inc(emitter) {
		let ids = this.properties.content;
		let last = _.last(this.properties.content);
		let id = 'service-' + (pasreInt(last.split('-')[1]) + 1);

		this.properties.content.push(id);

		let data = this.getSourceData();

		return emitter.addTask('database.upsertNodes', {
			args: [data]
		});
	}
}

module.exports = ServiceCounter;
<commit_msg>add method<commit_after>'use strict'

const _ = require('lodash');
const AtomicCounter = require('./atomic-counter.js');

class ServiceCounter extends AtomicCounter {
	static description() {
		return {
			"key": "registry_service"
		}
	}
	range() {
		if (!this.properties) return [];

		return this.properties.content;
	}
	inc(emitter) {
		let ids = this.properties.content;
		let last = _.last(this.properties.content);
		let id = 'service-' + (pasreInt(last.split('-')[1]) + 1);

		this.properties.content.push(id);

		let data = this.getSourceData();

		return emitter.addTask('database.upsertNodes', {
			args: [data]
		});
	}
	add(params, patchwerk) {
		//@NOTE: never use it without strong need
		//@NOTE: this method is fucking unsafe
		//@TODO: rework this ugly concept
		let id = params.id;

		this.properties.content.push(id);

		return patchwerk.save(this)
	}
}

module.exports = ServiceCounter;

{'fraction_non_alphanumeric': 0.1566265060240964, 'fraction_numerical': 0.0025364616360177552, 'mean_word_length': 3.9622641509433962, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6588719', 'n_tokens_mistral': 577, 'n_tokens_neox': 516, 'n_words': 115}