Browse Source

feat: KERNEL-798 core/func/string

es6
alan 5 years ago
parent
commit
4e41ad7848
  1. 13
      typescript/core/func/string.ts
  2. 9
      typescript/index.ts

13
typescript/core/func/string.ts

@ -0,0 +1,13 @@
export declare type _startWith = (str: string, startTag: string) => boolean;
export declare type _endWith = (str: string, endTag: string) => boolean;
export declare type _getQuery = (str: string, name: string) => string|null;
export declare type _appendQuery = (str: string, paras: {[key: string]: string|number}) => string;
export declare type _replaceAll = (str: string, s1: string, s2: string) => string;
export declare type _perfectStart = (str: string, start: string) => string;
export declare type _allIndexOf = (str: string, sub: string) => number[];

9
typescript/index.ts

@ -1,6 +1,7 @@
import { _addI18n, _i18nText } from "./core/i18n";
import { _OB } from "./core/ob";
import { _pushArray, _pushDistinct, _pushDistinctArray} from "./core/func/array";
import {_startWith, _allIndexOf, _appendQuery, _endWith, _getQuery, _perfectStart, _replaceAll} from "./core/func/string";
export declare module BI {
namespace i18n {
@ -13,4 +14,12 @@ export declare module BI {
const pushArray: _pushArray;
const pushDistinct: _pushDistinct;
const pushDistinctArray: _pushDistinctArray;
const startWith: _startWith;
const endWith: _endWith;
const allIndexOf: _allIndexOf;
const appendQuery: _appendQuery;
const getQuery: _getQuery;
const perfectStart: _perfectStart;
const replaceAll: _replaceAll;
}

Loading…
Cancel
Save