@voiceflow/common 7.25.0 → 7.25.3

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.
@@ -1,5 +1,6 @@
1
1
  export declare const SPACE_REGEXP: RegExp;
2
2
  export declare const SLOT_REGEXP: RegExp;
3
+ export declare const SLOT_ANNOTATION_SIMPLE_REGEX: RegExp;
3
4
  export declare const IS_VARIABLE_REGEXP: RegExp;
4
5
  export declare const READABLE_VARIABLE_REGEXP: RegExp;
5
6
  export declare const VALID_CHARACTER = "a-zA-Z";
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VALID_SAMPLE_UTTERANCE = exports.VALID_SAMPLE_CHARACTERS = exports.VALID_SAMPLE_CHARACTERS_WITHOUT_CURLY_BRACES_OR_SPACES = exports.VALID_SPOKEN_CHARACTER = exports.VALID_LATIN_CHARACTER = exports.VALID_CHARACTER = exports.READABLE_VARIABLE_REGEXP = exports.IS_VARIABLE_REGEXP = exports.SLOT_REGEXP = exports.SPACE_REGEXP = void 0;
3
+ exports.VALID_SAMPLE_UTTERANCE = exports.VALID_SAMPLE_CHARACTERS = exports.VALID_SAMPLE_CHARACTERS_WITHOUT_CURLY_BRACES_OR_SPACES = exports.VALID_SPOKEN_CHARACTER = exports.VALID_LATIN_CHARACTER = exports.VALID_CHARACTER = exports.READABLE_VARIABLE_REGEXP = exports.IS_VARIABLE_REGEXP = exports.SLOT_ANNOTATION_SIMPLE_REGEX = exports.SLOT_REGEXP = exports.SPACE_REGEXP = void 0;
4
4
  exports.SPACE_REGEXP = / /g;
5
5
  exports.SLOT_REGEXP = /{{\[([^ .[\]{}]*?)]\.([^ .[\]{}]*?)}}/g;
6
+ exports.SLOT_ANNOTATION_SIMPLE_REGEX = /{([^ .[\]{}]+?)}/g;
6
7
  exports.IS_VARIABLE_REGEXP = /^{.*}$/;
7
8
  exports.READABLE_VARIABLE_REGEXP = /{(\w{1,64})}/g;
8
9
  exports.VALID_CHARACTER = 'a-zA-Z';
@@ -38,3 +38,8 @@ export declare type ArrayUnionToIntersection<T extends ArrayLike<unknown>> = Saf
38
38
  export declare type PrimitiveMap<T extends PropertyKey> = {
39
39
  [P in T]: P;
40
40
  };
41
+ export declare type Join<T extends any[]> = T extends [AnyRecord, ...infer R] ? T[0] & Join<R> : {};
42
+ export declare type Tuple<T1, T2> = [T1, T2];
43
+ export declare type TupleFirst<T> = T extends Tuple<infer R, any> ? R : never;
44
+ export declare type TupleSecond<T> = T extends Tuple<any, infer R> ? R : never;
45
+ export declare type Pair<T> = Tuple<T, T>;
@@ -34,7 +34,7 @@ const reorder = (items, fromIndex, toIndex) => {
34
34
  if (fromIndex < 0 || fromIndex >= items.length) {
35
35
  return items;
36
36
  }
37
- if (toIndex < 0) {
37
+ if (toIndex <= 0) {
38
38
  return [items[fromIndex], ...(0, exports.without)(items, fromIndex)];
39
39
  }
40
40
  if (toIndex >= items.length) {
@@ -1,5 +1,6 @@
1
1
  export declare const SPACE_REGEXP: RegExp;
2
2
  export declare const SLOT_REGEXP: RegExp;
3
+ export declare const SLOT_ANNOTATION_SIMPLE_REGEX: RegExp;
3
4
  export declare const IS_VARIABLE_REGEXP: RegExp;
4
5
  export declare const READABLE_VARIABLE_REGEXP: RegExp;
5
6
  export declare const VALID_CHARACTER = "a-zA-Z";
@@ -1,5 +1,6 @@
1
1
  export const SPACE_REGEXP = / /g;
2
2
  export const SLOT_REGEXP = /{{\[([^ .[\]{}]*?)]\.([^ .[\]{}]*?)}}/g;
3
+ export const SLOT_ANNOTATION_SIMPLE_REGEX = /{([^ .[\]{}]+?)}/g;
3
4
  export const IS_VARIABLE_REGEXP = /^{.*}$/;
4
5
  export const READABLE_VARIABLE_REGEXP = /{(\w{1,64})}/g;
5
6
  export const VALID_CHARACTER = 'a-zA-Z';
@@ -38,3 +38,8 @@ export declare type ArrayUnionToIntersection<T extends ArrayLike<unknown>> = Saf
38
38
  export declare type PrimitiveMap<T extends PropertyKey> = {
39
39
  [P in T]: P;
40
40
  };
41
+ export declare type Join<T extends any[]> = T extends [AnyRecord, ...infer R] ? T[0] & Join<R> : {};
42
+ export declare type Tuple<T1, T2> = [T1, T2];
43
+ export declare type TupleFirst<T> = T extends Tuple<infer R, any> ? R : never;
44
+ export declare type TupleSecond<T> = T extends Tuple<any, infer R> ? R : never;
45
+ export declare type Pair<T> = Tuple<T, T>;
@@ -20,7 +20,7 @@ export const reorder = (items, fromIndex, toIndex) => {
20
20
  if (fromIndex < 0 || fromIndex >= items.length) {
21
21
  return items;
22
22
  }
23
- if (toIndex < 0) {
23
+ if (toIndex <= 0) {
24
24
  return [items[fromIndex], ...without(items, fromIndex)];
25
25
  }
26
26
  if (toIndex >= items.length) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@voiceflow/common",
3
3
  "description": "Junk drawer of utility functions",
4
- "version": "7.25.0",
4
+ "version": "7.25.3",
5
5
  "author": "Voiceflow",
6
6
  "bugs": {
7
7
  "url": "https://github.com/voiceflow/libs/issues"
@@ -76,5 +76,5 @@
76
76
  "test:single": "NODE_ENV=test ts-mocha --paths --config config/tests/mocharc.yml",
77
77
  "test:unit": "NODE_ENV=test nyc --report-dir=nyc_coverage_unit ts-mocha --paths --config config/tests/mocharc.yml 'tests/**/*.unit.ts'"
78
78
  },
79
- "gitHead": "667df22d884b655813e09d2fc6ca0adfb3463a8a"
79
+ "gitHead": "af1863006aa5748d2f373bff4a9aaa69b3a20333"
80
80
  }