![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@ambassify/language-object
Advanced tools
Readme
npm install --save @ambassify/language-object
This package expose a parse-js parser, a method to test for multilingual objects and a method to cast objects.
For more info on parse-js see the documentation.
Example:
const parser = require('@ambassify/language-object/parser');
parse.register('languageObject', require())
parse().json().languageObject().parse({
nl: 'hallo',
en: 'hello'
});
Returns
{
__type: 'multilingual',
nl: 'hallo',
en: 'hello'
}
isMultilingual will check if the __type
property equals multilingual
if set.
__type
property is set, but does not equal multilingual
it will return false
.__type
property is undefined this method will check whether the only enumerable properties
are valid languages as supplied by the second argument to isMultilingual
.__type
is missing and languages
is not set or empty it will always return false
.isMultilingual(languageObject, [languages])
Example:
const isMultilingual = require('@ambassify/language-object/ismultilingual');
const obj = {
nl: 'hallo',
en: 'hello'
};
isMultilingual(obj, ['en','nl']); // true
isMultilingual(obj, ['en']); // false
Casts language-object to include __type
and valid language keys.
Unless force
is set to true
, it uses isMultilingual
to validate objects first, if an object is not valid it will return null
.
cast(languageObject, [languages], [force=false])
Example:
const cast = require('@ambassify/language-object/cast');
const obj = {
nl: 'hallo',
en: 'hello'
};
cast(obj, ['en','nl']);
Returns
{
__type: 'multilingual',
nl: 'hallo',
en: 'hello'
}
FAQs
Detection and conversion library for language objects.
The npm package @ambassify/language-object receives a total of 12 weekly downloads. As such, @ambassify/language-object popularity was classified as not popular.
We found that @ambassify/language-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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 now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.