
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
[](https://travis-ci.org/tuchk4/rmk)
Docs: Actions | Shortcuts | Utils
Transform Object:
import rmk from 'rmk';
let data = {one: "", two: null, three: undefined, four: {}, five: []}
const formula = rmk(rmk.clear());
const result = formula(data)
// => {}
Transform array:
import rmk from 'rmk';
let data = [{one: "", two: null, a: 1}, {three: undefined, four: {}, five: [], b:2}]
const formula = rmk(rmk.clear());
const result = formula(data)
// => [ {a:1}, {b:2} ]
Shortcut:
import clear from 'rmk/shortcuts/clear';
let data = {one: "", two: null, three: undefined, four: {}, five: []}
const result = clear(data)
// => { birthDate: new Date(1975, 4,3), year: 1975 }
Transform Object:
import rmk from 'rmk';
import toSnakeCase from 'rmk/actions/toSnakeCase';
let data = {fooBar: 1, foo: 2, BAR: 3}
const formula = rmk(toSnakeCase());
const result = formula(data)
// => { foo_bar: 1, foo: 2, bar: 3 }
Transform array:
import rmk from 'rmk';
import toSnakeCase from 'rmk/actions/toSnakeCase';
let data = [{fooBar: 1}, {barBaz: 2}]
const formula = rmk(toSnakeCase());
const result = formula(data)
// => [ {foo_bar: 1}, {bar_baz: 2} ]
Shortcut:
import toSnakeCase from 'rmk/shortcuts/toSnakeCase';
let data = {fooBar: 1, foo: 2, BAR: 3}
const result = toSnakeCase(data)
// => { foo_bar: 1, foo: 2, bar: 3 }
Transform Object:
import rmk from 'rmk';
let data = {foo_bar: 1, foo: 2, BAR: 3}
const formula = rmk(rmk.toCamelCase());
const result = formula(data)
// => { fooBar: 1, foo: 2, bar: 3 }
Transform array:
import rmk from 'rmk';
let data = [{foo_Bar: 1}, {bar_baz: 2}]
const formula = rmk(rmk.toCamelCase());
const result = formula(data)
// => [ {fooBar: 1}, {barBaz: 2} ]
Shortcut:
import toCamelCase from 'rmk/shortcuts/toCamelCase';
let data = {foo_bar: 1, foo: 2, BAR: 3}
const result = toCamelCase(data)
// => { fooBar: 1, foo: 2, bar: 3 }
Transform Object:
import rmk from 'rmk';
let data = {foo: 1, bar: 2}
const formula = rmk(rmk.update({
baz:3
}));
const result = formula(data)
// => { foo: 1, bar: 2, baz:3 }
Transform array:
import rmk from 'rmk';
let data = [{foo: 1}, {foo: 4}]
const formula = rmk(rmk.update({
baz: (localState) => foo + 1
}));
const result = formula(data)
// => [ {foo: 1, baz:2}, {foo: 4, baz:5} ]
Shortcut:
import update from 'rmk/shortcuts/update';
let data = {foo: 1, bar: 2}
const result = update(data, {
baz:3
});
// => {foo: 1, bar: 2, baz:3}
import rmk from 'rmk';
let data = [
{birth_date: new Date(1975, 4,3), user: 1},
{birth_date: new Date(1975, 4,3), user: undefined}
]
const formula = rmk(
rmk.toCamelCase(),
rmk.update({
year: localState => localState.birthDate.getFullYear()
}),
rmk.clear()
);
const result = formula(data);
// => [ {birthDate: new Date(1975, 4,3), year: 1975, user: 1}, {birthDate: new Date(1982, 4,3), year: 1982} ]
import rmk from 'rmk';
let data = [
{birth_date: new Date(1975, 4,3), user: 1},
{birth_date: new Date(1975, 4,3), user: undefined}
]
const formula = rmk(
rmk.toCamelCase(),
rmk.update({
year: localState => localState.birthDate.getFullYear()
}),
rmk.clear()
);
const result = formula(data);
// => [ {birthDate: new Date(1975, 4,3), year: 1975, user: 1}, {birthDate: new Date(1982, 4,3), year: 1982} ]
import rmk from 'rmk';
import shortcuts from 'rmk/shortcuts';
let data = [
{birth_date: new Date(1975, 4,3), user: 1},
{birth_date: new Date(1975, 4,3), user: undefined}
]
const step1 = shortcuts.toCamelCase(data);
const step2 = shortcuts.update(step1, {
year: localState => localState.birthDate.getFullYear()
});
const result = rmkShortcuts.clear(step2);
// => [ {birthDate: new Date(1975, 4,3), year: 1975, user: 1}, {birthDate: new Date(1982, 4,3), year: 1982} ]
FAQs
[](https://travis-ci.org/tuchk4/rmk)
We found that rmk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.