Socket
Socket
Sign inDemoInstall

lang-mini

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lang-mini - npm Package Compare versions

Comparing version 0.0.33 to 0.0.34

90

examples/combinations.js
const lang = require('../lang-mini');
const {each, combos} = lang;
const util = require('util');
const combo1 = () => {

@@ -20,2 +20,50 @@

const combo2 = () => {
const arr_five_most_frequent_hebrew_letters = ['י', 'ה', 'ו', 'ל', 'א'];
/*
const input1 = [
['י', 'ה', 'ו', 'ל', 'א'],
['י', 'ה', 'ו', 'ל', 'א'],
['י', 'ה', 'ו', 'ל', 'א']
]
*/
const input1 = [
arr_five_most_frequent_hebrew_letters,
arr_five_most_frequent_hebrew_letters,
arr_five_most_frequent_hebrew_letters
]
const res = combos(input1);
//console.log('combo2 res', res);
return res;
}
const combo3 = () => {
// https://www.omniglot.com/conscripts/sehefata.htm
const arr_five_geez_letters_equivalent_to_five_most_frequent_hebrew_letters = ['የ', 'ሀ', 'ወ', 'ለ', 'አ'];
const input1 = [
arr_five_geez_letters_equivalent_to_five_most_frequent_hebrew_letters,
arr_five_geez_letters_equivalent_to_five_most_frequent_hebrew_letters,
arr_five_geez_letters_equivalent_to_five_most_frequent_hebrew_letters
]
const res = combos(input1);
//console.log('combo2 res', res);
return res;
}
if (require.main === module) {

@@ -26,2 +74,42 @@ const res1 = combo1();

const res2 = combo2();
//console.log('res2', res2);
console.log('res2', util.inspect(res2, {
maxArrayLength: 10000, // Set the max length option
//compact: true // Optional: Make the output more concise
}));
//console.log('res2', JSON.stringify(res2));
console.log('res2.length', res2.length);
const r2_as_words = res2.map(x => x.reverse().join(''));
console.log('r2_as_words', util.inspect(r2_as_words, {
maxArrayLength: 10000, // Set the max length option
//compact: true // Optional: Make the output more concise
}));
const res3 = combo3();
//console.log('res2', res2);
console.log('res3', util.inspect(res3, {
maxArrayLength: 10000, // Set the max length option
//compact: true // Optional: Make the output more concise
}));
//console.log('res2', JSON.stringify(res2));
console.log('res3.length', res3.length);
const r3_as_words = res3.map(x => x.join(''));
console.log('r3_as_words', util.inspect(r3_as_words, {
maxArrayLength: 10000, // Set the max length option
//compact: true // Optional: Make the output more concise
}));
//console.log('r3_as_words', r3_as_words);
}

@@ -28,0 +116,0 @@

@@ -10,2 +10,13 @@ /*

// Then it could work on training data for creation of functions from descriptions, either in English or JSON description.
// Late 2023 - May be worth extending to cover / handle data models.
// Integrating further withing Data_Object and Data_Value.
// lang-tools code and examples involving them would help, being able to have data types specified and (auto) validated.
// Including working with async/obs updates too.
*/

@@ -312,3 +323,3 @@

// Seems like grammar contexts will be useful for this.
// Be able to give grammar to a function?
// Be able to give grammar to a function?
// So that the params / io can be understood according to that grammar.

@@ -335,3 +346,2 @@

/*

@@ -338,0 +348,0 @@ identify_obj_against_grammar_matches

@@ -16,2 +16,8 @@ /*

// Possibility of using grammar with Data_Object and Data_Value.
// Though does look like it's worth approaching it from a point of simplicity and efficiency too.
// Efficiency is more important, simplicity can be in an easy and efficient high level API.
// And if it gets called with the wrong data types....?
const multiply_2_numbers = mfp({

@@ -306,2 +312,6 @@ // could name the params?

// Using grammar with mfp seems fairly useful / interesting.
// a kind of grammar specified functional programming system.
const check_credentials = mfp({

@@ -325,2 +335,3 @@ 'name': 'check_credentials',

const [username, password] = arr_credentials;
//console.log('[username, password]', [username, password]);
if (username === 'root') {

@@ -342,3 +353,3 @@ if (password === 'ubuntu') {

let r1 = check_credentials('james', 'hello');
let r1 = check_credentials(['james', 'hello']);
// seems to be working:)

@@ -350,3 +361,3 @@

let r2 = check_credentials('root', 'ubuntu');
let r2 = check_credentials(['root', 'ubuntu']);
// seems to be working:)

@@ -356,3 +367,3 @@

//console.log('r2', r2);
//console.log('**** r2', r2);

@@ -359,0 +370,0 @@ return [r1, r2];

@@ -26,2 +26,4 @@ const lang = require('./lang-mini');

// oext seems to work with types though, or would benefit from types.
// No, oext does not have much for types, moving field and prop from oext here, need to get the data types working with Data_Object
// and Data_Value.

@@ -32,2 +34,7 @@

// Maybe move to lang-tools?
// fp() may benefit from integration with this.
// What the type represents.

@@ -34,0 +41,0 @@ // What it signifies?

2

package.json

@@ -24,3 +24,3 @@ {

},
"version": "0.0.33"
"version": "0.0.34"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc