@common-fp/shared-internals 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a-or-an.cjs +6 -0
- package/dist/a-or-an.d.cts +2 -0
- package/dist/a-or-an.d.ts +1 -0
- package/dist/a-or-an.mjs +6 -0
- package/dist/assert-arg-has-values-of-type.cjs +29 -0
- package/dist/assert-arg-has-values-of-type.d.cts +2 -0
- package/dist/assert-arg-has-values-of-type.d.ts +1 -0
- package/dist/assert-arg-has-values-of-type.mjs +29 -0
- package/dist/assert-arg-is-array-of-accepted-types.cjs +28 -0
- package/dist/assert-arg-is-array-of-accepted-types.d.cts +2 -0
- package/dist/assert-arg-is-array-of-accepted-types.d.ts +1 -0
- package/dist/assert-arg-is-array-of-accepted-types.mjs +28 -0
- package/dist/assert-arg-is-array-of-same-type.cjs +34 -0
- package/dist/assert-arg-is-array-of-same-type.d.cts +2 -0
- package/dist/assert-arg-is-array-of-same-type.d.ts +1 -0
- package/dist/assert-arg-is-array-of-same-type.mjs +34 -0
- package/dist/assert-arg-is-array-of-type.cjs +18 -0
- package/dist/assert-arg-is-array-of-type.d.cts +2 -0
- package/dist/assert-arg-is-array-of-type.d.ts +1 -0
- package/dist/assert-arg-is-array-of-type.mjs +18 -0
- package/dist/assert-arg-is-char.cjs +19 -0
- package/dist/assert-arg-is-char.d.cts +2 -0
- package/dist/assert-arg-is-char.d.ts +1 -0
- package/dist/assert-arg-is-char.mjs +19 -0
- package/dist/assert-arg-is-int.cjs +35 -0
- package/dist/assert-arg-is-int.d.cts +2 -0
- package/dist/assert-arg-is-int.d.ts +1 -0
- package/dist/assert-arg-is-int.mjs +35 -0
- package/dist/assert-arg-is-one-of-type.cjs +17 -0
- package/dist/assert-arg-is-one-of-type.d.cts +2 -0
- package/dist/assert-arg-is-one-of-type.d.ts +1 -0
- package/dist/assert-arg-is-one-of-type.mjs +17 -0
- package/dist/assert-arg-is-type.cjs +12 -0
- package/dist/assert-arg-is-type.d.cts +2 -0
- package/dist/assert-arg-is-type.d.ts +1 -0
- package/dist/assert-arg-is-type.mjs +12 -0
- package/dist/assert-arg-shares-type-with.cjs +12 -0
- package/dist/assert-arg-shares-type-with.d.cts +2 -0
- package/dist/assert-arg-shares-type-with.d.ts +1 -0
- package/dist/assert-arg-shares-type-with.mjs +12 -0
- package/dist/assert-arg-type-is-one-of.cjs +14 -0
- package/dist/assert-arg-type-is-one-of.d.cts +2 -0
- package/dist/assert-arg-type-is-one-of.d.ts +1 -0
- package/dist/assert-arg-type-is-one-of.mjs +14 -0
- package/dist/common-types.cjs +39 -0
- package/dist/common-types.d.cts +2 -0
- package/dist/common-types.d.ts +1 -0
- package/dist/common-types.mjs +39 -0
- package/dist/contains-type.cjs +9 -0
- package/dist/contains-type.d.cts +2 -0
- package/dist/contains-type.d.ts +1 -0
- package/dist/contains-type.mjs +9 -0
- package/dist/deps/type-detect.cjs +153 -0
- package/dist/deps/type-detect.mjs +153 -0
- package/dist/deps/universal-eol.cjs +18 -0
- package/dist/deps/universal-eol.mjs +18 -0
- package/dist/ensure-number.cjs +10 -0
- package/dist/ensure-number.d.cts +2 -0
- package/dist/ensure-number.d.ts +1 -0
- package/dist/ensure-number.mjs +10 -0
- package/dist/ensure-set.cjs +12 -0
- package/dist/ensure-set.d.cts +2 -0
- package/dist/ensure-set.d.ts +1 -0
- package/dist/ensure-set.mjs +12 -0
- package/dist/eol.cjs +3 -0
- package/dist/eol.d.cts +2 -0
- package/dist/eol.d.ts +1 -0
- package/dist/eol.mjs +3 -0
- package/dist/get-fn-by-type.cjs +9 -0
- package/dist/get-fn-by-type.d.cts +2 -0
- package/dist/get-fn-by-type.d.ts +1 -0
- package/dist/get-fn-by-type.mjs +9 -0
- package/dist/get-fn.cjs +11 -0
- package/dist/get-fn.d.cts +2 -0
- package/dist/get-fn.d.ts +1 -0
- package/dist/get-fn.mjs +11 -0
- package/dist/get-iterator.cjs +23 -0
- package/dist/get-iterator.d.cts +2 -0
- package/dist/get-iterator.d.ts +1 -0
- package/dist/get-iterator.mjs +23 -0
- package/dist/get-random-int.cjs +5 -0
- package/dist/get-random-int.d.cts +2 -0
- package/dist/get-random-int.d.ts +1 -0
- package/dist/get-random-int.mjs +5 -0
- package/dist/get-type.cjs +5 -0
- package/dist/get-type.d.cts +2 -0
- package/dist/get-type.d.ts +1 -0
- package/dist/get-type.mjs +5 -0
- package/dist/index.cjs +30 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +28 -0
- package/dist/negate.cjs +6 -0
- package/dist/negate.d.cts +2 -0
- package/dist/negate.d.ts +1 -0
- package/dist/negate.mjs +6 -0
- package/dist/to-english-list.cjs +12 -0
- package/dist/to-english-list.d.cts +2 -0
- package/dist/to-english-list.d.ts +1 -0
- package/dist/to-english-list.mjs +12 -0
- package/dist/truncate-to-n-chars.cjs +18 -0
- package/dist/truncate-to-n-chars.d.cts +2 -0
- package/dist/truncate-to-n-chars.d.ts +1 -0
- package/dist/truncate-to-n-chars.mjs +18 -0
- package/dist/validate-array-keys.cjs +19 -0
- package/dist/validate-array-keys.d.cts +2 -0
- package/dist/validate-array-keys.d.ts +1 -0
- package/dist/validate-array-keys.mjs +19 -0
- package/dist/validate-is-between-input.cjs +20 -0
- package/dist/validate-is-between-input.d.cts +2 -0
- package/dist/validate-is-between-input.d.ts +1 -0
- package/dist/validate-is-between-input.mjs +20 -0
- package/dist/validate-object-keys.cjs +13 -0
- package/dist/validate-object-keys.d.cts +2 -0
- package/dist/validate-object-keys.d.ts +1 -0
- package/dist/validate-object-keys.mjs +13 -0
- package/dist/validate-range.cjs +14 -0
- package/dist/validate-range.d.cts +2 -0
- package/dist/validate-range.d.ts +1 -0
- package/dist/validate-range.mjs +14 -0
- package/license.txt +106 -0
- package/package.json +39 -0
- package/readme.md +10 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { default as aOrAn } from './a-or-an.mjs'
|
|
2
|
+
export { default as assertArgHasValuesOfType } from './assert-arg-has-values-of-type.mjs'
|
|
3
|
+
export { default as assertArgIsArrayOfAcceptedTypes } from './assert-arg-is-array-of-accepted-types.mjs'
|
|
4
|
+
export { default as assertArgIsArrayOfSameType } from './assert-arg-is-array-of-same-type.mjs'
|
|
5
|
+
export { default as assertArgIsArrayOfType } from './assert-arg-is-array-of-type.mjs'
|
|
6
|
+
export { default as assertArgIsChar } from './assert-arg-is-char.mjs'
|
|
7
|
+
export { default as assertArgIsInt } from './assert-arg-is-int.mjs'
|
|
8
|
+
export { default as assertArgIsOneOfType } from './assert-arg-is-one-of-type.mjs'
|
|
9
|
+
export { default as assertArgIsType } from './assert-arg-is-type.mjs'
|
|
10
|
+
export { default as assertArgSharesTypeWith } from './assert-arg-shares-type-with.mjs'
|
|
11
|
+
export { default as assertArgTypeIsOneOf } from './assert-arg-type-is-one-of.mjs'
|
|
12
|
+
export { default as containsType } from './contains-type.mjs'
|
|
13
|
+
export { default as ensureNumber } from './ensure-number.mjs'
|
|
14
|
+
export { default as ensureSet } from './ensure-set.mjs'
|
|
15
|
+
export { default as eol } from './eol.mjs'
|
|
16
|
+
export { default as getFn } from './get-fn.mjs'
|
|
17
|
+
export { default as getFnByType } from './get-fn-by-type.mjs'
|
|
18
|
+
export { default as getIterator } from './get-iterator.mjs'
|
|
19
|
+
export { default as getRandomInt } from './get-random-int.mjs'
|
|
20
|
+
export { default as getType } from './get-type.mjs'
|
|
21
|
+
export { default as negate } from './negate.mjs'
|
|
22
|
+
export { default as toEnglishList } from './to-english-list.mjs'
|
|
23
|
+
export { default as truncateToNChars } from './truncate-to-n-chars.mjs'
|
|
24
|
+
export { default as validateArrayKeys } from './validate-array-keys.mjs'
|
|
25
|
+
export { default as validateIsBetweenInput } from './validate-is-between-input.mjs'
|
|
26
|
+
export { default as validateObjectKeys } from './validate-object-keys.mjs'
|
|
27
|
+
export { default as validateRange } from './validate-range.mjs'
|
|
28
|
+
export * as commonTypes from './common-types.mjs'
|
package/dist/negate.cjs
ADDED
package/dist/negate.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/negate'
|
package/dist/negate.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const toEnglishList = (andOr, arrOrSet) => {
|
|
2
|
+
const arr = Array.isArray(arrOrSet) ? arrOrSet : [...arrOrSet]
|
|
3
|
+
|
|
4
|
+
if (!arr.length) return ''
|
|
5
|
+
if (arr.length === 1) return arr[0]
|
|
6
|
+
|
|
7
|
+
const start = arr.slice(0, arr.length - 1).join(', ')
|
|
8
|
+
const end = ` ${andOr} ${arr[arr.length - 1]}`
|
|
9
|
+
return start + end
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = toEnglishList
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/to-english-list'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const toEnglishList = (andOr, arrOrSet) => {
|
|
2
|
+
const arr = Array.isArray(arrOrSet) ? arrOrSet : [...arrOrSet]
|
|
3
|
+
|
|
4
|
+
if (!arr.length) return ''
|
|
5
|
+
if (arr.length === 1) return arr[0]
|
|
6
|
+
|
|
7
|
+
const start = arr.slice(0, arr.length - 1).join(', ')
|
|
8
|
+
const end = ` ${andOr} ${arr[arr.length - 1]}`
|
|
9
|
+
return start + end
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default toEnglishList
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* this utility expects a valid value for numChars
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const truncateToNChars = (numChars, anything) => {
|
|
6
|
+
const str = '' + anything
|
|
7
|
+
const chars = str.slice(0, numChars)
|
|
8
|
+
const moreCharsExist = str.length > chars.length
|
|
9
|
+
|
|
10
|
+
return moreCharsExist ? omitLastThree(chars) : chars
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// accounts for strings less than 3 characters
|
|
14
|
+
function omitLastThree(str) {
|
|
15
|
+
return str.replace(/.{0,3}$/, matched => matched.replace(/./g, '.'))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = truncateToNChars
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/truncate-to-n-chars'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* this utility expects a valid value for numChars
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const truncateToNChars = (numChars, anything) => {
|
|
6
|
+
const str = '' + anything
|
|
7
|
+
const chars = str.slice(0, numChars)
|
|
8
|
+
const moreCharsExist = str.length > chars.length
|
|
9
|
+
|
|
10
|
+
return moreCharsExist ? omitLastThree(chars) : chars
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// accounts for strings less than 3 characters
|
|
14
|
+
function omitLastThree(str) {
|
|
15
|
+
return str.replace(/.{0,3}$/, matched => matched.replace(/./g, '.'))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default truncateToNChars
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const truncateToNChars = require('./truncate-to-n-chars.cjs')
|
|
2
|
+
|
|
3
|
+
const validateArrayKeys = (keys, utilName) => {
|
|
4
|
+
const multiDigitRe = /^[1-9]\d+$/
|
|
5
|
+
const singleDigitRe = /^\d$/
|
|
6
|
+
|
|
7
|
+
for (const k of keys) {
|
|
8
|
+
const isValidKey =
|
|
9
|
+
(typeof k === 'number' && Number.isInteger(k) && k >= 0) ||
|
|
10
|
+
(typeof k === 'string' && (multiDigitRe.test(k) || singleDigitRe.test(k)))
|
|
11
|
+
if (!isValidKey) {
|
|
12
|
+
let msg = `when calling ${utilName} with an array, 'keys' must all be integers zero or above`
|
|
13
|
+
msg += `\n invalid key found: ${truncateToNChars(20, k)}`
|
|
14
|
+
throw new Error(msg)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = validateArrayKeys
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/validate-array-keys'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import truncateToNChars from './truncate-to-n-chars.mjs'
|
|
2
|
+
|
|
3
|
+
const validateArrayKeys = (keys, utilName) => {
|
|
4
|
+
const multiDigitRe = /^[1-9]\d+$/
|
|
5
|
+
const singleDigitRe = /^\d$/
|
|
6
|
+
|
|
7
|
+
for (const k of keys) {
|
|
8
|
+
const isValidKey =
|
|
9
|
+
(typeof k === 'number' && Number.isInteger(k) && k >= 0) ||
|
|
10
|
+
(typeof k === 'string' && (multiDigitRe.test(k) || singleDigitRe.test(k)))
|
|
11
|
+
if (!isValidKey) {
|
|
12
|
+
let msg = `when calling ${utilName} with an array, 'keys' must all be integers zero or above`
|
|
13
|
+
msg += `\n invalid key found: ${truncateToNChars(20, k)}`
|
|
14
|
+
throw new Error(msg)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default validateArrayKeys
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const assertArgIsType = require('./assert-arg-is-type.cjs')
|
|
2
|
+
|
|
3
|
+
const validateIsBetweenInput = (
|
|
4
|
+
val1,
|
|
5
|
+
val1Name,
|
|
6
|
+
val2,
|
|
7
|
+
val2Name,
|
|
8
|
+
type,
|
|
9
|
+
utilName,
|
|
10
|
+
{ exclusiveMin, exclusiveMax } = {}
|
|
11
|
+
) => {
|
|
12
|
+
assertArgIsType(val1, val1Name, type, utilName)
|
|
13
|
+
assertArgIsType(val2, val2Name, type, utilName)
|
|
14
|
+
if (exclusiveMin !== undefined)
|
|
15
|
+
assertArgIsType(exclusiveMin, 'exclusiveMin', 'boolean', utilName)
|
|
16
|
+
if (exclusiveMax !== undefined)
|
|
17
|
+
assertArgIsType(exclusiveMax, 'exclusiveMax', 'boolean', utilName)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = validateIsBetweenInput
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/validate-is-between-input'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import assertArgIsType from './assert-arg-is-type.mjs'
|
|
2
|
+
|
|
3
|
+
const validateIsBetweenInput = (
|
|
4
|
+
val1,
|
|
5
|
+
val1Name,
|
|
6
|
+
val2,
|
|
7
|
+
val2Name,
|
|
8
|
+
type,
|
|
9
|
+
utilName,
|
|
10
|
+
{ exclusiveMin, exclusiveMax } = {}
|
|
11
|
+
) => {
|
|
12
|
+
assertArgIsType(val1, val1Name, type, utilName)
|
|
13
|
+
assertArgIsType(val2, val2Name, type, utilName)
|
|
14
|
+
if (exclusiveMin !== undefined)
|
|
15
|
+
assertArgIsType(exclusiveMin, 'exclusiveMin', 'boolean', utilName)
|
|
16
|
+
if (exclusiveMax !== undefined)
|
|
17
|
+
assertArgIsType(exclusiveMax, 'exclusiveMax', 'boolean', utilName)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default validateIsBetweenInput
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const ct = require('./common-types.cjs')
|
|
2
|
+
|
|
3
|
+
const validateObjectKeys = (keys, utilName) => {
|
|
4
|
+
for (const k of keys) {
|
|
5
|
+
if (!ct.objectKey.has(typeof k)) {
|
|
6
|
+
let msg = `when calling ${utilName} with an object, 'keys' must all be typeof string or number`
|
|
7
|
+
msg += `\n invalid key type found: ${typeof k}`
|
|
8
|
+
throw new Error(msg)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = validateObjectKeys
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/validate-object-keys'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as ct from './common-types.mjs'
|
|
2
|
+
|
|
3
|
+
const validateObjectKeys = (keys, utilName) => {
|
|
4
|
+
for (const k of keys) {
|
|
5
|
+
if (!ct.objectKey.has(typeof k)) {
|
|
6
|
+
let msg = `when calling ${utilName} with an object, 'keys' must all be typeof string or number`
|
|
7
|
+
msg += `\n invalid key type found: ${typeof k}`
|
|
8
|
+
throw new Error(msg)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default validateObjectKeys
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* validateRange assumes we're validating the range of array indices. Use
|
|
3
|
+
* 'validateIsBetweenInput' if you're trying to validate more general types e.g.
|
|
4
|
+
* a date range or decimals
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const assertArgIsInt = require('./assert-arg-is-int.cjs')
|
|
8
|
+
|
|
9
|
+
const validateRange = (startIdx, endIdx, utilName) => {
|
|
10
|
+
assertArgIsInt(startIdx, 'startIdx', utilName, { nonNegative: true })
|
|
11
|
+
assertArgIsInt(endIdx, 'endIdx', utilName, { nonNegative: true })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = validateRange
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@common-fp/shared-internals-types/validate-range'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* validateRange assumes we're validating the range of array indices. Use
|
|
3
|
+
* 'validateIsBetweenInput' if you're trying to validate more general types e.g.
|
|
4
|
+
* a date range or decimals
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import assertArgIsInt from './assert-arg-is-int.mjs'
|
|
8
|
+
|
|
9
|
+
const validateRange = (startIdx, endIdx, utilName) => {
|
|
10
|
+
assertArgIsInt(startIdx, 'startIdx', utilName, { nonNegative: true })
|
|
11
|
+
assertArgIsInt(endIdx, 'endIdx', utilName, { nonNegative: true })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default validateRange
|
package/license.txt
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
There are two sections in this file
|
|
2
|
+
|
|
3
|
+
1. The license for this package
|
|
4
|
+
2. The licenses for dependencies embedded in this package
|
|
5
|
+
|
|
6
|
+
#############
|
|
7
|
+
# Section 1 #
|
|
8
|
+
#############
|
|
9
|
+
|
|
10
|
+
You can choose between either of the two licenses listed below
|
|
11
|
+
|
|
12
|
+
WTFNMF
|
|
13
|
+
Zero-Clause BSD
|
|
14
|
+
|
|
15
|
+
This choice is offered since WTFNMF is not OSI approved.
|
|
16
|
+
|
|
17
|
+
--------------------
|
|
18
|
+
|
|
19
|
+
DO WHAT THE FUCK YOU WANT TO BUT IT'S NOT MY FAULT PUBLIC LICENSE
|
|
20
|
+
Version 1, October 2013
|
|
21
|
+
|
|
22
|
+
Copyright Phil Olson <philip.olson@pm.me>
|
|
23
|
+
|
|
24
|
+
Everyone is permitted to copy and distribute verbatim or modified
|
|
25
|
+
copies of this license document, and changing it is allowed as long
|
|
26
|
+
as the name is changed.
|
|
27
|
+
|
|
28
|
+
DO WHAT THE FUCK YOU WANT TO BUT IT'S NOT MY FAULT PUBLIC LICENSE
|
|
29
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
30
|
+
|
|
31
|
+
0. You just DO WHAT THE FUCK YOU WANT TO.
|
|
32
|
+
|
|
33
|
+
1. Do not hold the author(s), creator(s), developer(s) or
|
|
34
|
+
distributor(s) liable for anything that happens or goes wrong
|
|
35
|
+
with your use of the work.
|
|
36
|
+
|
|
37
|
+
--------------------
|
|
38
|
+
|
|
39
|
+
Copyright Phil Olson <philip.olson@pm.me>
|
|
40
|
+
|
|
41
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
42
|
+
with or without fee is hereby granted.
|
|
43
|
+
|
|
44
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
45
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
46
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
47
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
48
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
49
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
50
|
+
THIS SOFTWARE.
|
|
51
|
+
|
|
52
|
+
--------------------
|
|
53
|
+
|
|
54
|
+
#############
|
|
55
|
+
# Section 2 #
|
|
56
|
+
#############
|
|
57
|
+
|
|
58
|
+
license for type-detect embedded at ./src/deps/type-detect.mjs
|
|
59
|
+
from github.com/chaijs/type-detect#4415ced2c49007f097627515806553e7f649c293Z
|
|
60
|
+
|
|
61
|
+
Copyright (c) 2013 Jake Luer <jake@alogicalparadox.com> (http://alogicalparadox.com)
|
|
62
|
+
|
|
63
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
64
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
65
|
+
in the Software without restriction, including without limitation the rights
|
|
66
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
67
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
68
|
+
furnished to do so, subject to the following conditions:
|
|
69
|
+
|
|
70
|
+
The above copyright notice and this permission notice shall be included in
|
|
71
|
+
all copies or substantial portions of the Software.
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
75
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
76
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
77
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
78
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
79
|
+
THE SOFTWARE.
|
|
80
|
+
|
|
81
|
+
--------------------
|
|
82
|
+
|
|
83
|
+
license for universal-eol embedded at ./src/deps/universal-eol.mjs
|
|
84
|
+
from https://github.com/p2227/universal-eol#b3139118238f207a6ff38850b4134ebd4754ff07
|
|
85
|
+
|
|
86
|
+
MIT License
|
|
87
|
+
|
|
88
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
89
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
90
|
+
in the Software without restriction, including without limitation the rights
|
|
91
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
92
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
93
|
+
furnished to do so, subject to the following conditions:
|
|
94
|
+
|
|
95
|
+
The above copyright notice and this permission notice shall be included in all
|
|
96
|
+
copies or substantial portions of the Software.
|
|
97
|
+
|
|
98
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
99
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
100
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
101
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
102
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
103
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
104
|
+
SOFTWARE.
|
|
105
|
+
|
|
106
|
+
--------------------
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@common-fp/shared-internals",
|
|
3
|
+
"description": "Code used to build common-fp utilities",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"types": "./dist/index.d.cts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./*": {
|
|
15
|
+
"import": "./dist/*.mjs",
|
|
16
|
+
"require": "./dist/*.cjs",
|
|
17
|
+
"types": "./dist/*.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./deps/*": null,
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"common-fp",
|
|
27
|
+
"shared-internals"
|
|
28
|
+
],
|
|
29
|
+
"author": "Phil Olson",
|
|
30
|
+
"license": "SEE LICENSE IN license.txt",
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"@common-fp/shared-internals-types": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@common-fp/shared-internals-types": "^0.1.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Common FP - Shared Internals
|
|
2
|
+
|
|
3
|
+
On npm: `@common-fp/shared-internals`
|
|
4
|
+
|
|
5
|
+
This holds functions used to build the `common-fp` utilities - things like
|
|
6
|
+
input assertions and determining the input type.
|
|
7
|
+
|
|
8
|
+
This package exists because originally I imagined sharing the internals for
|
|
9
|
+
other devs to build their own FP utilities. But I've decided to wait on that
|
|
10
|
+
because it would take time to refine the API and write documentation.
|